Versions in this module Expand all Collapse all v3 v3.1.0 Mar 14, 2021 v3.0.0 Feb 19, 2021 Changes in this version + const TxtMask + func DecryptByAes256Gcm(key, nonce, additionalData []byte, cipherText string) ([]byte, error) + func EncryptByAes256Gcm(key, nonce, additionalData []byte, plainText string) (string, error) + func GenerateSignature(privateKey *rsa.PrivateKey, reqSign *RequestSignature, mchId, serialNo string) (string, error) + func LoadRSAPrivateKey(buffer []byte) (*rsa.PrivateKey, error) + func LoadRSAPrivateKeyFromFile(filename string) (*rsa.PrivateKey, error) + func LoadRSAPrivateKeyFromTxt(privateKeyTxt string) (*rsa.PrivateKey, error) + func LoadRSAPublicKeyFromCert(buffer []byte) (*rsa.PublicKey, error) + func SignatureSHA256WithRSA(privateKey *rsa.PrivateKey, plain []byte) (string, error) + func VerifySHA256WithRSA(publicKey *rsa.PublicKey, signature string, plain []byte) error + func VerifySignature(publicKey *rsa.PublicKey, respSign *ResponseSignature, signature string) error + type CipherSuite struct + PrivateKey string + SerialNo string + type RequestSignature struct + Body []byte + Method string + Nonce string + Timestamp int64 + Url string + func NewRequestSignature(method, url string, body []byte) *RequestSignature + func (r *RequestSignature) Marshal() ([]byte, error) + type ResponseSignature struct + Body []byte + Nonce string + Timestamp int64 + func (r *ResponseSignature) Marshal() ([]byte, error)