Documentation ¶
Index ¶
- Constants
- Variables
- func AESDecrypt(data []byte) (string, error)
- func AESEncrypt(data string) ([]byte, error)
- func NewCertificateSigningRequest(commonName string, key *ecdsa.PrivateKey) ([]byte, error)
- func NewPrivateKey() (*ecdsa.PrivateKey, error)
- func PrivateKeyToPem(privateKey *ecdsa.PrivateKey) ([]byte, error)
- func SetAESEncryptionFallbackKey(key string) error
- func SetAESEncryptionKey(key string) error
- type String
Constants ¶
View Source
const V1 byte = 0x1
Variables ¶
View Source
var ( ErrDecryptionFailed = errors.New("unable to decrypt the data") ErrCipherTextTooShort = errors.New("cipher text is too short") ErrEncryptionKeyWrongLength = errors.New( "AES encryption key has a wrong length, expected 32 bytes") )
View Source
var (
ErrUnknownAlgorithm = errors.New("unknown algorithm")
)
Functions ¶
func AESDecrypt ¶
func AESEncrypt ¶
func NewCertificateSigningRequest ¶
func NewCertificateSigningRequest(commonName string, key *ecdsa.PrivateKey) ([]byte, error)
func NewPrivateKey ¶
func NewPrivateKey() (*ecdsa.PrivateKey, error)
func PrivateKeyToPem ¶
func PrivateKeyToPem(privateKey *ecdsa.PrivateKey) ([]byte, error)
func SetAESEncryptionKey ¶
Types ¶
Click to show internal directories.
Click to hide internal directories.