Class ECPrivateKey

java.lang.Object
org.bouncycastle.asn1.ASN1Object
org.bouncycastle.asn1.sec.ECPrivateKey
All Implemented Interfaces:
ASN1Encodable, Encodable

public class ECPrivateKey extends ASN1Object
the elliptic curve private key object from SEC 1
  • Constructor Details

    • ECPrivateKey

      public ECPrivateKey(BigInteger key)
      Deprecated.
      use constructor which takes orderBitLength to guarantee correct encoding.
    • ECPrivateKey

      public ECPrivateKey(int orderBitLength, BigInteger key)
      Base constructor.
      Parameters:
      orderBitLength - the bitLength of the order of the curve.
      key - the private key value.
    • ECPrivateKey

      public ECPrivateKey(BigInteger key, ASN1Encodable parameters)
      Deprecated.
      use constructor which takes orderBitLength to guarantee correct encoding.
    • ECPrivateKey

      public ECPrivateKey(BigInteger key, ASN1BitString publicKey, ASN1Encodable parameters)
      Deprecated.
      use constructor which takes orderBitLength to guarantee correct encoding.
    • ECPrivateKey

      public ECPrivateKey(int orderBitLength, BigInteger key, ASN1Encodable parameters)
    • ECPrivateKey

      public ECPrivateKey(int orderBitLength, BigInteger key, ASN1BitString publicKey, ASN1Encodable parameters)
  • Method Details

    • getInstance

      public static ECPrivateKey getInstance(Object obj)
    • getKey

      public BigInteger getKey()
    • getPublicKey

      public ASN1BitString getPublicKey()
    • getParameters

      public ASN1Primitive getParameters()
      Deprecated.
      Use getParametersObject() instead and getInstance methods or similar to get the object at the desired type.
    • getParametersObject

      public ASN1Object getParametersObject()
    • toASN1Primitive

      public ASN1Primitive toASN1Primitive()
      ECPrivateKey ::= SEQUENCE { version INTEGER { ecPrivkeyVer1(1) } (ecPrivkeyVer1), privateKey OCTET STRING, parameters [0] Parameters OPTIONAL, publicKey [1] BIT STRING OPTIONAL }
      Specified by:
      toASN1Primitive in interface ASN1Encodable
      Specified by:
      toASN1Primitive in class ASN1Object
      Returns:
      a primitive representation of this object.