Package com.unboundid.util.ssl.cert
Class EllipticCurvePrivateKey
java.lang.Object
com.unboundid.util.ssl.cert.DecodedPrivateKey
com.unboundid.util.ssl.cert.EllipticCurvePrivateKey
- All Implemented Interfaces:
Serializable
@NotMutable
@ThreadSafety(level=COMPLETELY_THREADSAFE)
public final class EllipticCurvePrivateKey
extends DecodedPrivateKey
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 Summary
Modifier and TypeMethodDescriptionRetrieves the OID for the named curve with which this private key is associated, if available.byte[]Retrieves the bytes that make up the actual elliptic curve private key.Retrieves the encoded public key with which this private key is associated, if available.intRetrieves the version for the elliptic curve private key.voidtoString(StringBuilder buffer) Appends a string representation of this decoded private key to the provided buffer.Methods inherited from class com.unboundid.util.ssl.cert.DecodedPrivateKey
toString
-
Method Details
-
getVersion
Retrieves the version for the elliptic curve private key.- Returns:
- The version for the elliptic curve private key.
-
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
nullif 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
nullif it was not included in the encoded key.
-
toString
Appends a string representation of this decoded private key to the provided buffer.- Specified by:
toStringin classDecodedPrivateKey- Parameters:
buffer- The buffer to which the information should be appended.
-