Documentation ¶
Index ¶
- Constants
- func Decrypt(cipherBytes []byte, key *rsa.PrivateKey) ([]byte, error)
- func Encrypt(plainBytes []byte, pubKey *rsa.PublicKey) ([]byte, error)
- func ParseCertificate(certPemBytes []byte) (*x509.Certificate, error)
- func ParsePrivateKey(keyPemBytes []byte) (*rsa.PrivateKey, error)
- func TryDecrypt(payload string, key *rsa.PrivateKey) ([]byte, error)
Constants ¶
View Source
const ( AesKeyLength = 32 AnnotationBase64 = "@base64:" AnnotationEncrypted = "@encrypted:" HeaderLength = 2 )
Variables ¶
This section is empty.
Functions ¶
func ParseCertificate ¶ added in v0.6.0
func ParseCertificate(certPemBytes []byte) (*x509.Certificate, error)
func ParsePrivateKey ¶ added in v0.6.0
func ParsePrivateKey(keyPemBytes []byte) (*rsa.PrivateKey, error)
func TryDecrypt ¶
func TryDecrypt(payload string, key *rsa.PrivateKey) ([]byte, error)
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.