Versions in this module Expand all Collapse all v0 v0.2.1 Sep 3, 2026 Changes in this version + func ECDSASign(priv *ecdsa.PrivateKey, data []byte) ([]byte, error) + func ECDSAVerify(pub *ecdsa.PublicKey, data, sig []byte) error + func Ed25519Sign(priv ed25519.PrivateKey, data []byte) ([]byte, error) + func Ed25519Verify(pub ed25519.PublicKey, data, sig []byte) error + func ExportECDSAPrivateKeyPEM(priv *ecdsa.PrivateKey) (string, error) + func ExportECDSAPublicKeyPEM(pub *ecdsa.PublicKey) (string, error) + func ExportEd25519PrivateKeyPEM(priv ed25519.PrivateKey) (string, error) + func ExportEd25519PublicKeyPEM(pub ed25519.PublicKey) (string, error) + func GenerateECDSAKeyPair() (*ecdsa.PrivateKey, *ecdsa.PublicKey, error) + func GenerateEd25519KeyPair() (ed25519.PrivateKey, ed25519.PublicKey, error) + func HKDF(secret, salt, info []byte, length int) ([]byte, error) + func PBKDF2(password, salt []byte, iterations, length int) ([]byte, error) + func ParseECDSAPrivateKeyPEM(pemStr string) (*ecdsa.PrivateKey, error) + func ParseECDSAPublicKeyPEM(pemStr string) (*ecdsa.PublicKey, error) + func ParseEd25519PrivateKeyPEM(pemStr string) (ed25519.PrivateKey, error) + func ParseEd25519PublicKeyPEM(pemStr string) (ed25519.PublicKey, error) v0.2.0 Aug 15, 2026 Changes in this version + func AESCBCDecrypt(key, data []byte) ([]byte, error) + func AESCBCEncrypt(key, plaintext []byte) ([]byte, error) + func AESCFBDecrypt(key, ciphertext []byte) ([]byte, error) + func AESCFBEncrypt(key, plaintext []byte) ([]byte, error) + func AESGCMDecrypt(key, data []byte) ([]byte, error) + func AESGCMDecryptBase64(key []byte, encoded string) ([]byte, error) + func AESGCMEncrypt(key, plaintext []byte) ([]byte, error) + func AESGCMEncryptBase64(key, plaintext []byte) (string, error) + func Base64Decode(s string) ([]byte, error) + func Base64Encode(data []byte) string + func Base64URLDecode(s string) ([]byte, error) + func Base64URLEncode(data []byte) string + func ExportRSAPrivateKeyPEM(priv *rsa.PrivateKey) (string, error) + func ExportRSAPublicKeyPEM(pub *rsa.PublicKey) (string, error) + func GenerateRSAKeyPair(bits int) (*rsa.PrivateKey, *rsa.PublicKey, error) + func MustRandomKey(n int) []byte + func ParseRSAPrivateKeyPEM(pemStr string) (*rsa.PrivateKey, error) + func ParseRSAPublicKeyPEM(pemStr string) (*rsa.PublicKey, error) + func RC4Decrypt(str string, key []byte) string + func RC4Encrypt(str string, key []byte) string + func RSADecrypt(priv *rsa.PrivateKey, ciphertext []byte) ([]byte, error) + func RSAEncrypt(pub *rsa.PublicKey, plaintext []byte) ([]byte, error) + func RSASign(priv *rsa.PrivateKey, data []byte) ([]byte, error) + func RSAVerify(pub *rsa.PublicKey, data, sig []byte) error + func RandomBase64(n int) (string, error) + func RandomHex(n int) (string, error) + func RandomKey(n int) ([]byte, error) + func RandomReader() io.Reader + func SignSHA256(data, key []byte) []byte + func SignSHA512(data, key []byte) []byte + func VerifySHA256(data, key, sig []byte) bool + func VerifySHA512(data, key, sig []byte) bool + type JWT struct + func NewJWT(cfg JWTConfig) *JWT + func (j *JWT) Parse(token string) (*JWTClaims, error) + func (j *JWT) Sign(claims JWTClaims) (string, error) + func (j *JWT) Verify(token string) (*JWTClaims, error) + type JWTAlgorithm string + const JWTAlgHS256 + const JWTAlgHS512 + const JWTAlgRS256 + type JWTClaims struct + Audience string + ExpiresAt int64 + Extra map[string]interface{} + ID string + IssuedAt int64 + Issuer string + NotBefore int64 + Subject string + type JWTConfig struct + Algorithm JWTAlgorithm + Audience string + ExpiresIn time.Duration + Issuer string + RSAPriv *rsa.PrivateKey + RSAPub *rsa.PublicKey + Secret []byte