|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.security.KeyFactorySpi | +--iaik.security.dh.ESDHKeyFactory
This class converts Ephemeral-Static Diffie Hellman keys (opaque representation) in their KeySpecs (transparent representation) and vice versa.
To convert, for instance, DER encoded PKCS#8 private key material (e.g. pkcs8_key_spec
instantiated from PKCS8EncodedKeySpec
) into ESDHPrivateKey representation, use this KeyFactory
for ESDH keys:
KeyFactory esdh_key_fac = KeyFactory.getInstance("ESDH"); ESDHPrivateKey esdh_priv_key = (ESDHPrivateKey)esdh_key_fac.generatePrivate(pkcs8_key_spec);
ESDHPrivateKey
,
ESDHPublicKey
,
ESDHKeyAgreement
Constructor Summary | |
ESDHKeyFactory()
Default constructor for creating an ESDHKeyFactory. |
Method Summary | |
protected PrivateKey |
engineGeneratePrivate(KeySpec keySpec)
Converts the given key specification to a PrivateKey. |
protected PublicKey |
engineGeneratePublic(KeySpec keySpec)
Converts the given key specification to a PublicKey. |
protected KeySpec |
engineGetKeySpec(Key key,
Class classSpec)
Converts the given key into the requested key specification (key material). |
protected Key |
engineTranslateKey(Key key)
This method can't translate any keys. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public ESDHKeyFactory()
KeyFactory.getInstance("ESDH");
for instantiating
a ESDHKeyFactory.
Method Detail |
protected PrivateKey engineGeneratePrivate(KeySpec keySpec) throws InvalidKeySpecException
engineGeneratePrivate
in class KeyFactorySpi
keySpec
- the key specification as ESDHPrivateKeySpec or PKCS8EncodedKeySpecInvalidKeySpecException
- if the given key material is not
a ESDHPrivateKeySpec or PKCS8EncodedKeySpecprotected PublicKey engineGeneratePublic(KeySpec keySpec) throws InvalidKeySpecException
engineGeneratePublic
in class KeyFactorySpi
keySpec
- the key specification as ESDHPublicKeySpec or X509EncodedKeySpecInvalidKeySpecException
- if the given key material is not
a ESDHPublicKeySpec or X509EncodedKeySpecprotected KeySpec engineGetKeySpec(Key key, Class classSpec) throws InvalidKeySpecException
classSpec
. Each attempt
to get key material of a type not matching to a given ESDH key will raise an exception.
engineGetKeySpec
in class KeyFactorySpi
key
- the key to be converted, which either may be an ESDHPublicKey or an ESDHPrivateKey.keySpec
- the key specification type into which the key shall be converted, which may be
an ESDHPublicKeySpec or a X509EncodedKeySpec if the given key is an ESDHPublicKey, or
an ESDHPrivateKeySpec or a PKCS8EncodedKeySpec if the given key is an ESDHPrivateKeyInvalidKeySpecException
- if the given key cannot be converted into the
requested key specification object by this key factoryprotected Key engineTranslateKey(Key key) throws InvalidKeyException
engineTranslateKey
in class KeyFactorySpi
|
This Javadoc may contain text parts from Internet Standard specifications (RFC 2459, 3280, 3039, 2560, 1521, 821, 822, 2253, 1319, 1321, ,2630, 2631, 2268, 3058, 2984, 2104, 2144, 2040, 2311, 2279, see copyright note) and RSA Data Security Public-Key Cryptography Standards (PKCS#1,3,5,7,8,9,10,12, see copyright note). | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |