Enum CryptoException.Code

    • 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 PreKey or 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.

      • 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.
      • 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 name
        java.lang.NullPointerException - if the argument is null