Class CBORAsymKeySigner


public class CBORAsymKeySigner extends CBORSigner<CBORAsymKeySigner>
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)
      Creates a signer object with an external interface.
      Parameters:
      signer - Custom signer
    • CBORAsymKeySigner

      public CBORAsymKeySigner(PrivateKey privateKey)
      Creates a signer object 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)
      Creates a signer object with a private key.
      Parameters:
      privateKey - Signature key
      algorithm - Signature algorithm
  • Method Details

    • setPublicKey

      public CBORAsymKeySigner setPublicKey(PublicKey publicKey)
      Put 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