public final class ECPublicKey extends AbstractECPublicKey
ECPublicKey
interface. It is derived from PublicKeyInfo
which
makes it suitable for use in X.509 certificates.
References:
[1] ANSI X9.62-2005, "American National Standard for Financial Services - The Elliptic Curve Digital Signature Algorithm (ECDSA)", ASC X9, November 2005.
[2] NIST SP 56A, "Recommendation for Pair-Wise Key Establishment Schemes Using Discrete Logarithm Cryptography", May 2013
ECKeyPairGenerator
,
ECKey
,
ECPrivateKey
,
ECPublicKeySpec
,
ECPrivateKeySpec
,
Serialized FormencodedPublicKey_, params_, w_
Constructor and Description |
---|
ECPublicKey(iaik.asn1.ASN1Object keyObj)
Creates a new public key from an ASN.1 Object.
|
ECPublicKey(byte[] encoded)
Creates a new public key from an ASN.1 encoded DER byte array.
|
ECPublicKey(ECParameterSpec params,
ECPoint w)
Creates a new public key object.
|
ECPublicKey(ECPublicKey key)
Creates a new public key object from a key.
|
ECPublicKey(ECPublicKeySpec key)
Creates a new public key object from a spec.
|
ECPublicKey(ECPublicKeySpec key)
Creates a new public key object from a spec.
|
ECPublicKey(InputStream is)
Reads the DER or BER encoded public key info from an input stream.
|
Modifier and Type | Method and Description |
---|---|
protected void |
createEncodedPublicKey()
Creates the ASN.1 public key structure following [1, Section E.9].
|
protected void |
decode(byte[] publicKey) |
boolean |
equals(Object obj) |
String |
getAlgorithm() |
int |
getKeyLength()
Returns the key length of this
ECKey . |
static boolean |
isFullCheckEnabled()
Deprecated.
Use
ECCelerate.isNISTSP56AFullCheckEnabled() instead. |
boolean |
isValid()
Determines whether this public key is valid according to [2, Section
5.6.2].
|
static ECPublicKey |
parse(byte[] publicKey)
This method parses an EC public key.
|
static void |
setFullCheckEnabled(boolean enable)
Deprecated.
Use
ECCelerate.setNISTSP56AFullCheckEnabled(boolean)
instead. |
String |
toString() |
encode, getParams, getW, hashCode
clone, createPublicKeyInfo, decode, getAlgorithmID, getEncoded, getFingerprint, getFormat, getPublicKey, getPublicKey, getPublicKey, getPublicKey, getPublicKey, getPublicKey, toASN1Object, writeTo
finalize, getClass, notify, notifyAll, wait, wait, wait
getEncoded, getFormat
public ECPublicKey(iaik.asn1.ASN1Object keyObj) throws InvalidKeyException
keyObj
- the ASN.1 object holding the public key informationInvalidKeyException
- if the given ASN1Object
does not hold a valid EC public
keypublic ECPublicKey(byte[] encoded) throws InvalidKeyException
encoded
- the byte arrayInvalidKeyException
- thrown if the given encoded key could not be decodedpublic ECPublicKey(ECParameterSpec params, ECPoint w)
params
- the domain parameters of the elliptic curvew
- the point on the elliptic curve, satisfying W = s*G
public ECPublicKey(ECPublicKeySpec key)
key
- the key materialpublic ECPublicKey(ECPublicKey key) throws InvalidCurveParameterSpecException
key
- the keyInvalidCurveParameterSpecException
- if the curve parameter validation failedpublic ECPublicKey(ECPublicKeySpec key) throws InvalidCurveParameterSpecException
key
- the key materialInvalidCurveParameterSpecException
- if the curve parameter validation failedpublic ECPublicKey(InputStream is) throws IOException, InvalidKeyException
is
- the input stream providing the dataInvalidKeyException
- if the provided key data is invalidIOException
- if the I/O error occursprotected void createEncodedPublicKey()
ECPoint ::= OCTET STRING
createEncodedPublicKey
in class AbstractECPublicKey
public String getAlgorithm()
getAlgorithm
in interface Key
getAlgorithm
in class iaik.x509.PublicKeyInfo
protected void decode(byte[] publicKey) throws InvalidKeyException
decode
in class iaik.x509.PublicKeyInfo
InvalidKeyException
public static ECPublicKey parse(byte[] publicKey) throws InvalidKeyException
publicKey
- a "RAW" EC public keyInvalidKeyException
- if the given key is not an EC public key@Deprecated public static void setFullCheckEnabled(boolean enable)
ECCelerate.setNISTSP56AFullCheckEnabled(boolean)
instead.enable
- if true
full key checks will be performed@Deprecated public static boolean isFullCheckEnabled()
ECCelerate.isNISTSP56AFullCheckEnabled()
instead.true
, if the full key check is enabled.true
, if the full key check is enabledpublic String toString()
toString
in class iaik.x509.PublicKeyInfo
public boolean isValid()
ECCelerate.isNISTSP56AFullCheckEnabled()
determines whether
the check is performed according to [2, Section 5.6.2.3.2] or [2, Section
5.6.2.3.3].isValid
in class AbstractECPublicKey
public int getKeyLength()
ECKey
ECKey
.public boolean equals(Object obj)
equals
in class AbstractECPublicKey
Copyright © 2011–2022 Stiftung SIC. All rights reserved.