Class JWS
java.lang.Object
org.jose4j.jwx.JsonWebStructure
org.jose4j.jws.JsonWebSignature
eu.europa.esig.dss.jades.validation.JWS
public class JWS
extends org.jose4j.jws.JsonWebSignature
Extension of a JSON web Signature according to RFC 7515
-
Field Summary
Fields inherited from class org.jose4j.jws.JsonWebSignature
COMPACT_SERIALIZATION_PARTSFields inherited from class org.jose4j.jwx.JsonWebStructure
base64url, doKeyValidation, headers, rawCompactSerialization -
Constructor Summary
-
Method Summary
Modifier and Type Method Description StringgetEncodedHeader()JWSJsonSerializationObjectgetJwsJsonSerializationObject()Gets theJWSJsonSerializationObjectbyte[]getSignatureValue()Returns SignatureValue bytesStringgetSignedPayload()Returns payload string based on a 'b64' value in the protected header (The actual signed payload value)Map<String,Object>getUnprotected()Gets unprotected header mapbooleanisRfc7797UnencodedPayload()Checks if the signature's payload is 'b64' unencoded (see RFC 7797)voidsetDetachedPayload(byte[] payload)Sets a detached payload binariesvoidsetJwsJsonSerializationObject(JWSJsonSerializationObject jwsJsonSerializationObject)Sets theJWSJsonSerializationObjectvoidsetKnownCriticalHeaders(Collection<String> knownCriticalHeaders)Sets values of the 'crit' header that must be known and proceededvoidsetProtected(String protectedBase64Url)Sets the protected headervoidsetSignature(byte[] signature)voidsetUnprotected(Map<String,Object> unprotected)Sets the unprotected headerMethods inherited from class org.jose4j.jws.JsonWebSignature
getAlgorithm, getAlgorithmNoConstraintCheck, getCompactSerialization, getDetachedContentCompactSerialization, getEncodedPayload, getEncodedSignature, getKeyPersuasion, getKeyType, getPayload, getPayloadBytes, getPayloadCharEncoding, getSignature, getUnverifiedPayload, getUnverifiedPayloadBytes, isSupportedCriticalHeader, onNewKey, setCompactSerializationParts, setEncodedPayload, setPayload, setPayloadBytes, setPayloadCharEncoding, sign, verifySignatureMethods inherited from class org.jose4j.jwx.JsonWebStructure
checkCrit, checkNotEmptyPart, fromCompactSerialization, getAlgorithmConstraints, getAlgorithmHeaderValue, getCertificateChainHeaderValue, getContentTypeHeaderValue, getHeader, getHeader, getHeaders, getIntegrity, getJwkHeader, getKey, getKeyIdHeaderValue, getLeafCertificateHeaderValue, getObjectHeader, getProviderCtx, getX509CertSha1ThumbprintHeaderValue, getX509CertSha256ThumbprintHeaderValue, isDoKeyValidation, setAlgorithmConstraints, setAlgorithmHeaderValue, setCertificateChainHeaderValue, setCompactSerialization, setContentTypeHeaderValue, setCriticalHeaderNames, setDoKeyValidation, setEncodedHeader, setHeader, setHeader, setIntegrity, setJwkHeader, setKey, setKeyIdHeaderValue, setKnownCriticalHeaders, setProviderContext, setX509CertSha1ThumbprintHeaderValue, setX509CertSha1ThumbprintHeaderValue, setX509CertSha256ThumbprintHeaderValue, setX509CertSha256ThumbprintHeaderValue, toString
-
Constructor Details
-
JWS
public JWS()The default constructor creating an empty JsonWebSignature -
JWS
The constructor to instantiate a JWSCompactSerialization objects (RFC 7515)- Parameters:
parts- an array of String with the header, optional payload and the signature
-
-
Method Details
-
getEncodedHeader
- Overrides:
getEncodedHeaderin classorg.jose4j.jwx.JsonWebStructure
-
setDetachedPayload
public void setDetachedPayload(byte[] payload)Sets a detached payload binaries- Parameters:
payload- a byte array representing a payload
-
getSignedPayload
Returns payload string based on a 'b64' value in the protected header (The actual signed payload value)- Returns:
Stringpayload to be signed
-
isRfc7797UnencodedPayload
public boolean isRfc7797UnencodedPayload()Checks if the signature's payload is 'b64' unencoded (see RFC 7797)- Overrides:
isRfc7797UnencodedPayloadin classorg.jose4j.jws.JsonWebSignature- Returns:
- TRUE if 'b64' is present and set to false, FALSE otherwise
-
getSignatureValue
public byte[] getSignatureValue()Returns SignatureValue bytes- Returns:
- byte array representing a signature value
-
setSignature
public void setSignature(byte[] signature)- Overrides:
setSignaturein classorg.jose4j.jws.JsonWebSignature
-
setProtected
Sets the protected header- Parameters:
protectedBase64Url-Stringbase64url encoded protected header- Throws:
org.jose4j.lang.JoseException- if a format exception occurs
-
getUnprotected
Gets unprotected header map- Returns:
- unprotected header map
-
setUnprotected
Sets the unprotected header- Parameters:
unprotected- the unprotected header map
-
getJwsJsonSerializationObject
Gets theJWSJsonSerializationObject- Returns:
JWSJsonSerializationObject
-
setJwsJsonSerializationObject
Sets theJWSJsonSerializationObject- Parameters:
jwsJsonSerializationObject-JWSJsonSerializationObject
-
setKnownCriticalHeaders
Sets values of the 'crit' header that must be known and proceeded- Parameters:
knownCriticalHeaders- a collection of supportedStringheaders
-