de.flexiprovider.pqc.ecc.mceliece
Class McElieceCCA2KeyFactory

java.lang.Object
  |
  +--java.security.KeyFactorySpi
        |
        +--de.flexiprovider.api.keys.KeyFactory
              |
              +--de.flexiprovider.pqc.ecc.mceliece.McElieceCCA2KeyFactory

public class McElieceCCA2KeyFactory
extends KeyFactory

This class is used to translate between McEliece CCA2 keys and key specifications.

Author:
Elena Klintsevich, Martin Döring
See Also:
McElieceCCA2PrivateKey, McElieceCCA2PrivateKeySpec, McElieceCCA2PublicKey, McElieceCCA2PublicKeySpec

Field Summary
static java.lang.String OID
          The OID of the algorithm.
 
Constructor Summary
McElieceCCA2KeyFactory()
           
 
Method Summary
 PrivateKey generatePrivate(KeySpec keySpec)
          Converts, if possible, a key specification into a McElieceCCA2PrivateKey.
 PublicKey generatePublic(KeySpec keySpec)
          Converts, if possible, a key specification into a McElieceCCA2PublicKey.
 KeySpec getKeySpec(Key key, java.lang.Class keySpec)
          Converts, if possible, a given key into a key specification.
 Key translateKey(Key key)
          Translates a key into a form known by the FlexiProvider.
 
Methods inherited from class de.flexiprovider.api.keys.KeyFactory
engineGeneratePrivate, engineGeneratePublic, engineGetKeySpec, engineTranslateKey
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

OID

public static final java.lang.String OID
The OID of the algorithm.
Constructor Detail

McElieceCCA2KeyFactory

public McElieceCCA2KeyFactory()
Method Detail

generatePublic

public PublicKey generatePublic(KeySpec keySpec)
                         throws InvalidKeySpecException
Converts, if possible, a key specification into a McElieceCCA2PublicKey. Currently, the following key specifications are supported: McElieceCCA2PublicKeySpec, X509EncodedKeySpec.
Overrides:
generatePublic in class KeyFactory
Parameters:
keySpec - the key specification
Returns:
the McEliece CCA2 public key
Throws:
InvalidKeySpecException - if the key specification is not supported.

generatePrivate

public PrivateKey generatePrivate(KeySpec keySpec)
                           throws InvalidKeySpecException
Converts, if possible, a key specification into a McElieceCCA2PrivateKey. Currently, the following key specifications are supported: McElieceCCA2PrivateKeySpec, PKCS8EncodedKeySpec.
Overrides:
generatePrivate in class KeyFactory
Parameters:
keySpec - the key specification
Returns:
the McEliece CCA2 private key
Throws:
InvalidKeySpecException - if the KeySpec is not supported.

getKeySpec

public KeySpec getKeySpec(Key key,
                          java.lang.Class keySpec)
                   throws InvalidKeySpecException
Converts, if possible, a given key into a key specification. Currently, the following key specifications are supported:
Overrides:
getKeySpec in class KeyFactory
Parameters:
key - the key
keySpec - the key specification
Returns:
the specification of the McEliece CCA2 key
Throws:
InvalidKeySpecException - if the key type or the key specification is not supported.
See Also:
McElieceCCA2PrivateKey, McElieceCCA2PrivateKeySpec, McElieceCCA2PublicKey, McElieceCCA2PublicKeySpec

translateKey

public Key translateKey(Key key)
                 throws InvalidKeyException
Translates a key into a form known by the FlexiProvider. Currently, only the following "source" keys are supported: McElieceCCA2PrivateKey, McElieceCCA2PublicKey.
Overrides:
translateKey in class KeyFactory
Parameters:
key - the key
Returns:
a key of a known key type
Throws:
InvalidKeyException - if the key type is not supported.