public class JsonWebSignature extends JsonWebStructure
Modifier and Type | Field and Description |
---|---|
static short |
COMPACT_SERIALIZATION_PARTS |
base64url, doKeyValidation, headers, rawCompactSerialization
Constructor and Description |
---|
JsonWebSignature() |
Modifier and Type | Method and Description |
---|---|
JsonWebSignatureAlgorithm |
getAlgorithm() |
String |
getCompactSerialization() |
String |
getDetachedContentCompactSerialization()
Produces the compact serialization with an empty/detached payload as described in
Appendix F, Detached Content, of the JWS spec
though providing library support rather than making the application do it all as
described therein.
|
String |
getEncodedPayload() |
String |
getEncodedSignature() |
KeyPersuasion |
getKeyPersuasion() |
String |
getKeyType() |
String |
getPayload() |
String |
getPayloadCharEncoding() |
protected byte[] |
getSignature() |
String |
getUnverifiedPayload() |
protected void |
onNewKey() |
protected void |
setCompactSerializationParts(String[] parts) |
void |
setEncodedPayload(String encodedPayload) |
void |
setPayload(String payload) |
void |
setPayloadCharEncoding(String payloadCharEncoding) |
protected void |
setSignature(byte[] signature) |
void |
sign() |
boolean |
verifySignature() |
checkCrit, checkNotEmptyPart, fromCompactSerialization, getAlgorithmConstraints, getAlgorithmHeaderValue, getContentTypeHeaderValue, getEncodedHeader, getHeader, getHeader, getHeaders, getIntegrity, getKey, getKeyIdHeaderValue, getProviderCtx, getX509CertSha1ThumbprintHeaderValue, getX509CertSha256ThumbprintHeaderValue, isDoKeyValidation, setAlgorithmConstraints, setAlgorithmHeaderValue, setCompactSerialization, setContentTypeHeaderValue, setCriticalHeaderNames, setDoKeyValidation, setEncodedHeader, setHeader, setIntegrity, setKey, setKeyIdHeaderValue, setKnownCriticalHeaders, setProviderContext, setX509CertSha1ThumbprintHeaderValue, setX509CertSha1ThumbprintHeaderValue, setX509CertSha256ThumbprintHeaderValue, setX509CertSha256ThumbprintHeaderValue, toString
public static final short COMPACT_SERIALIZATION_PARTS
public void setPayload(String payload)
setPayload
in class JsonWebStructure
protected void setCompactSerializationParts(String[] parts) throws JoseException
setCompactSerializationParts
in class JsonWebStructure
JoseException
public String getCompactSerialization() throws JoseException
getCompactSerialization
in class JsonWebStructure
JoseException
public String getDetachedContentCompactSerialization() throws JoseException
JoseException
- if an error condition is encountered during the signing processpublic void sign() throws JoseException
JoseException
protected void onNewKey()
onNewKey
in class JsonWebStructure
public boolean verifySignature() throws JoseException
JoseException
public JsonWebSignatureAlgorithm getAlgorithm() throws InvalidAlgorithmException
getAlgorithm
in class JsonWebStructure
InvalidAlgorithmException
public String getPayload() throws JoseException
getPayload
in class JsonWebStructure
JoseException
public String getUnverifiedPayload()
public String getPayloadCharEncoding()
public void setPayloadCharEncoding(String payloadCharEncoding)
public String getKeyType() throws InvalidAlgorithmException
InvalidAlgorithmException
public KeyPersuasion getKeyPersuasion() throws InvalidAlgorithmException
InvalidAlgorithmException
public void setEncodedPayload(String encodedPayload)
public String getEncodedPayload()
public String getEncodedSignature()
protected byte[] getSignature()
protected void setSignature(byte[] signature)
Copyright © 2016. All rights reserved.