Enum core_crypto::prelude::CryptoError

source ·
pub enum CryptoError {
Show 65 variants E2eiError(E2eIdentityError), ConversationNotFound(ConversationId), ConversationAlreadyExists(ConversationId), ClientNotFound(ClientId), PendingProposalNotFound(MlsProposalRef), PendingCommitNotFound, MalformedIdentifier(&'static str), ClientSignatureNotFound, IdentityAlreadyPresent, NoProvisionalIdentityFound, TooManyIdentitiesPresent, LockPoisonError, ImplementationError, CredentialBundleConflict, ConsumerError, MlsProviderError(MlsProviderError), KeyStoreError(CryptoKeystoreError), MlsError(MlsError), Utf8Error(Utf8Error), StringUtf8Error(FromUtf8Error), ParseIntError(ParseIntError), ConvertIntError(TryFromIntError), HexDecodeError(FromHexError), InvalidByteArrayError(usize), IoError(Error), Unauthorized, CallbacksNotSet, UnauthorizedExternalAddProposal, UnauthorizedExternalCommit, InvalidHashReference, DecryptionError, WrongEpoch, BufferedFutureMessage, ProteusError(ProteusError), CryptoboxMigrationError(CryptoboxMigrationError), ProteusNotInitialized, ProteusSupportNotEnabled(String), MlsNotInitialized, InvalidKeyPackage, InvalidIdentity, IdentityInitializationError, ParentGroupNotFound, MessageEpochTooOld, E2eiEnrollmentNotDone, CredentialNotFound(MlsCredentialType), InternalMlsError, DuplicateMessage, ClearingPendingCommitError, SelfCommitIgnored, UnmergedPendingGroup, X509CertDerError(Error), PemError(PemError), DomainNameNotFound, DomainNamesDontMatch, DuplicateDomainName, InvalidCertificateChain, EmptyTrustAnchorUpdate, DuplicateCertificateChain, OrphanWelcome, InvalidClientId, JsonError(Error), StaleCommit, StaleProposal, MissingExternalSenderExtension, Unsupported,
}
Expand description

CoreCrypto errors

Variants§

§

E2eiError(E2eIdentityError)

End to end identity error

§

ConversationNotFound(ConversationId)

This error is emitted when the requested conversation couldn’t be found in our store

§

ConversationAlreadyExists(ConversationId)

This error is emitted when the requested conversation already exists with the given if

§

ClientNotFound(ClientId)

This error is emitted when the requested client couldn’t be found in MLS group

§

PendingProposalNotFound(MlsProposalRef)

This error is emitted when a pending proposal couldn’t be found in MLS group

§

PendingCommitNotFound

This error is emitted when a pending commmit couldn’t be found in MLS group

§

MalformedIdentifier(&'static str)

This error is emitted when we find a malformed (i.e. not uuid) or empty identifier

§

ClientSignatureNotFound

The keystore has no knowledge of such client; this shouldn’t happen as Client::init is failsafe (find-else-create)

§

IdentityAlreadyPresent

The keystore already has a stored identity. As such, we cannot create a new raw identity

§

NoProvisionalIdentityFound

This error occurs when we cannot find any provisional keypair in the store, indicating that the generate_raw_keypair method hasn’t been called.

§

TooManyIdentitiesPresent

This error occurs when during the MLS external client generation, we end up with more than one client identity in store.

This is usually not possible, unless there’s some kind of concurrency issue on the consumer (creating an ext-gen client AND a normal one at the same time for instance)

§

LockPoisonError

!!!! Something went very wrong and one of our locks has been poisoned by an in-thread panic !!!!

§

ImplementationError

We have done something terribly wrong

§

CredentialBundleConflict

Tried to insert an already existing CredentialBundle

§

ConsumerError

The consumer of this library has misused it

§

MlsProviderError(MlsProviderError)

Errors that are sent by our MLS Provider

§

KeyStoreError(CryptoKeystoreError)

Errors that are sent by our Keystore

§

MlsError(MlsError)

MLS Internal Errors

§

Utf8Error(Utf8Error)

Error when parsing strs that are not valid UTF-8

§

StringUtf8Error(FromUtf8Error)

Error when parsing Strings that are not valid UTF-8

§

ParseIntError(ParseIntError)

Error when trying to coerce ints into Strings

§

ConvertIntError(TryFromIntError)

Error when trying to convert integer sizes - usually when they don’t fit

§

HexDecodeError(FromHexError)

Error when trying to decode an hex-encoded string. Usually that means that the length of the hex string is odd - should be always even

§

InvalidByteArrayError(usize)

Error when trying to coerce a Vec<u8> into a [u8; N]

§

IoError(Error)

Standard I/O Error

§

Unauthorized

Authorization error

§

CallbacksNotSet

Callbacks are not provided

§

UnauthorizedExternalAddProposal

External Add Proposal Validation failed

§

UnauthorizedExternalCommit

External Commit sender was not authorized to perform such

§

InvalidHashReference

A supplied [openmls::ciphersuite::hash_ref::HashReference] is not of the expected size: 16

§

DecryptionError

Tried to decrypt a message in the wrong epoch

§

WrongEpoch

Incoming message is for the wrong epoch

§

BufferedFutureMessage

Incoming message is for a future epoch. We will buffer it until the commit for that epoch arrives

§

ProteusError(ProteusError)

Proteus Error Wrapper

§

CryptoboxMigrationError(CryptoboxMigrationError)

Cryptobox migration error wrapper

§

ProteusNotInitialized

The proteus client has been called but has not been initialized yet

§

ProteusSupportNotEnabled(String)

CoreCrypto hasn’t been built with the proteus feature enabled, meaning proteus isn’t built in

§

MlsNotInitialized

A MLS operation was requested but MLS hasn’t been initialized on this instance

§

InvalidKeyPackage

Decrypted message uses an invalid KeyPackage (probably expired)

§

InvalidIdentity

Client presented an invalid identity

§

IdentityInitializationError

MLS Client was not initialized the right way

§

ParentGroupNotFound

Parent group cannot be found

§

MessageEpochTooOld

Message epoch is too old

§

E2eiEnrollmentNotDone

When looking for a X509 credential for a given ciphersuite and it has not been done

§

CredentialNotFound(MlsCredentialType)

A Credential was not found locally which is very likely an implementation error

§

InternalMlsError

The MLS group is in an invalid state for an unknown reason

§

DuplicateMessage

We already decrypted this message once

§

ClearingPendingCommitError

Happens when a client creates a commit, sends it to the DS which accepts it but then client clears this pending commit and creates another commit. This is triggered when the client tries to decrypt the original commit. This means something is very wrong in the client’s code and has to be fixed immediately

§

SelfCommitIgnored

Tried to decrypt a commit created by self which is likely to have been replayed by the DS

§

UnmergedPendingGroup

You tried to join with an external commit but did not merge it yet. We will reapply this message for you when you merge your external commit

§

X509CertDerError(Error)

see [x509_cert::der::Error]

§

PemError(PemError)

see [pem::PemError]

§

DomainNameNotFound

Domain name not found in the certificate

§

DomainNamesDontMatch

The provided domain name and the one found in the certificate don’t match

§

DuplicateDomainName

A trust anchor with the provided domain name already exists in the group’s context extensions

§

InvalidCertificateChain

The certificate chain is invalid or not complete

§

EmptyTrustAnchorUpdate

Emtpy trust anchor update

§

DuplicateCertificateChain

Adding a certificate chain already in the group’s context

§

OrphanWelcome

This happens when the DS cannot flag KeyPackages as claimed or not. It this scenario, a client requests their old KeyPackages to be deleted but one has already been claimed by another client to create a Welcome. In that case the only solution is that the client receiving such a Welcome tries to join the group with an External Commit instead

§

InvalidClientId

The encountered ClientId does not match Wire’s definition

§

JsonError(Error)

Json error

§

StaleCommit

The received commit is deemed stale and is from an older epoch

§

StaleProposal

The received proposal is deemed stale and is from an older epoch

§

MissingExternalSenderExtension

The group lacks an ExternalSender extension whereas it should have at least one

§

Unsupported

Not supported for the moment

Implementations§

source§

impl CryptoError

source

pub fn proteus_error_code(&self) -> u32

Returns the proteus error code

Trait Implementations§

source§

impl<UT> ConvertError<UT> for CryptoError

source§

fn try_convert_unexpected_callback_error( e: UnexpectedUniFFICallbackError, ) -> Result<Self>

source§

impl Debug for CryptoError

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for CryptoError

source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Error for CryptoError

source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
source§

impl<'_derivative_strum> From<&'_derivative_strum CryptoError> for &'static str

source§

fn from(x: &'_derivative_strum CryptoError) -> &'static str

Converts to this type from the input type.
source§

impl From<CryptoError> for &'static str

source§

fn from(x: CryptoError) -> &'static str

Converts to this type from the input type.
source§

impl From<CryptoKeystoreError> for CryptoError

source§

fn from(source: CryptoKeystoreError) -> Self

Converts to this type from the input type.
source§

impl From<CryptoboxMigrationError> for CryptoError

source§

fn from(source: CryptoboxMigrationError) -> Self

Converts to this type from the input type.
source§

impl From<E2eIdentityError> for CryptoError

source§

fn from(source: E2eIdentityError) -> Self

Converts to this type from the input type.
source§

impl From<Error> for CryptoError

source§

fn from(source: Error) -> Self

Converts to this type from the input type.
source§

impl From<Error> for CryptoError

source§

fn from(source: Error) -> Self

Converts to this type from the input type.
source§

impl From<Error> for CryptoError

source§

fn from(source: Error) -> Self

Converts to this type from the input type.
source§

impl From<FromHexError> for CryptoError

source§

fn from(source: FromHexError) -> Self

Converts to this type from the input type.
source§

impl From<FromUtf8Error> for CryptoError

source§

fn from(source: FromUtf8Error) -> Self

Converts to this type from the input type.
source§

impl From<MlsError> for CryptoError

source§

fn from(err: MlsError) -> Self

Converts to this type from the input type.
source§

impl From<MlsProviderError> for CryptoError

source§

fn from(source: MlsProviderError) -> Self

Converts to this type from the input type.
source§

impl From<ParseIntError> for CryptoError

source§

fn from(source: ParseIntError) -> Self

Converts to this type from the input type.
source§

impl From<PemError> for CryptoError

source§

fn from(source: PemError) -> Self

Converts to this type from the input type.
source§

impl From<ProteusError> for CryptoError

source§

fn from(source: ProteusError) -> Self

Converts to this type from the input type.
source§

impl From<TryFromIntError> for CryptoError

source§

fn from(source: TryFromIntError) -> Self

Converts to this type from the input type.
source§

impl From<Utf8Error> for CryptoError

source§

fn from(source: Utf8Error) -> Self

Converts to this type from the input type.
source§

impl<UT> Lift<UT> for CryptoError

source§

type FfiType = RustBuffer

source§

fn try_read(buf: &mut &[u8]) -> Result<Self>

source§

fn try_lift(v: RustBuffer) -> Result<Self>

§

fn try_lift_from_rust_buffer(v: RustBuffer) -> Result<Self, Error>

Convenience method
source§

impl<UT> Lower<UT> for CryptoError

source§

type FfiType = RustBuffer

source§

fn write(obj: Self, buf: &mut Vec<u8>)

source§

fn lower(obj: Self) -> RustBuffer

§

fn lower_into_rust_buffer(obj: Self) -> RustBuffer

Convenience method
source§

impl<UT> LowerError<UT> for CryptoError

source§

fn lower_error(obj: Self) -> RustBuffer

Lower this value for scaffolding function return Read more
source§

impl<UT> TypeId<UT> for CryptoError

source§

const TYPE_ID_META: MetadataBuffer = _

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, UT> HandleAlloc<UT> for T
where T: Send + Sync,

§

fn new_handle(value: Arc<T>) -> Handle

Create a new handle for an Arc value Read more
§

unsafe fn clone_handle(handle: Handle) -> Handle

Clone a handle Read more
§

unsafe fn consume_handle(handle: Handle) -> Arc<T>

Consume a handle, getting back the initial Arc<> Read more
§

unsafe fn get_arc(handle: Handle) -> Arc<Self>

Get a clone of the Arc<> using a “borrowed” handle. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> IntoEither for T

source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
source§

impl<T> Same for T

source§

type Output = T

Should always be Self
source§

impl<T> ToString for T
where T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

source§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V