Skip to main content

exceptions

Exceptions related to encryption.

Classes​

CacheKeyMismatchError​

class CacheKeyMismatchError(recorded_key_id: str | None, key_id: str):

The cache key isn't the one the caches were encrypted with.

Arguments

  • recorded_key_id: The id recorded beside the caches, or None.
  • key_id: The id of the key that was checked.

Attributes

  • recorded_key_id: The public id recorded beside the caches, or None if the record can't be read.
  • key_id: The public id of the key that was checked.

Names both key ids and how to fix it; never any key material.

DecryptError​

class DecryptError(*args, **kwargs):

Error when attempting to decrypt.

ECDSAKeyError​

class ECDSAKeyError(*args, **kwargs):

Error related to ECDSA keys.

EncryptedStoreKeyError​

class EncryptedStoreKeyError(*args, **kwargs):

An encrypted SQLite file can't be opened with the cache key.

Never an unsupported cache: the file is left exactly as it is, and the discard path must never delete it, since the right key would open it.

Attributes

  • path: The file that couldn't be opened.

Variables​

  • static path : str

EncryptedStoreKeyMismatchError​

class EncryptedStoreKeyMismatchError(    path: str, key_id: str | None, recorded_key_id: str | None,):

The cache key found isn't the one recorded beside the caches.

Refused by its id before any decryption was tried, so the file isn't damaged: it needs the key the caches were encrypted with.

Arguments

  • path: The file that couldn't be opened.
  • key_id: The public id of the key that was refused.
  • recorded_key_id: The key id recorded beside the caches, or None.

Attributes

  • path: The file that couldn't be opened.
  • key_id: The public id of the key that was refused.
  • recorded_key_id: The key id recorded beside the caches, or None if the record can't be read.

Names the file and both key ids; never any key material.

EncryptedStoreNoKeyError​

class EncryptedStoreNoKeyError(path: str, reason: str | None):

An encrypted SQLite file was found, but no cache key was.

Arguments

  • path: The file that couldn't be opened.
  • reason: Why no key was found, or None.

Attributes

  • path: The file that couldn't be opened.
  • reason: Why no key was found, as the key lookup reports it.

Names the file, the reason and the settings; never any key material.

EncryptedStoreWrongKeyError​

class EncryptedStoreWrongKeyError(path: str, key_id: str | None):

An encrypted SQLite file doesn't open with the cache key that was found.

Either the key isn't the one the file was encrypted with, or the file is damaged: SQLCipher can't tell the two apart.

Arguments

  • path: The file that couldn't be opened.
  • key_id: The public id of the key that was tried or refused.

Attributes

  • path: The file that couldn't be opened.
  • key_id: The public id of the key that was tried or refused, if known.

Names the file and the key id; never any key material.

EncryptionError​

class EncryptionError(*args, **kwargs):

Error related to encryption processes.

Ancestors​

InvalidCacheKeyError​

class InvalidCacheKeyError(*args, **kwargs):

The desktop app's encryption key can't be turned into a cache key.

KeychainReadError​

class KeychainReadError(reason: KeychainUnavailableReason, status: int):

The OS credential store didn't return the desktop app's key.

Arguments

  • reason: Why the read failed.
  • status: The platform's error code, or 0.

Attributes

  • reason: Why the read failed.
  • status: The platform's error code (an OSStatus on macOS, a Win32 error on Windows), or 0 where the platform has no store.

Records why the read failed; the message never includes the key.

KeychainUnavailableReason​

class KeychainUnavailableReason(*args, **kwds):

Why the OS credential store didn't return the desktop app's key.

The values appear in telemetry and decide what the key lookup does next.

Variables​

  • static ACCESS_DENIED
  • static KEYCHAIN_ERROR
  • static KEYCHAIN_LOCKED
  • static NO_ITEM
  • static UI_REQUIRED

RSAKeyError​

class RSAKeyError(*args, **kwargs):

Error related to RSA keys.