Class TraceCryptoException

All Implemented Interfaces:
Serializable

public class TraceCryptoException extends RuntimeException
Thrown by the TRACE crypto layer when a key cannot be built from a JWK or when the security provider cannot perform Ed25519 operations. Also thrown by TraceCryptoProvider for a signature that does not verify, for input that cannot be canonicalized and for input that cannot be a receipt position. Messages never carry key material, signature bytes or record content.

The reason is a short stable token intended for the structured error body (reason member); the message is for logs.

Author:
Yuriy Movchan
See Also:
  • Field Details

    • REASON_CRYPTO_UNAVAILABLE

      public static final String REASON_CRYPTO_UNAVAILABLE
      The provider lacks Ed25519 support or is not installed (fail closed).
      See Also:
    • REASON_JWK_KTY

      public static final String REASON_JWK_KTY
      JWK kty is missing or not OKP.
      See Also:
    • REASON_JWK_CRV

      public static final String REASON_JWK_CRV
      JWK crv is missing or not Ed25519.
      See Also:
    • REASON_JWK_X_LENGTH

      public static final String REASON_JWK_X_LENGTH
      JWK x does not decode to exactly 32 bytes.
      See Also:
    • REASON_JWK_X_ENCODING

      public static final String REASON_JWK_X_ENCODING
      JWK x is missing, not a string, or not strict unpadded base64url.
      See Also:
    • REASON_JWK_PRIVATE_MATERIAL

      public static final String REASON_JWK_PRIVATE_MATERIAL
      JWK carries a d member (private key material must never be registered).
      See Also:
    • REASON_JWK_FORMAT

      public static final String REASON_JWK_FORMAT
      JWK is null or not a JSON object.
      See Also:
    • REASON_INVALID_KEY

      public static final String REASON_INVALID_KEY
      The provider rejected the key (not an Ed25519 key usable for verification).
      See Also:
    • REASON_SIGNATURE_MISMATCH

      public static final String REASON_SIGNATURE_MISMATCH
      The Ed25519 signature does not verify over the signature scope of the record.
      See Also:
    • REASON_CANONICALIZATION_FAILED

      public static final String REASON_CANONICALIZATION_FAILED
      The JSON value cannot be reduced to RFC 8785 canonical form.
      See Also:
    • REASON_INVALID_RECEIPT_INPUT

      public static final String REASON_INVALID_RECEIPT_INPUT
      An input cannot be a receipt position (receipt-hash input is malformed).
      See Also:
  • Constructor Details

    • TraceCryptoException

      public TraceCryptoException(String reason, String message)
    • TraceCryptoException

      public TraceCryptoException(String reason, String message, Throwable cause)
  • Method Details

    • getReason

      public String getReason()
      Returns:
      short stable reason token, e.g. jwk_x_length or crypto_unavailable