pub enum KeyError {
Show 40 variants
File(FileError),
Keyring(Error),
KeyringWorkerStart(Error),
KeyringWorkerStopped {
operation: &'static str,
},
Custody {
operation: &'static str,
source: Box<dyn Error + Send + Sync + 'static>,
},
Json {
operation: &'static str,
source: Error,
},
Hex {
subject: &'static str,
source: FromHexError,
},
InvalidLength {
subject: &'static str,
expected: usize,
actual: usize,
},
SigningKey(SignatureError),
Encryption(EncryptionError),
Utf8(FromUtf8Error),
Base64(DecodeError),
PassphraseKdf {
operation: &'static str,
source: Box<dyn Error + Send + Sync + 'static>,
},
UnsupportedPassphraseEnvelopeVersion {
actual: u32,
expected: u32,
},
UnsupportedPassphraseKdf {
actual: String,
expected: &'static str,
},
WeakArgon2Parameter {
parameter: &'static str,
actual: u32,
minimum: u32,
},
PassphraseEnvelopeDecryption,
SealedBoxDecryption,
InvalidEd25519PublicKey,
WeakEd25519PublicKey,
AllZeroX25519PublicKey,
AllZeroX25519SharedSecret,
PlaintextCloudKeyRotation,
UnretainedKeyRotation,
ServiceAlreadyRegistered {
registered: String,
requested: String,
},
EmptyKeyringEntry {
account: String,
},
CloudCredentialsRolledBack {
operation: &'static str,
},
CloudCredentialsSuperseded,
MasterKeySetupRolledBack {
operation: &'static str,
},
UnexpectedAppleKeyringEntry,
UnexpectedTestKeyringEntry,
StoreNotInstalled,
UnsupportedKeyringPlatform,
ServiceNotRegistered,
NoDeviceIdentity,
IdentityMismatch {
existing_pubkey_hex: String,
imported_pubkey_hex: String,
},
NoPendingIdentity {
pending_public_key_hex: String,
},
InvalidSecretName {
name: String,
reason: String,
},
MissingKeychainEntitlement,
KeychainTemporarilyUnavailable,
}Variants§
File(FileError)
Keyring(Error)
KeyringWorkerStart(Error)
KeyringWorkerStopped
Custody
Json
Hex
InvalidLength
SigningKey(SignatureError)
Encryption(EncryptionError)
Utf8(FromUtf8Error)
Base64(DecodeError)
PassphraseKdf
UnsupportedPassphraseEnvelopeVersion
UnsupportedPassphraseKdf
WeakArgon2Parameter
PassphraseEnvelopeDecryption
SealedBoxDecryption
InvalidEd25519PublicKey
WeakEd25519PublicKey
AllZeroX25519PublicKey
PlaintextCloudKeyRotation
UnretainedKeyRotation
ServiceAlreadyRegistered
EmptyKeyringEntry
CloudCredentialsRolledBack
CloudCredentialsSuperseded
MasterKeySetupRolledBack
UnexpectedAppleKeyringEntry
UnexpectedTestKeyringEntry
StoreNotInstalled
UnsupportedKeyringPlatform
ServiceNotRegistered
NoDeviceIdentity
IdentityMismatch
NoPendingIdentity
InvalidSecretName
MissingKeychainEntitlement
The OS refused a Keychain data-protection-store operation with
errSecMissingEntitlement (OSStatus -34018). This is not “the binary
isn’t signed” — an ad-hoc or Development-signed binary with no
keychain-access-groups entitlement at all also gets -34018, and a
signed binary that does carry that entitlement with no provisioning
profile behind it is killed by the kernel at launch instead. The fix is
a team-prefixed keychain-access-groups entitlement backed by an
embedded provisioning profile — in Xcode, set DEVELOPMENT_TEAM so
automatic signing fetches and embeds one. A build with no team must
omit the entitlement entirely, which means it also has no access to
the data-protection keychain and will hit this error on first use.
The OS refused this keychain operation with errSecInteractionNotAllowed
(OSStatus -25308): the keychain is locked, the display is asleep, or the
login session cannot show UI. Nothing is wrong with the entry or with
this process’s entitlements — the same operation succeeds once the
session unlocks, so a caller that needs the key should say so and try
again rather than treat the store as broken or the key as absent.