de.flexiprovider.pqc.ecc.niederreiter
Class NiederreiterKeyFactory

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

public class NiederreiterKeyFactory
extends KeyFactory

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

Author:
Elena Klintsevich, Martin Döring
See Also:
NiederreiterPrivateKey, NiederreiterPrivateKeySpec, NiederreiterPublicKey, NiederreiterPublicKeySpec

Field Summary
static java.lang.String OID
          The OID of the algorithm.
 
Constructor Summary
NiederreiterKeyFactory()
           
 
Method Summary
 PrivateKey generatePrivate(KeySpec keySpec)
          Converts, if possible, a key specification into a NiederreiterPrivateKey.
 PublicKey generatePublic(KeySpec keySpec)
          Converts, if possible, a key specification into a NiederreiterPublicKey.
 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

NiederreiterKeyFactory

public NiederreiterKeyFactory()
Method Detail

generatePublic

public PublicKey generatePublic(KeySpec keySpec)
                         throws InvalidKeySpecException
Converts, if possible, a key specification into a NiederreiterPublicKey. Currently, the following key specifications are supported: NiederreiterPublicKeySpec.
Overrides:
generatePublic in class KeyFactory
Parameters:
keySpec - the key specification
Returns:
the public Niederreiter key
Throws:
InvalidKeySpecException - if the KeySpec is not supported.
See Also:
NiederreiterPublicKey, NiederreiterPublicKeySpec

generatePrivate

public PrivateKey generatePrivate(KeySpec keySpec)
                           throws InvalidKeySpecException
Converts, if possible, a key specification into a NiederreiterPrivateKey. Currently, the following key specifications are supported: NiederreiterPrivateKeySpec.
Overrides:
generatePrivate in class KeyFactory
Parameters:
keySpec - the key specification
Returns:
the private Niederreiter key
Throws:
InvalidKeySpecException - if the KeySpec is not supported.
See Also:
NiederreiterPrivateKey, NiederreiterPrivateKeySpec

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 specifications are supported:
Overrides:
getKeySpec in class KeyFactory
Parameters:
key - the key
keySpec - the class of which type the returned class should be.
Returns:
the specification of the Niederreiter key
Throws:
InvalidKeySpecException - if the key type or key specification is not supported.
See Also:
NiederreiterPrivateKey, NiederreiterPrivateKeySpec, NiederreiterPublicKey, NiederreiterPublicKeySpec

translateKey

public Key translateKey(Key key)
                 throws InvalidKeyException
Translates a key into a form known by the FlexiProvider. Currently the following "source" keys are supported: NiederreiterPrivateKey, NiederreiterPublicKey.
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.