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
algparameter 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 thealgparameter.
-
JoseHttpSigner
A constructor with a key and algorithm for signing.An algorithm needs to be specified by either the
algargument passed to this method or thealgparameter 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 thealgparameter of the key does not match the algorithm specified by thealgargument. Or, the key does not contain thealgparameter and thealgargument is null.
-
-
Method Details
-
sign
Description copied from interface:HttpSignerSign the signature base (= create a signature).- Specified by:
signin interfaceHttpSigner- Parameters:
signatureBase- The signature base to be signed.- Returns:
- The resulting signature.
- Throws:
SignatureException- An error occurred during the signing process.
-
getKey
-
getAlg
-