EcPublicKey
insteadpublic class ECDSAPublicKey extends PublicKeyInfo implements java.io.Serializable, java.security.spec.KeySpec
The user-specific part of the key is a point on the related curve given as an
OCTET STRING. The entire public key is then ASN1-wrapped as
SubjectPublicKeyInfo as defined in X9.62 to enable the encoding
of algorithm and parameter settings.
The ASN1 structure is as follows:
SubjectPublicKeyInfo ::= SEQUENCE {
algorithm AlgorithmIdentifier,
subjectPublicKey BIT STRING }
where:
AlgorithmIdentifier ::= SEQUENCE {
algorithm OBJECT IDENTIFIER,
parameters ANY DEFINED BY algorithm OPTIONAL }
The subject public key is a DER encoded ECPoint wrapped as a
BIT STRING where the tag and length of the
OCTET STRING are removed before wrapping.
ASN1Object returned by
ECParameters.toASN1Object(). Refer to X9.62 section 7.4 for more
details.| Modifier and Type | Field and Description |
|---|---|
static ObjectID |
EC_PUBLIC_KEY
Deprecated.
Returns the EC Public Key OID (1.2.840.10045.2.1) as an
ObjectID
object. |
public_key_algorithm| Constructor and Description |
|---|
ECDSAPublicKey(ASN1Object object)
Deprecated.
Initializes the ECDSA public key with an ASN1 structure in PKCS#8 format.
|
ECDSAPublicKey(byte[] array)
Deprecated.
Initializes the ECDSA public key with a DER encoded ASN1 structure in
PKCS#8 format.
|
ECDSAPublicKey(ECParameters params,
ECPoint point)
Deprecated.
Default public constructor that takes the parameter and the curve point
as arguments.
|
ECDSAPublicKey(java.io.InputStream is)
Deprecated.
Initializes the ECDSA public key with a DER encoded ASN1 structure given
as an input stream in PKCS#8 format.
|
| Modifier and Type | Method and Description |
|---|---|
void |
decode(byte[] key)
Deprecated.
Initializes the public curve point, which is part of the ECDSA public key.
|
byte[] |
encode()
Deprecated.
Encodes the user-specific part of the ECDSA public key as a raw point.
|
java.lang.String |
getAlgorithm()
Deprecated.
Returns the name of the calling algorithm: ECDSA.
|
ECParameters |
getECParameters()
Deprecated.
Returns the parameter value.
|
ECPoint |
getECPublicPoint()
Deprecated.
Returns the public value, the point on the curve.
|
createPublicKeyInfo, decode, equals, getEncoded, getFingerprint, getFormat, getPublicKey, getPublicKey, toASN1Object, toString, writeTopublic static final ObjectID EC_PUBLIC_KEY
ObjectID
object.public ECDSAPublicKey(ECParameters params, ECPoint point)
params - the parameter set used for computing with the private keypoint - the real private informationpublic ECDSAPublicKey(ASN1Object object) throws java.security.InvalidKeyException
object - - the public key as an ASN1Object structurejava.security.InvalidKeyException - if the object is malformedpublic ECDSAPublicKey(byte[] array)
throws java.security.InvalidKeyException
array - the private key as DER encoded ASN1 structurejava.security.InvalidKeyException - if the object is malformed.public ECDSAPublicKey(java.io.InputStream is)
throws java.security.InvalidKeyException,
java.io.IOException
is - the private key as DER encoded ASN1 structure as an input streamInvalidKeyException, - IOException
if the object is malformedjava.security.InvalidKeyExceptionjava.io.IOExceptionpublic void decode(byte[] key)
throws java.security.InvalidKeyException
The public curve point must be given as raw point the
OCTET STRING tag and length must already have been removed.
decode in class PublicKeyInfokey - the raw pointjava.security.InvalidKeyException - if the key is malformedpublic byte[] encode()
getEncoded and
toASN1Object for the PKCS#8 representation of
this object.encode in class PublicKeyInfopublic java.lang.String getAlgorithm()
getAlgorithm in interface java.security.KeygetAlgorithm in class PublicKeyInfoString "ECDSA"public ECParameters getECParameters() throws CodingException
ECParameters objectCodingExceptionpublic ECPoint getECPublicPoint()
ECPoint object