de.flexiprovider.pqc.ots.merkle
Class MerkleOTSKeyFactory
java.lang.Object
|
+--java.security.KeyFactorySpi
|
+--de.flexiprovider.api.keys.KeyFactory
|
+--de.flexiprovider.pqc.ots.merkle.MerkleOTSKeyFactory
- public class MerkleOTSKeyFactory
- extends KeyFactory
This class is able to transform MerkleOTS keys and MerkleOTS key
specifications into a form that can be used with the FlexiProvider.
- Author:
- Elena Klintsevich
- See Also:
MerkleOTSPrivateKey,
MerkleOTSPublicKey
|
Field Summary |
static java.lang.String |
OID
The OID of MerkleOTS. |
| 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 MerkleOTS.
MerkleOTSKeyFactory
public MerkleOTSKeyFactory()
generatePublic
public PublicKey generatePublic(KeySpec keySpec)
throws InvalidKeySpecException
- Converts, if possible, a key specification into a
MerkleOTSPublicKey. Currently, the following key specifications
are supported: MerkleOTSPublicKeySpec.
- Overrides:
generatePublic in class KeyFactory
- Parameters:
keySpec - the key specification- Returns:
- a public Merkle OTS key
- Throws:
InvalidKeySpecException - if the KeySpec is not supported.- See Also:
MerkleOTSPublicKey
generatePrivate
public PrivateKey generatePrivate(KeySpec keySpec)
throws InvalidKeySpecException
- Converts, if possible, a key specification into a
MerkleOTSPrivateKey. Currently, the following key specifications
are supported: MerkleOTSPrivateKeySpec.
- Overrides:
generatePrivate in class KeyFactory
- Parameters:
keySpec - the key specification- Returns:
- a private Merkle OTS key
- Throws:
InvalidKeySpecException - if the KeySpec is not supported.- See Also:
MerkleOTSPrivateKey
getKeySpec
public KeySpec getKeySpec(Key key,
java.lang.Class spec)
throws InvalidKeySpecException
- Converts a given key into a key specification, if possible. Currently the
following specifications are supported:
- for MerkleOTSPublicKey: X509EncodedKeySpec, OTSKeySpec
- for OTSPrivateKey: PKCS8EncodedKeySpec, OTSKeySpec.
- Overrides:
getKeySpec in class KeyFactory
- Parameters:
key - the key.spec - the class of which type the returned class should be.- Returns:
- OTSKeySpec the specification of the MerkleOTS key.
- Throws:
InvalidKeySpecException - if the specification is not supported.- See Also:
MerkleOTSPrivateKey,
MerkleOTSPublicKey
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: OTSPrivateKey, MerkleOTSPublicKey.
- Overrides:
translateKey in class KeyFactory
- Parameters:
key - the key.- Returns:
- a key of a known key type.
- Throws:
InvalidKeyException - if the key is not supported.