Versions in this module Expand all Collapse all v0 v0.1.0 Oct 5, 2021 Changes in this version + type Cipher struct + Compressor Compressor + Encrypter Encrypter + Serializer Serializer + Signer Signer + StringEncoder StringEncoder + func NewAESCipher(aesKey []byte) (*Cipher, error) + func NewHMACSHA256Signer(aesKey []byte) (*Cipher, error) + func NewRSACipher(privateKeyPem []byte) (*Cipher, error) + func NewRSAEncryptOnlyCipher(publicKeypem []byte) (*Cipher, error) + func NewRSASigner(privateKeyPem []byte) (*Cipher, error) + func NewRSASignerVerifyOnly(publicKeypem []byte) (*Cipher, error) + func (c Cipher) Decrypt(ciphertext []byte, dst interface{}) error + func (c Cipher) DecryptString(ciphertext string, dst interface{}) error + func (c Cipher) Encrypt(data interface{}) ([]byte, error) + func (c Cipher) EncryptToString(data interface{}) (string, error) + func (c Cipher) Sign(data interface{}) (signature string, bytesSigned []byte, err error) + func (c Cipher) SignToString(data interface{}) (signature string, signedData string, err error) + func (c Cipher) Verify(data interface{}, signature string) error + func (c Cipher) VerifyAndLoad(signedData []byte, signature string, dst interface{}) error + func (c Cipher) VerifyStringAndLoad(signedData string, signature string, dst interface{}) error + type Compressor interface + Compress func([]byte) ([]byte, error) + Decompress func([]byte) ([]byte, error) + var Gzip Compressor = GzipCompression(gzip.BestCompression) + var Zlib Compressor = ZlibCompression(zlib.BestCompression) + func GzipCompression(level int) Compressor + func ZlibCompression(level int) Compressor + type Encrypter interface + Decrypt func(ciphertext []byte) ([]byte, error) + Encrypt func(plaintext []byte) ([]byte, error) + func AES(key []byte) (Encrypter, error) + func RSA(privateKeyPem []byte) (Encrypter, error) + func RSAEncryptOnly(publicKeyPem []byte) (Encrypter, error) + type Serializer interface + Deserialize func([]byte, interface{}) error + Serialize func(interface{}) ([]byte, error) + var Bytes Serializer = bytesSerializer{} + var Gob Serializer = gobSerializer{} + var JSON Serializer = jsonSerializer{} + var String Serializer = stringSerializer{} + type Signer interface + Sign func(data []byte) ([]byte, error) + Verify func(data []byte, signature []byte) error + func HMACSHA256(key []byte) (Signer, error) + func RSASigner(privateKeyPem []byte) (Signer, error) + func RSAVerifyOnly(publicKeyPem []byte) (Signer, error) + type StringEncoder interface + DecodeString func(s string) ([]byte, error) + EncodeToString func(src []byte) string + var DefaultStringEncoder StringEncoder = base64.RawURLEncoding