|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.nimbusds.jose.crypto.MACSigner
@ThreadSafe public class MACSigner
Message Authentication Code (MAC) signer of
JWS objects
. This class is thread-safe.
Supports the following JSON Web Algorithms (JWAs):
Constructor Summary | |
---|---|
MACSigner(byte[] sharedSecret)
Creates a new Message Authentication (MAC) signer. |
|
MACSigner(String sharedSecretString)
Creates a new Message Authentication (MAC) signer. |
Method Summary | |
---|---|
protected static String |
getJCAAlgorithmName(JWSAlgorithm alg)
Gets the matching Java Cryptography Architecture (JCA) algorithm name for the specified HMAC-based JSON Web Algorithm (JWA). |
byte[] |
getSharedSecret()
Gets the shared secret. |
String |
getSharedSecretString()
Gets the shared secret as a UTF-8 encoded string. |
Base64URL |
sign(ReadOnlyJWSHeader header,
byte[] signingInput)
Signs the specified input of a
JWS object . |
Set<JWSAlgorithm> |
supportedAlgorithms()
Returns the names of the supported JWS algorithms. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.nimbusds.jose.JWSAlgorithmProvider |
---|
supportedAlgorithms |
Constructor Detail |
---|
public MACSigner(byte[] sharedSecret)
sharedSecret
- The shared secret. Must not be null
.public MACSigner(String sharedSecretString)
sharedSecretString
- The shared secret as a UTF-8 encoded
string. Must not be null
.Method Detail |
---|
public Base64URL sign(ReadOnlyJWSHeader header, byte[] signingInput) throws JOSEException
JWSSigner
input
of a
JWS object
.
sign
in interface JWSSigner
header
- The JSON Web Signature (JWS) header. Must
specify a supported JWS algorithm and must not
be null
.signingInput
- The input to sign. Must not be null
.
JOSEException
- If the JWS algorithm is not supported or if
signing failed for some other reason.protected static String getJCAAlgorithmName(JWSAlgorithm alg) throws JOSEException
alg
- The JSON Web Algorithm (JWA). Must be supported and not
null
.
JOSEException
- If the algorithm is not supported.public byte[] getSharedSecret()
public String getSharedSecretString()
public Set<JWSAlgorithm> supportedAlgorithms()
JWSAlgorithmProvider
alg
JWS header parameter.
supportedAlgorithms
in interface JWSAlgorithmProvider
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |