public class JsonWebEncryption extends JsonWebStructure
| Modifier and Type | Field and Description |
|---|---|
static short |
COMPACT_SERIALIZATION_PARTS |
doKeyValidation, headers, rawCompactSerialization| Constructor and Description |
|---|
JsonWebEncryption() |
checkCrit, checkNotEmptyPart, fromCompactSerialization, getAlgorithmConstraints, getAlgorithmHeaderValue, getCertificateChainHeaderValue, getContentTypeHeaderValue, getEncodedHeader, getHeader, getHeader, getHeaders, getIntegrity, getJwkHeader, getKey, getKeyIdHeaderValue, getLeafCertificateHeaderValue, getObjectHeader, getProviderCtx, getX509CertSha1ThumbprintHeaderValue, getX509CertSha256ThumbprintHeaderValue, isDoKeyValidation, isSupportedCriticalHeader, onNewKey, setAlgorithmConstraints, setAlgorithmHeaderValue, setCertificateChainHeaderValue, setCompactSerialization, setContentTypeHeaderValue, setCriticalHeaderNames, setDoKeyValidation, setEncodedHeader, setHeader, setHeader, setIntegrity, setJwkHeader, setKey, setKeyIdHeaderValue, setKnownCriticalHeaders, setProviderContext, setX509CertSha1ThumbprintHeaderValue, setX509CertSha1ThumbprintHeaderValue, setX509CertSha256ThumbprintHeaderValue, setX509CertSha256ThumbprintHeaderValue, toStringpublic static final short COMPACT_SERIALIZATION_PARTS
public void setPlainTextCharEncoding(String plaintextCharEncoding)
public void setPlaintext(byte[] plaintext)
public void setPlaintext(String plaintext)
public String getPlaintextString() throws JoseException
JoseExceptionpublic byte[] getPlaintextBytes()
throws JoseException
JoseExceptionpublic String getPayload() throws JoseException
getPayload in class JsonWebStructureJoseExceptionpublic void setPayload(String payload)
setPayload in class JsonWebStructurepublic void setEncryptionMethodHeaderParameter(String enc)
public String getEncryptionMethodHeaderParameter()
public void setCompressionAlgorithmHeaderParameter(String zip)
public String getCompressionAlgorithmHeaderParameter()
public void enableDefaultCompression()
public void setContentEncryptionAlgorithmConstraints(AlgorithmConstraints contentEncryptionAlgorithmConstraints)
public ContentEncryptionAlgorithm getContentEncryptionAlgorithm() throws InvalidAlgorithmException
InvalidAlgorithmExceptionpublic KeyManagementAlgorithm getKeyManagementModeAlgorithm() throws InvalidAlgorithmException
InvalidAlgorithmExceptionpublic KeyManagementAlgorithm getAlgorithmNoConstraintCheck() throws InvalidAlgorithmException
getAlgorithmNoConstraintCheck in class JsonWebStructureInvalidAlgorithmExceptionpublic KeyManagementAlgorithm getAlgorithm() throws InvalidAlgorithmException
getAlgorithm in class JsonWebStructureInvalidAlgorithmExceptionprotected void setCompactSerializationParts(String[] parts) throws JoseException
setCompactSerializationParts in class JsonWebStructureJoseExceptionpublic CryptoPrimitive prepareDecryptingPrimitive() throws JoseException
CryptoPrimitive that
this JWE instance will use for agreement or decryption of the content encryption key.
This can optionally be called after setting the key (and maybe ProviderContext) but before getting the
payload (which is when the decryption magic happens).
This method provides access to the underlying primitive instance (e.g. a Cipher), which allows execution of
the operation to be gated by some approval or authorization.
For example, signing on Android with a key that was set to require user authentication when created needs a biometric
prompt to allow the signature to execute with the key.Cipher, KeyAgreement, etc., or nullJoseException - if an error condition is encountered during the initialization processpublic byte[] getEncryptedKey()
public String getCompactSerialization() throws JoseException
getCompactSerialization in class JsonWebStructureJoseExceptionpublic byte[] getContentEncryptionKey()
public void setContentEncryptionKey(byte[] contentEncryptionKey)
public void setEncodedContentEncryptionKey(String encodedContentEncryptionKey)
public byte[] getIv()
public void setIv(byte[] iv)
public void setEncodedIv(String encodedIv)
Copyright © 2022. All rights reserved.