Package org.webpki.jose.jws
Class JWSAsymKeySigner
java.lang.Object
org.webpki.jose.jws.JWSSigner
org.webpki.jose.jws.JWSAsymKeySigner
JWS asymmetric key signer
-
Constructor Summary
ConstructorDescriptionJWSAsymKeySigner
(PrivateKey privateKey) Initialize signer.JWSAsymKeySigner
(PrivateKey privateKey, AsymSignatureAlgorithms signatureAlgorithm) Initialize signer. -
Method Summary
Modifier and TypeMethodDescriptionsetCertificatePath
(X509Certificate[] certificatePath) Adds "x5c" to the JWS header.setPublicKey
(PublicKey publicKey) Adds "jwk" to the JWS header.Methods inherited from class org.webpki.jose.jws.JWSSigner
addHeaderItems, setKeyId, setProvider, sign, sign
-
Constructor Details
-
JWSAsymKeySigner
Initialize signer. Note that a signer object may be used any number of times (assuming that the same parameters are valid). It is also thread-safe.- Parameters:
privateKey
- The key to sign withsignatureAlgorithm
- The algorithm to use
-
JWSAsymKeySigner
Initialize signer. Note that a signer object may be used any number of times (assuming that the same parameters are valid). It is also thread-safe. The default signature algorithm to use is based on the recommendations in RFC 7518.- Parameters:
privateKey
- The key to sign with
-
-
Method Details
-
setPublicKey
Adds "jwk" to the JWS header.- Parameters:
publicKey
- The public key to be included- Returns:
- JwsAsymKeySigner
-
setCertificatePath
Adds "x5c" to the JWS header.- Parameters:
certificatePath
- The certificate(s) to be included- Returns:
- JwsAsymKeySigner
-