pub enum Error {
Show 13 variants
Io(Error),
Protobuf(EncodeError),
ProtobufDecode(DecodeError),
Rsa(Error),
Pkcs8(Error),
Spki(Error),
InvalidFormat(String),
SignatureVerification,
MultipleSignatures,
NoSignature,
EcdsaNotSupported,
NoSignedHeader,
NoCrxId,
}
Expand description
Error types for CRX3 operations.
This enum represents all possible errors that can occur when working with Chrome Extension (CRX3) files, including both internal errors and errors from external dependencies.
Variants§
Io(Error)
I/O error from the standard library.
Occurs during file operations like reading, writing, or seeking.
Protobuf(EncodeError)
Error during protobuf message encoding.
Occurs when the library attempts to encode a protobuf message (e.g., during CRX file creation).
ProtobufDecode(DecodeError)
Error during protobuf message decoding.
Occurs when the library attempts to decode a protobuf message (e.g., when reading a CRX header).
Rsa(Error)
Error during RSA cryptographic operations.
Wraps the underlying RSA library’s error and preserves error context. May occur during signing or verification operations.
Pkcs8(Error)
Error related to PKCS#8 encoding or decoding.
Occurs when handling PKCS#8 formatted keys.
Spki(Error)
Error related to SubjectPublicKeyInfo (SPKI) operations.
Occurs when working with public key data in SPKI format.
InvalidFormat(String)
Invalid CRX file format.
Occurs when a file doesn’t conform to the CRX3 format specification. The string provides details about the specific format violation.
SignatureVerification
Signature verification failed.
Occurs when the CRX file signature doesn’t match the expected value.
MultipleSignatures
Multiple RSA signatures are not supported.
Occurs when a CRX file contains more than one RSA signature.
NoSignature
No RSA signature found.
Occurs when attempting to verify a CRX file that doesn’t contain any RSA signatures.
EcdsaNotSupported
ECDSA signatures are not supported by this library.
Occurs when a CRX file contains ECDSA signatures, which this library doesn’t currently support.
NoSignedHeader
No signed header data found.
Occurs when a CRX file lacks the required signed header data.
NoCrxId
No CRX ID found.
Occurs when attempting to extract an extension ID from a CRX file that doesn’t contain one.