Interface JsonJWE<A,B extends JsonJWE.Recipient<A>>

Type Parameters:
A - the payload type
B - the recipient type
All Superinterfaces:
JsonJOSEObject<A>

public interface JsonJWE<A,B extends JsonJWE.Recipient<A>> extends JsonJOSEObject<A>

A JSON Web Encryption object supporting JWE JSON representation as defined by RFC7516 Section 7.2.

Unlike JWE, a JSON JWE object can be used to represent multiple JSON Web Encryption objects sharing the same encrypted data but providing different encrypted keys. This can be used to create a JWE that can be used by multiple recipients.

As per RFC7516, the JSON representation is neither optimized for compactness nor URL safe.

Since:
1.5
Author:
Jeremy Kuhn
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static interface 
    Built recipient resulting from the build of a JSON JWE and exposing the recipient JWE directly.
    static interface 
    Read recipient resulting from the read of a JSON JWE and exposing a single JWE publisher used to decrypt and validate the recipient JWE.
    static interface 
    Base JSON JWE Recipient exposing recipient specific JWE JOSE header and encrypted key.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the additional authentication data common to all recipients encoded as Base64URL.
    Returns the authentication tag common to all recipients encoded as Base64URL.
    Returns the cipher text common to all recipients encoded as Base64URL.
    Returns the initialization vector common to all recipients encoded as Base64URL.
    Returns the protected header common to all recipients.
    Returns the list of recipients.
    Returns the unprotected header common to all recipients.

    Methods inherited from interface io.inverno.mod.security.jose.JsonJOSEObject

    toJson
  • Method Details

    • getProtectedHeader

      JWEHeader getProtectedHeader()

      Returns the protected header common to all recipients.

      Returns:
      the protected header
    • getUnprotectedHeader

      JWEHeader getUnprotectedHeader()

      Returns the unprotected header common to all recipients.

      Returns:
      the unprotected header
    • getInitializationVector

      String getInitializationVector()

      Returns the initialization vector common to all recipients encoded as Base64URL.

      Returns:
      the Base64URL encoded initialization vector with no padding
    • getAdditionalAuthenticationData

      String getAdditionalAuthenticationData()

      Returns the additional authentication data common to all recipients encoded as Base64URL.

      Returns:
      the Base64URL encoded additional authentication data with no padding
    • getCipherText

      String getCipherText()

      Returns the cipher text common to all recipients encoded as Base64URL.

      Returns:
      the Base64URL encoded cipher text with no padding
    • getAuthenticationTag

      String getAuthenticationTag()

      Returns the authentication tag common to all recipients encoded as Base64URL.

      Returns:
      the Base64URL encoded authentication tag with no padding
    • getRecipients

      List<B> getRecipients()

      Returns the list of recipients.

      When considering a built JSON JWE, recipient must be of type JsonJWE.BuiltRecipient which directly exposes the built JWE objects corresponding to recipient.

      When considering a read JSON JWE, recipient must be of type JsonJWE.ReadRecipient which exposes JWE objects per recipient as single publisher used to decrypt and validate the corresponding JWE.

      Returns:
      a list of recipients