public final class ECKeyFactory extends KeyFactorySpi
ECPublicKey <--> ECPublicKeySpec, X509EncodedKeySpec, java.security.spec.ECPublicKeySpec ECPrivateKey <--> ECPrivateKeySpec, PKCS8EncodedKeySpec, java.security.spec.ECPrivateKeySpec
ECKey,
ECPrivateKey,
ECPrivateKeySpec,
ECPublicKey,
ECPublicKeySpec| Constructor and Description |
|---|
ECKeyFactory()
Default constructor.
|
| Modifier and Type | Method and Description |
|---|---|
protected PrivateKey |
engineGeneratePrivate(KeySpec keySpec)
Generates a private key from the given key spec.
|
protected PublicKey |
engineGeneratePublic(KeySpec keySpec)
Generates a public key from the given key spec.
|
protected <T extends KeySpec> |
engineGetKeySpec(Key key,
Class<T> keySpec)
Implementation of the engine method.
|
protected Key |
engineTranslateKey(Key key)
Translates the given key object of some unknown or untrusted provider into
a key object supported by this EC key factory.
|
static ECKey |
translateKey(Key key)
Translates a key to an
ECKey. |
protected PublicKey engineGeneratePublic(KeySpec keySpec) throws InvalidKeySpecException
engineGeneratePublic in class KeyFactorySpikeySpec - the key spec may be a X509EncodedKeySpec or a
ECPublicKeySpec.InvalidKeySpecException - if the key spec can is not supported or erroneous.protected PrivateKey engineGeneratePrivate(KeySpec keySpec) throws InvalidKeySpecException
engineGeneratePrivate in class KeyFactorySpikeySpec - the key material; it may either be ECPrivateKeySpec or
PKCS8EncodedKeySpecInvalidKeySpecException - if the key spec is not supported or erroneousprotected <T extends KeySpec> T engineGetKeySpec(Key key, Class<T> keySpec) throws InvalidKeySpecException
engineGetKeySpec in class KeyFactorySpikey - the key to be converted (either ECPublicKey or
ECPrivateKey)keySpec - the key specification type. If the given key is of type
ECPublicKey the keySpec may be ECPublicKeySpec or
X509EncodedKeySpec. Otherwise (key is of type
ECPrivateKey) the keySpec may be ECPrivateKeySpec
or PKCS8EncodedKeySpecInvalidKeySpecException - if the key cannot be transformed into the provided keySpec.protected Key engineTranslateKey(Key key) throws InvalidKeyException
ECPublicKey or ECPrivateKey.engineTranslateKey in class KeyFactorySpikey - the key to be translatedInvalidKeyException - if the given key cannot be translatedpublic static ECKey translateKey(Key key) throws InvalidKeyException
ECKey.key - the key objectInvalidKeyException - if the given key cannot be translated to an ECKeyCopyright © 2011–2022 Stiftung SIC. All rights reserved.