Class EllipticCurvePrivateKey

java.lang.Object
com.unboundid.util.ssl.cert.DecodedPrivateKey
com.unboundid.util.ssl.cert.EllipticCurvePrivateKey
All Implemented Interfaces:
Serializable

This class provides a data structure for representing the information contained in an elliptic curve private key. As per RFC 5915 section 3, an elliptic curve private key is encoded as follows:
   ECPrivateKey ::= SEQUENCE {
     version        INTEGER { ecPrivkeyVer1(1) } (ecPrivkeyVer1),
     privateKey     OCTET STRING,
     parameters [0] ECParameters {{ NamedCurve }} OPTIONAL,
     publicKey  [1] BIT STRING OPTIONAL
   }
 
See Also:
  • Method Details

    • getVersion

      public int getVersion()
      Retrieves the version for the elliptic curve private key.
      Returns:
      The version for the elliptic curve private key.
    • getPrivateKeyBytes

      @NotNull public byte[] getPrivateKeyBytes()
      Retrieves the bytes that make up the actual elliptic curve private key.
      Returns:
      The bytes that make up the actual elliptic curve private key.
    • getNamedCurveOID

      Retrieves the OID for the named curve with which this private key is associated, if available.
      Returns:
      The OID for the named curve with which this private key is associated, or null if it was not included in the encoded key.
    • getPublicKey

      Retrieves the encoded public key with which this private key is associated, if available.
      Returns:
      The encoded public key with which this private key is associated, or null if it was not included in the encoded key.
    • toString

      public void toString(@NotNull StringBuilder buffer)
      Appends a string representation of this decoded private key to the provided buffer.
      Specified by:
      toString in class DecodedPrivateKey
      Parameters:
      buffer - The buffer to which the information should be appended.