de.flexiprovider.api.keys
Class KeyFactory

java.lang.Object
  |
  +--java.security.KeyFactorySpi
        |
        +--de.flexiprovider.api.keys.KeyFactory
Direct Known Subclasses:
CMSSKeyFactory, DSAKeyFactory, ECKeyFactory, ElGamalKeyFactory, GMSSKeyFactory, IQDSAKeyFactory, IQGQKeyFactory, IQRDSAKeyFactory, McElieceCCA2KeyFactory, McElieceKeyFactory, MerkleOTSKeyFactory, MeRSAKeyFactory, MpRSAKeyFactory, NiederreiterKeyFactory, PFlashKeyFactory, RainbowKeyFactory, RSAKeyFactory, SSVElGamalKeyFactory

public abstract class KeyFactory
extends java.security.KeyFactorySpi


Constructor Summary
KeyFactory()
           
 
Method Summary
protected  java.security.PrivateKey engineGeneratePrivate(java.security.spec.KeySpec keySpec)
          JCA adapter for FlexiAPI method generatePrivate(): generate a private key object from the provided key specification (key material).
protected  java.security.PublicKey engineGeneratePublic(java.security.spec.KeySpec keySpec)
          JCA adapter for FlexiAPI method generatePublic(): generates a public key object from the provided key specification (key material).
protected  java.security.spec.KeySpec engineGetKeySpec(java.security.Key key, java.lang.Class keySpec)
          JCA adapter for FlexiAPI method getKeySpec(): return a specification (key material) of the given key object.
protected  java.security.Key engineTranslateKey(java.security.Key key)
          JCA adapter for FlexiAPI method translateKey(): translate a key object, whose provider may be unknown or potentially untrusted, into a corresponding key object of this key factory.
abstract  PrivateKey generatePrivate(KeySpec keySpec)
          Generate a private key object from the provided key specification (key material).
abstract  PublicKey generatePublic(KeySpec keySpec)
          Generate a public key object from the provided key specification (key material).
abstract  KeySpec getKeySpec(Key key, java.lang.Class keySpec)
          Return a specification (key material) of the given key object.
abstract  Key translateKey(Key key)
          Translate 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
 

Constructor Detail

KeyFactory

public KeyFactory()
Method Detail

engineGeneratePublic

protected java.security.PublicKey engineGeneratePublic(java.security.spec.KeySpec keySpec)
                                                throws java.security.spec.InvalidKeySpecException
JCA adapter for FlexiAPI method generatePublic(): generates a public key object from the provided key specification (key material).
Overrides:
engineGeneratePublic in class java.security.KeyFactorySpi
Parameters:
keySpec - the specification (key material) of the public key
Returns:
the public key
Throws:
java.security.spec.InvalidKeySpecException - if the given key specification is inappropriate for this key factory to produce a public key.

engineGeneratePrivate

protected java.security.PrivateKey engineGeneratePrivate(java.security.spec.KeySpec keySpec)
                                                  throws java.security.spec.InvalidKeySpecException
JCA adapter for FlexiAPI method generatePrivate(): generate a private key object from the provided key specification (key material).
Overrides:
engineGeneratePrivate in class java.security.KeyFactorySpi
Parameters:
keySpec - the specification (key material) of the private key
Returns:
the private key
Throws:
java.security.spec.InvalidKeySpecException - if the given key specification is inappropriate for this key factory to produce a private key.

engineGetKeySpec

protected final java.security.spec.KeySpec engineGetKeySpec(java.security.Key key,
                                                            java.lang.Class keySpec)
                                                     throws java.security.spec.InvalidKeySpecException
JCA adapter for FlexiAPI method getKeySpec(): return 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.
Overrides:
engineGetKeySpec in class java.security.KeyFactorySpi
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
Throws:
java.security.spec.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).

engineTranslateKey

protected final java.security.Key engineTranslateKey(java.security.Key key)
                                              throws java.security.InvalidKeyException
JCA adapter for FlexiAPI method translateKey(): translate a key object, whose provider may be unknown or potentially untrusted, into a corresponding key object of this key factory.
Overrides:
engineTranslateKey in class java.security.KeyFactorySpi
Parameters:
key - the key whose provider is unknown or untrusted
Returns:
the translated key
Throws:
java.security.InvalidKeyException - if the given key cannot be processed by this key factory.

generatePublic

public abstract PublicKey generatePublic(KeySpec keySpec)
                                  throws InvalidKeySpecException
Generate a public key object from the provided key specification (key material).
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.

generatePrivate

public abstract PrivateKey generatePrivate(KeySpec keySpec)
                                    throws InvalidKeySpecException
Generate a private key object from the provided key specification (key material).
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.

getKeySpec

public abstract KeySpec getKeySpec(Key key,
                                   java.lang.Class keySpec)
                            throws InvalidKeySpecException
Return 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
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 abstract Key translateKey(Key key)
                          throws InvalidKeyException
Translate a key object, whose provider may be unknown or potentially untrusted, into a corresponding key object of this key factory.
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.