public abstract class AbstractECPrivateKey extends iaik.pkcs.pkcs8.PrivateKeyInfo implements ECPrivateKey, ECKey
ECPrivateKey
interface. It is derived from
PrivateKeyInfo
, which makes it suitable for use with PKCS#8.
PKCS#8 [1] defines a syntax for encapsulating private key information:
PrivateKeyInfo ::= SEQUENCE { version Version, privateKeyAlgorithm PrivateKeyAlgorithmIdentifier, privateKey PrivateKey attributes [0] IMPLICIT Attributes OPTIONAL }This class implements some common methods and defines interfaces for all EC private keys.
References:
[1] An RSA Laboratories Technical Note. 1993. PKCS #8: Private-Key Information Syntax Standard v2.1
AbstractECPublicKey
,
Serialized FormModifier and Type | Field and Description |
---|---|
protected iaik.asn1.ASN1 |
encodedPrivateKey_
ASN.1 encoding of the private key.
|
protected ECParameterSpec |
params_ |
protected BigInteger |
s_ |
protected ECPoint |
w_ |
serialVersionUID
Modifier | Constructor and Description |
---|---|
protected |
AbstractECPrivateKey()
Creates a new instance; only for internal use
|
|
AbstractECPrivateKey(byte[] encoded)
Constructs a new private key from an encoded ASN.1 structure.
|
|
AbstractECPrivateKey(ECParameterSpec params,
BigInteger s)
Constructs a new private key from a set of curve parameters and a secret
integer
s . |
|
AbstractECPrivateKey(ECParameterSpec params,
BigInteger s,
ECPoint publicKey)
Creates a new private key with the specified parameters.
|
Modifier and Type | Method and Description |
---|---|
protected abstract void |
createEncodedPrivateKey()
Creates the ASN.1 private key structure.
|
protected byte[] |
encode() |
boolean |
equals(Object obj) |
protected void |
finalize() |
ECParameterSpec |
getParams()
Returns the domain parameters of the associated elliptic curve.
|
abstract AbstractECPublicKey |
getPublicKey()
Returns the corresponding
AbstractECPublicKey . |
BigInteger |
getS() |
int |
hashCode() |
clone, createPrivateKeyInfo, decode, decode, getAlgorithm, getAlgorithmID, getAttributes, getEncoded, getFormat, getPrivateKey, getPrivateKey, getPrivateKey, getPrivateKey, getPrivateKey, getPrivateKey, getPubKey, setAttributes, setPubKey, toASN1Object, toString, writeTo
getAlgorithm, getEncoded, getFormat
destroy, isDestroyed
getKeyLength
protected transient iaik.asn1.ASN1 encodedPrivateKey_
protected transient BigInteger s_
protected transient ECParameterSpec params_
protected transient ECPoint w_
public AbstractECPrivateKey(byte[] encoded) throws InvalidKeyException
encoded
- the byte[]
holding the ASN.1 structureInvalidKeyException
- thrown if the given encoded key could not be decodedpublic AbstractECPrivateKey(ECParameterSpec params, BigInteger s)
s
.params
- the curve parameterss
- the private keypublic AbstractECPrivateKey(ECParameterSpec params, BigInteger s, ECPoint publicKey)
params
- the domain parameterss
- the private keypublicKey
- the corresponding public key (may be null)protected AbstractECPrivateKey()
protected void finalize() throws Throwable
protected byte[] encode()
encode
in class iaik.pkcs.pkcs8.PrivateKeyInfo
protected abstract void createEncodedPrivateKey()
public ECParameterSpec getParams()
ECKey
public BigInteger getS()
getS
in interface ECPrivateKey
public int hashCode()
hashCode
in class iaik.pkcs.pkcs8.PrivateKeyInfo
public boolean equals(Object obj)
equals
in class iaik.pkcs.pkcs8.PrivateKeyInfo
public abstract AbstractECPublicKey getPublicKey()
AbstractECPublicKey
.AbstractECPublicKey
Copyright © 2011–2022 Stiftung SIC. All rights reserved.