Documentation ¶
Overview ¶
Package keyutils serves as a utility to parse, encrypt and decrypt PKCS#1 and PKCS#8 private keys based on current FIPS mode status, supporting only EC type keys. It always allows PKCS#8 private keys and disallow PKCS#1 private keys in FIPS-mode.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrFIPSUnsupportedKeyFormat = errors.New("unsupported key format due to FIPS compliance")
ErrFIPSUnsupportedKeyFormat is returned when encryption/decryption operations are attempted on a PKCS1 key when FIPS mode is enabled.
Functions ¶
func IsEncryptedPEMBlock ¶
IsEncryptedPEMBlock checks if a PKCS#1 or PKCS#8 PEM-block is encrypted or not
Types ¶
type Formatter ¶
type Formatter interface { ParsePrivateKeyPEMWithPassword(pemBytes, password []byte) (crypto.Signer, error) DecryptPEMBlock(block *pem.Block, password []byte) ([]byte, error) EncryptPEMBlock(data, password []byte) (*pem.Block, error) }
Formatter provides an interface for converting keys to the right format, and encrypting and decrypting keys
Default is the default key util, where FIPS is not required
Click to show internal directories.
Click to hide internal directories.