Class CBORPublicKey

java.lang.Object
org.webpki.cbor.CBORPublicKey

public class CBORPublicKey extends Object
Class handling Java/COSE public key conversions.

See also CBORKeyPair.

  • Method Details

    • convert

      public static CBORMap convert(PublicKey jcePublicKey)
      Convert JCE public key to COSE.
      Parameters:
      jcePublicKey - Public key in Java/JCE format
      Returns:
      Public key in COSE format
      Throws:
      CryptoException
    • convert

      public static PublicKey convert(CBORObject cosePublicKey)
      Convert COSE public key to JCE.
      Parameters:
      cosePublicKey - Public key in COSE format

      Note: there must not be any additional items like key identifiers or mandated signature algorithms.

      Returns:
      Public key as a Java/JCE object
      Throws:
      CryptoException
      CBORException