public interface JWS
Using the builder interface, a user of this API creates an object that can be used to sign payloads (creating a JWS in Compact Serialization encoding) and/or to validate a JWS in Compact Serialization encoding and obtain the encapsulated payload.
An instance returned by the builder can be used for multiple, possibly concurrent signing and/or validation operations.
Modifier and Type | Interface and Description |
---|---|
static class |
JWS.Algorithm
An enumeration of standard algorithms for signatures
|
static interface |
JWS.Builder
A builder for a JSON Web Signature operator.
|
Modifier and Type | Method and Description |
---|---|
String |
sign(String payload)
Creates a signed Compact Serialization of a JWS using the given payload.
|
String |
verify(String encoded)
Verifies the signature and extracts the encapsulated payload of a JWS.
|
String sign(String payload) throws JWTSignatureException
payload
- payloadJWTSignatureException
- if an exception occurs in creating the
signatureString verify(String encoded) throws JWTSignatureException
encoded
- signed JWS in Compact Serialization encodingJWTSignatureException
- if the signature is invalid or an error
occurs in trying to validate itCopyright © 2019. All rights reserved.