0

Is there a way to set a JWE full serialization input with jose4j? For example, what goes in the TODO below?

public String decryptJWE(PrivateKey privateKey, String payload, boolean compact) throws JoseException {
    JsonWebEncryption jwe = new JsonWebEncryption();

    if (compact) {
        jwe.setCompactSerialization(payload);
    } else {
        // TODO:  what goes here?  expecting something like jwe.setFullSerialization(payload)
    }
    jwe.setKey(privateKey);

    return jwe.getPayload();
}
Kevin
  • 702
  • 7
  • 22

1 Answers1

1

No, only the JWE compact serialization is supported. The general and flattened JWE JSON serializations aren't directly supported.

Brian Campbell
  • 2,293
  • 12
  • 13