Class JWSAsymKeySigner

java.lang.Object
org.webpki.jose.jws.JWSSigner
org.webpki.jose.jws.JWSAsymKeySigner

public class JWSAsymKeySigner extends JWSSigner
JWS asymmetric key signer
  • Constructor Details

    • JWSAsymKeySigner

      public JWSAsymKeySigner(PrivateKey privateKey, AsymSignatureAlgorithms signatureAlgorithm)
      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 with
      signatureAlgorithm - The algorithm to use
    • JWSAsymKeySigner

      public JWSAsymKeySigner(PrivateKey privateKey)
      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

      public JWSAsymKeySigner setPublicKey(PublicKey publicKey)
      Adds "jwk" to the JWS header.
      Parameters:
      publicKey - The public key to be included
      Returns:
      JwsAsymKeySigner
    • setCertificatePath

      public JWSAsymKeySigner setCertificatePath(X509Certificate[] certificatePath)
      Adds "x5c" to the JWS header.
      Parameters:
      certificatePath - The certificate(s) to be included
      Returns:
      JwsAsymKeySigner