Class JoseHttpSigner
java.lang.Object
com.authlete.hms.impl.JoseHttpSigner
-
Constructor Summary
ConstructorsConstructorDescriptionJoseHttpSigner
(JWK key) A constructor with a key for signing.JoseHttpSigner
(JWK key, JWSAlgorithm alg) A constructor with a key and algorithm for signing. -
Method Summary
-
Constructor Details
-
JoseHttpSigner
A constructor with a key for signing.An algorithm needs to be specified by the
alg
parameter in the JWK.- Parameters:
key
- A signing key. This must be a private key.- Throws:
IllegalArgumentException
- The key is null, is not a private key, or does not contain thealg
parameter.
-
JoseHttpSigner
A constructor with a key and algorithm for signing.An algorithm needs to be specified by either the
alg
argument passed to this method or thealg
parameter in the JWK. When both means are used, the specified algorithms must be identical.- Parameters:
key
- A signing key. This must be a private key.alg
- An algorithm for signing.- Throws:
IllegalArgumentException
- The key is null, is not a private key, or thealg
parameter of the key does not match the algorithm specified by thealg
argument. Or, the key does not contain thealg
parameter and thealg
argument is null.
-
-
Method Details
-
sign
Description copied from interface:HttpSigner
Sign the signature base (= create a signature).- Specified by:
sign
in interfaceHttpSigner
- Parameters:
signatureBase
- The signature base to be signed.- Returns:
- The resulting signature.
- Throws:
SignatureException
- An error occurred during the signing process.
-
getKey
-
getAlg
-