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.EncodedKeySpec
    This class represents the ASN.1 encoding of an EC private key, encoded according to the ASN.1 type ECPrivateKey. The ECPrivateKey syntax 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.String getFormat()
      Returns the name of the encoding format associated with this key specification.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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 - if encodedKey is null.
    • Method Detail

      • getEncoded

        public byte[] getEncoded()
        Returns the key bytes, encoded according to the RFC5915 standard.
        Overrides:
        getEncoded in class java.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:
        getFormat in class java.security.spec.EncodedKeySpec
        Returns:
        the string "RFC5915".

© Portions Copyright 2003, 2023 IBM Corporation. All rights reserved.
© Portions Copyright 2003, 2023 Oracle and/or its affiliates. All rights reserved.