Documentation ¶
Overview ¶
Package util provides utility functions for the KMS backends.
Index ¶
- func GetRandomKey(length int) ([]byte, error)
- func ParseDERtoPublicKeyRSA(pkDER []byte) (*rsa.PublicKey, error)
- func ParsePEMtoPublicKeyRSA(pkPEM []byte) (*rsa.PublicKey, error)
- func UnwrapAES(encryptedKey []byte, wrapKeyAES []byte) ([]byte, error)
- func WrapAES(key []byte, wrapKeyAES []byte) ([]byte, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetRandomKey ¶
GetRandomKey reads length bytes from getrandom(2) if available, /dev/urandom otherwise.
func ParseDERtoPublicKeyRSA ¶
ParseDERtoPublicKeyRSA parses a PKIX, ASN.1 DER RSA public key from []byte to *rsa.PublicKey.
func ParsePEMtoPublicKeyRSA ¶
ParsePEMtoPublicKeyRSA parses a public RSA key from bytes to *rsa.PublicKey.
func UnwrapAES ¶
UnwrapAES decrypts data wrapped with AES Key Wrap with Padding as specified in RFC 5649: https://datatracker.ietf.org/doc/html/rfc5649
Key sizes are limited to 16 and 32 Bytes.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.