Versions in this module Expand all Collapse all v1 v1.0.1 Aug 15, 2024 Changes in this version + func AesGcmDecrypt(key, ciphertext, additionalData []byte) (plaintext []byte, err error) + func AesGcmDecryptWithNonce(key, ciphertext, nonce, additionalData []byte) (plaintext []byte, err error) + func AesGcmEncrypt(key, plaintext, additionalData []byte) (ciphertext []byte, err error) + func AesGcmEncryptWithNonce(key, plaintext, additionalData []byte) (ciphertext, nonce []byte, err error) + func DecodeString(data string, encodedType Encode) ([]byte, error) + func EncodeToString(data []byte, encodeType Encode) (string, error) + func GenRsaKey(bits int) ([]byte, []byte, error) + func GenerateAes256Key() ([]byte, error) + func ParsePrivateKey(privateKeyDecoded []byte, keyType Secret) (*rsa.PrivateKey, error) + func PrefixAppend000Length(b []byte) ([]byte, error) + func PrefixUnAppend000Length(b []byte) (under, remains []byte, err error) + type Encode uint + const Base64 + const HEX + const String + type RSACrypt struct + func NewRSACrypt(secretInfo RSASecret) *RSACrypt + func (rc *RSACrypt) Decrypt(src string, srcType Encode) (dst string, err error) + func (rc *RSACrypt) Encrypt(src string, outputDataType Encode) (dst string, err error) + type RSASecret struct + PrivateKey string + PrivateKeyDataType Encode + PrivateKeyType Secret + PublicKey string + PublicKeyDataType Encode + type Secret uint + const PKCS1 + const PKCS8