de.flexiprovider.nf.iq.iqgq
Class IQGQKeyFactory
java.lang.Object
|
+--java.security.KeyFactorySpi
|
+--de.flexiprovider.api.keys.KeyFactory
|
+--de.flexiprovider.nf.iq.iqgq.IQGQKeyFactory
- public class IQGQKeyFactory
- extends KeyFactory
This class provides the translation between key specifications (IQGQPrivateKeySpec
or IQGQPublicKeySpec), DER-encoded ASN.1 representations (X509EncodedKeySpec
or PKCS8EncodedKeySpec), and keys (IQGQPrivateKey or
IQGQPublicKey).
- Author:
- Birgit Henhapl, Michele Boivin, Ralf-P. Weinmann
|
Field Summary |
static java.lang.String |
OID
The OID of the IQGQ key representation. |
|
Method Summary |
PrivateKey |
generatePrivate(KeySpec keySpec)
Generates a private key object from the provided key specification (key
material). |
PublicKey |
generatePublic(KeySpec keySpec)
Generates a public key object from the provided key specification (key
material). |
KeySpec |
getKeySpec(Key key,
java.lang.Class keySpec)
Returns a specification (key material) of the given key object. |
Key |
translateKey(Key key)
Translates a key object, whose provider may be unknown or potentially
untrusted, into a corresponding key object of this key factory. |
| Methods inherited from class java.lang.Object |
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
OID
public static final java.lang.String OID
- The OID of the IQGQ key representation.
IQGQKeyFactory
public IQGQKeyFactory()
generatePrivate
public PrivateKey generatePrivate(KeySpec keySpec)
throws InvalidKeySpecException
- Generates a private key object from the provided key specification (key
material).
- Overrides:
generatePrivate in class KeyFactory
- Parameters:
keySpec - the specification (key material) of the private key- Returns:
- the private key
- Throws:
InvalidKeySpecException - if the given key specification is inappropriate for this
key factory to produce a private key.
generatePublic
public PublicKey generatePublic(KeySpec keySpec)
throws InvalidKeySpecException
- Generates a public key object from the provided key specification (key
material).
- Overrides:
generatePublic in class KeyFactory
- Parameters:
keySpec - the specification (key material) of the public key- Returns:
- the public key
- Throws:
InvalidKeySpecException - if the given key specification is inappropriate for this
key factory to produce a public key.
getKeySpec
public KeySpec getKeySpec(Key key,
java.lang.Class keySpec)
throws InvalidKeySpecException
- 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
IQGQPublicKeySpec.class, to indicate that the key material
should be returned in an instance of the IQGQPublicKeySpec
class.
- Overrides:
getKeySpec in class KeyFactory
- Parameters:
key - the keykeySpec - 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
- Throws:
InvalidKeySpecException - if the requested key specification is inappropriate for
the given key, or the given key cannot be dealt with
(e.g., the given key has an unrecognized format).
translateKey
public Key translateKey(Key key)
throws InvalidKeyException
- Translates a key object, whose provider may be unknown or potentially
untrusted, into a corresponding key object of this key factory.
Currently, only the following key types are supported:
IQGQPublicKey, IQGQPrivateKey.
- Overrides:
translateKey in class KeyFactory
- Parameters:
key - the key whose provider is unknown or untrusted- Returns:
- the translated key
- Throws:
InvalidKeyException - if the given key cannot be processed by this key factory.