Class CBORKeyPair

java.lang.Object
org.webpki.cbor.CBORKeyPair

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

See also CBORPublicKey.

Note: this implementation does not support RSA multiprime keys.

  • Method Details

    • convert

      public static CBORMap convert(KeyPair keyPair)
      Convert JCE key pair to COSE.
      Parameters:
      keyPair - in Java/JCE format
      Returns:
      Private key in COSE format
      Throws:
      CryptoException
    • convert

      public static KeyPair convert(CBORObject cosePrivateKey)
      Convert COSE private key to JCE.

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

      Parameters:
      cosePrivateKey - Private key in COSE format
      Returns:
      KeyPair as a Java/JCE object
      Throws:
      CryptoException
      CBORException