Class Overview
KeyFactory for EC keys. Keys must be instances of PublicKey or PrivateKey
and getAlgorithm() must return "EC". For such keys, it supports conversion
between the following:
For public keys:
. PublicKey with an X.509 encoding
. ECPublicKey
. ECPublicKeySpec
. X509EncodedKeySpec
For private keys:
. PrivateKey with a PKCS#8 encoding
. ECPrivateKey
. ECPrivateKeySpec
. PKCS8EncodedKeySpec
Summary
Public Methods |
static
ECKey
|
toECKey(Key key)
Static method to convert Key into a useable instance of
ECPublicKey or ECPrivateKey.
|
[Expand]
Inherited Methods |
From class
java.security.KeyFactorySpi
|
From class
java.lang.Object
Object
|
clone()
Creates and returns a copy of this object.
|
boolean
|
equals(Object obj)
Indicates whether some other object is "equal to" this one.
|
void
|
finalize()
Called by the garbage collector on an object when garbage collection
determines that there are no more references to the object.
|
final
Class<?>
|
getClass()
Returns the runtime class of this Object .
|
int
|
hashCode()
Returns a hash code value for the object.
|
final
void
|
notify()
Wakes up a single thread that is waiting on this object's
monitor.
|
final
void
|
notifyAll()
Wakes up all threads that are waiting on this object's monitor.
|
String
|
toString()
Returns a string representation of the object.
|
final
void
|
wait()
Causes the current thread to wait until another thread invokes the
notify() method or the
notifyAll() method for this object.
|
final
void
|
wait(long timeout, int nanos)
Causes the current thread to wait until another thread invokes the
notify() method or the
notifyAll() method for this object, or
some other thread interrupts the current thread, or a certain
amount of real time has elapsed.
|
final
void
|
wait(long timeout)
Causes the current thread to wait until either another thread invokes the
notify() method or the
notifyAll() method for this object, or a
specified amount of time has elapsed.
|
|
Fields
public
static
final
Provider
ecInternalProvider
Public Constructors
Public Methods
public
static
ECKey
toECKey
(Key key)
Static method to convert Key into a useable instance of
ECPublicKey or ECPrivateKey. Check the key and convert it
to a Sun key if necessary. If the key is not an EC key
or cannot be used, throw an InvalidKeyException.
The difference between this method and engineTranslateKey() is that
we do not convert keys of other providers that are already an
instance of ECPublicKey or ECPrivateKey.
To be used by future Java ECDSA and ECDH implementations.
Protected Methods
protected
PrivateKey
engineGeneratePrivate
(KeySpec keySpec)
Generates a private key object from the provided key
specification (key material).
Parameters
keySpec
| the specification (key material) of the private key. |
protected
PublicKey
engineGeneratePublic
(KeySpec keySpec)
Generates a public key object from the provided key
specification (key material).
Parameters
keySpec
| the specification (key material) of the public key. |
protected
T
engineGetKeySpec
(Key key, Class<T> keySpec)
Returns a specification (key material) of the given key
object.
keySpec
identifies the specification class in which
the key material should be returned. It could, for example, be
DSAPublicKeySpec.class
, to indicate that the
key material should be returned in an instance of the
DSAPublicKeySpec
class.
Parameters
key
| the key. |
keySpec
| the specification class in which
the key material should be returned. |
Returns
- the underlying key specification (key material) in an instance
of the requested specification class.
protected
Key
engineTranslateKey
(Key key)
Translate an EC key into a Sun EC key. If conversion is
not possible, throw an InvalidKeyException.
See also JCA doc.
Parameters
key
| the key whose provider is unknown or untrusted. |