pub enum Error {
Show 17 variants
Pkcs8(Error),
NoPrimes,
UnsupportedKeyType(KeyType),
InvalidKeyMechanism {
key_type: KeyType,
invalid_mechanisms: Vec<KeyMechanism>,
},
KeyLengthUnsupported {
key_type: KeyType,
},
KeyLengthRequired {
key_type: KeyType,
},
InvalidKeyLengthAes {
key_length: u32,
},
InvalidKeyLengthRsa {
key_length: u32,
},
TlsKeyLengthUnsupported {
tls_key_type: TlsKeyType,
},
TlsKeyLengthRequired {
tls_key_type: TlsKeyType,
},
InvalidTlsKeyLengthRsa {
key_length: u32,
},
InvalidKeyId(String),
InvalidKeyTypeForSignatureType {
key_type: KeyType,
signature_type: SignatureType,
},
InvalidKeyMechanismsForSignatureType {
required_key_mechanism: KeyMechanism,
signature_type: SignatureType,
},
InvalidCryptograhicKeyUse(String),
InvalidRawSigningKeySetup {
key_type: KeyType,
key_mechanisms: Vec<KeyMechanism>,
signature_type: SignatureType,
},
InvalidOpenPgpSigningKeySetup {
key_type: KeyType,
key_mechanisms: Vec<KeyMechanism>,
signature_type: SignatureType,
},
}
Variants§
Pkcs8(Error)
Importing from PKCS#8 DER or PEM failed
NoPrimes
No primes found when importing an RSA key
UnsupportedKeyType(KeyType)
The KeyType
is not supported
InvalidKeyMechanism
The key mechanisms provided for a key type are not valid
KeyLengthUnsupported
Elliptic curve keys do not support providing a length
KeyLengthRequired
Key type requires setting a length
InvalidKeyLengthAes
AES key is generated with unsupported key length (not 128, 192 or 256)
InvalidKeyLengthRsa
RSA key is generated with unsafe key length (smaller than 2048)
TlsKeyLengthUnsupported
Elliptic curve TLS keys do not support providing a length
Fields
tls_key_type: TlsKeyType
TlsKeyLengthRequired
RSA TLS key type requires setting a length
Fields
tls_key_type: TlsKeyType
InvalidTlsKeyLengthRsa
RSA TLS key is generated with unsafe key length (smaller than 2048)
InvalidKeyId(String)
Invalid Key ID
InvalidKeyTypeForSignatureType
The signature type provided for a key type is not valid
InvalidKeyMechanismsForSignatureType
The key mechanisms provided for a signature type are not valid
InvalidCryptograhicKeyUse(String)
A valid cryptographic key use can not be derived from a String
InvalidRawSigningKeySetup
A signing key setup is not compatible with raw cryptographic signing
InvalidOpenPgpSigningKeySetup
A signing key setup is not compatible with OpenPGP signing