Class JoseHttpVerifier
java.lang.Object
com.authlete.hms.impl.JoseHttpVerifier
- All Implemented Interfaces:
HttpVerifier
An
HttpVerifier
implementation for JWS algorithms.- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionJoseHttpVerifier
(JWK key) A constructor with a key for verification.JoseHttpVerifier
(JWK key, JWSAlgorithm alg) A constructor with a key and algorithm for verification. -
Method Summary
-
Constructor Details
-
JoseHttpVerifier
A constructor with a key for verification.An algorithm needs to be specified by the
alg
parameter in the JWK.- Parameters:
key
- A verification key.- Throws:
IllegalArgumentException
- The key is null, or it does not contain thealg
parameter.
-
JoseHttpVerifier
A constructor with a key and algorithm for verification.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 verification key.alg
- An algorithm for verification.- Throws:
IllegalArgumentException
- The key is null, 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
-
verify
Description copied from interface:HttpVerifier
Verify the signature.- Specified by:
verify
in interfaceHttpVerifier
- Parameters:
signatureBase
- The signature base used to create the signature.signature
- The signature to be verified.- Returns:
- True when the signature is valid.
- Throws:
SignatureException
- An error occurred during the verification process, or the signature is invalid.
-
getKey
-
getAlg
-