Enum CryptoException.Code
- java.lang.Object
-
- java.lang.Enum<CryptoException.Code>
-
- com.wire.cryptobox.CryptoException.Code
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Comparable<CryptoException.Code>
- Enclosing class:
- CryptoException
public static enum CryptoException.Code extends java.lang.Enum<CryptoException.Code>
-
-
Enum Constant Summary
Enum Constants Enum Constant Description DECODE_ERRORA message or key could not be decoded.DEGENERATED_KEYUnsafe key material was detected during initialisation of a session, encryption or decryption.DUPLICATE_MESSAGEA message is a duplicate.IDENTITY_ERRORA CBox has been opened with an incomplete or mismatching identity usingCryptoBox.openWith(java.lang.String, byte[], com.wire.cryptobox.CryptoBox.IdentityMode).INIT_ERRORInitialisation of the underlying cryptographic libraries failed.INVALID_MESSAGEA message is invalid.INVALID_SIGNATUREThe signature of a decrypted message is invalid.INVALID_STRINGAn invalid string argument (e.g.OUTDATED_MESSAGEA message is too old.PANICA panic occurred.PREKEY_NOT_FOUNDAn attempt was made to initialise a new session usingCryptoBox.initSessionFromMessage(java.lang.String, byte[])whereby the prekey corresponding to the prekey ID in the message could not be found.REMOTE_IDENTITY_CHANGEDThe remote identity of a session changed.SESSION_NOT_FOUNDA requested session was not found.STORAGE_ERRORAn internal storage error occurred.TOO_DISTANT_FUTUREA message is too recent.UNKNOWN_ERRORAn unspecified error occurred.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static CryptoException.CodevalueOf(java.lang.String name)Returns the enum constant of this type with the specified name.static CryptoException.Code[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
SESSION_NOT_FOUND
public static final CryptoException.Code SESSION_NOT_FOUND
A requested session was not found.
-
REMOTE_IDENTITY_CHANGED
public static final CryptoException.Code REMOTE_IDENTITY_CHANGED
The remote identity of a session changed.Usually the user should be informed and the session reinitialised. If the remote fingerprint was previously verified, it will need to be verified anew in order to exclude any potential MITM.
-
INVALID_SIGNATURE
public static final CryptoException.Code INVALID_SIGNATURE
The signature of a decrypted message is invalid.The message being decrypted is incomplete or has otherwise been tampered with.
-
INVALID_MESSAGE
public static final CryptoException.Code INVALID_MESSAGE
A message is invalid.The message is well-formed but cannot be decrypted, e.g. because the message is used to initialise a session but does not contain a
PreKeyor the used session does not contain the appropriate key material for decrypting the message. The problem should be reported to the user, as it might be necessary for both peers to re-initialise their sessions.
-
DUPLICATE_MESSAGE
public static final CryptoException.Code DUPLICATE_MESSAGE
A message is a duplicate.The message being decrypted is a duplicate of a message that has previously been decrypted with the same session. The message can be safely discarded.
-
TOO_DISTANT_FUTURE
public static final CryptoException.Code TOO_DISTANT_FUTURE
A message is too recent.There is an unreasonably large gap between the last decrypted message and the message being decrypted, i.e. there are too many intermediate messages missing. The message should be dropped.
-
OUTDATED_MESSAGE
public static final CryptoException.Code OUTDATED_MESSAGE
A message is too old.The message being decrypted is unreasonably old and cannot be decrypted any longer due to the key material no longer being available. The message should be dropped.
-
DECODE_ERROR
public static final CryptoException.Code DECODE_ERROR
A message or key could not be decoded.The message or key being decoded is either malformed or otherwise encoded in a way such it cannot be understood.
-
STORAGE_ERROR
public static final CryptoException.Code STORAGE_ERROR
An internal storage error occurred.An error occurred while loading or persisting key material. The operation may be retried a limited number of times.
-
IDENTITY_ERROR
public static final CryptoException.Code IDENTITY_ERROR
A CBox has been opened with an incomplete or mismatching identity usingCryptoBox.openWith(java.lang.String, byte[], com.wire.cryptobox.CryptoBox.IdentityMode).This is typically a programmer error.
-
PREKEY_NOT_FOUND
public static final CryptoException.Code PREKEY_NOT_FOUND
An attempt was made to initialise a new session usingCryptoBox.initSessionFromMessage(java.lang.String, byte[])whereby the prekey corresponding to the prekey ID in the message could not be found.
-
PANIC
public static final CryptoException.Code PANIC
A panic occurred. This is a last resort error raised form native code to signal a severe problem, like a violation of a critical invariant, that would otherwise have caused a crash. Client code may choose to handle these errors more gracefully, preventing the application from crashing. In that case, the CryptoBox involved in the panic should be closed and discarded.
-
INIT_ERROR
public static final CryptoException.Code INIT_ERROR
Initialisation of the underlying cryptographic libraries failed. This error may only happen as a result ofCryptoBox.open(java.lang.String)orCryptoBox.openWith(java.lang.String, byte[], com.wire.cryptobox.CryptoBox.IdentityMode)and indicates a severe problem. Initialisation of a new CryptoBox may be retried a limited number of times upon receiving this error.
-
DEGENERATED_KEY
public static final CryptoException.Code DEGENERATED_KEY
Unsafe key material was detected during initialisation of a session, encryption or decryption. If this error occurred as a result ofCryptoBox.initSessionFromPreKey(java.lang.String, com.wire.cryptobox.PreKey), client code may retry session initialisation a limited number of times with different prekeys. If this error occurred as a result ofCryptoSession.decrypt(byte[]), the message should be considered invalid.
-
INVALID_STRING
public static final CryptoException.Code INVALID_STRING
An invalid string argument (e.g. file path or session ID) was provided. The string may either exceed a size limit or may contain illegal characters. It should be considered a programmer error.
-
UNKNOWN_ERROR
public static final CryptoException.Code UNKNOWN_ERROR
An unspecified error occurred.
-
-
Method Detail
-
values
public static CryptoException.Code[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (CryptoException.Code c : CryptoException.Code.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static CryptoException.Code valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
java.lang.IllegalArgumentException- if this enum type has no constant with the specified namejava.lang.NullPointerException- if the argument is null
-
-