ibm.security.internal.spec
Class RFC5915ECPrivateKeyEncodedKeySpec
- java.lang.Object
-
- java.security.spec.EncodedKeySpec
-
- ibm.security.internal.spec.RFC5915ECPrivateKeyEncodedKeySpec
-
- All Implemented Interfaces:
- java.security.spec.KeySpec
public class RFC5915ECPrivateKeyEncodedKeySpec extends java.security.spec.EncodedKeySpecThis class represents the ASN.1 encoding of an EC private key, encoded according to the ASN.1 typeECPrivateKey. TheECPrivateKeysyntax is defined in RFC5915 standard as follows:ECPrivateKey ::= SEQUENCE { version INTEGER { ecPrivkeyVer1(1) } (ecPrivkeyVer1), privateKey OCTET STRING, parameters [0] ECParameters {{ NamedCurve }} OPTIONAL, publicKey [1] BIT STRING OPTIONAL }- See Also:
Key,KeyFactory,KeySpec,EncodedKeySpec
-
-
Constructor Summary
Constructors Constructor and Description RFC5915ECPrivateKeyEncodedKeySpec(byte[] encodedKey)Creates a new RFC5915ECPrivateKeyEncodedKeySpec with the given encoded key.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description byte[]getEncoded()Returns the key bytes, encoded according to the RFC5915 standard.java.lang.StringgetFormat()Returns the name of the encoding format associated with this key specification.
-
-
-
Constructor Detail
-
RFC5915ECPrivateKeyEncodedKeySpec
public RFC5915ECPrivateKeyEncodedKeySpec(byte[] encodedKey)
Creates a new RFC5915ECPrivateKeyEncodedKeySpec with the given encoded key.- Parameters:
encodedKey- the key, which is assumed to be encoded according to the RFC5915 standard. The contents of the array are copied to protect against subsequent modification.- Throws:
java.lang.NullPointerException- ifencodedKeyis null.
-
-
Method Detail
-
getEncoded
public byte[] getEncoded()
Returns the key bytes, encoded according to the RFC5915 standard.- Overrides:
getEncodedin classjava.security.spec.EncodedKeySpec- Returns:
- the RFC5915 encoding of the key. Returns a new array each time this method is called.
-
getFormat
public java.lang.String getFormat()
Returns the name of the encoding format associated with this key specification.- Specified by:
getFormatin classjava.security.spec.EncodedKeySpec- Returns:
- the string
"RFC5915".
-
-