Class CBORAsymKeySigner

java.lang.Object
org.webpki.cbor.CBORSigner
org.webpki.cbor.CBORAsymKeySigner

public class CBORAsymKeySigner extends CBORSigner
Class for creating CBOR asymmetric key signatures.

Also see CBORSigner.

Note that asymmetric key signatures do not permit using both a keyId and an in-line public key. Also see CBORSigner.setKeyId(CBORObject) and setPublicKey(PublicKey).

  • Constructor Details

    • CBORAsymKeySigner

      public CBORAsymKeySigner(AsymKeySignerInterface signer)
      Initializes a signer with an external interface.
      Parameters:
      signer - Custom signer
    • CBORAsymKeySigner

      public CBORAsymKeySigner(PrivateKey privateKey)
      Initializes a signer with a private key.

      The default signature algorithm to use is based on the recommendations in RFC 7518.

      Parameters:
      privateKey - Signature key
    • CBORAsymKeySigner

      public CBORAsymKeySigner(PrivateKey privateKey, AsymSignatureAlgorithms algorithm)
      Initializes a signer with a private key.
      Parameters:
      privateKey - Signature key
      algorithm - Signature algorithm
  • Method Details

    • setPublicKey

      public CBORAsymKeySigner setPublicKey(PublicKey publicKey)
      Puts a public key into the signature container.

      Note that a public key value of null is equivalent to the default (=no public key).

      Parameters:
      publicKey - The public key or null
      Returns:
      this