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. |
| 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 algorithm.
NiederreiterKeyFactory
public NiederreiterKeyFactory()
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:
- for NiederreiterPublicKey: X509EncodedKeySpec,
NiederreiterPublicKeySpec
- for NiederreiterPrivateKey: PKCS8EncodedKeySpec,
NiederreiterPrivateKeySpec
- Overrides:
getKeySpec in class KeyFactory
- Parameters:
key - the keykeySpec - 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.