de.flexiprovider.pqc.hbc.gmss
Class GMSSKeyFactory

java.lang.Object
  |
  +--java.security.KeyFactorySpi
        |
        +--de.flexiprovider.api.keys.KeyFactory
              |
              +--de.flexiprovider.pqc.hbc.gmss.GMSSKeyFactory

public class GMSSKeyFactory
extends KeyFactory

This class transforms GMSS keys and GMSS key specifications into a form that can be used with the FlexiPQCProvider.

Author:
Sebastian Blume, Michael Schneider
See Also:
GMSSPrivateKey, GMSSPrivateKeySpec, GMSSPublicKey, GMSSPublicKeySpec

Field Summary
static java.lang.String OID
          The GMSS OID.
 
Constructor Summary
GMSSKeyFactory()
           
 
Method Summary
 PrivateKey generatePrivate(KeySpec keySpec)
          Converts, if possible, a key specification into a GMSSPrivateKey.
 PublicKey generatePublic(KeySpec keySpec)
          Converts, if possible, a key specification into a GMSSPublicKey.
 KeySpec getKeySpec(Key key, java.lang.Class spec)
          Converts a given key into a key specification, if possible.
 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 GMSS OID.
Constructor Detail

GMSSKeyFactory

public GMSSKeyFactory()
Method Detail

generatePublic

public PublicKey generatePublic(KeySpec keySpec)
                         throws InvalidKeySpecException
Converts, if possible, a key specification into a GMSSPublicKey. Currently the following key specs are supported: GMSSPublicKeySpec, X509EncodedKeySpec.

Overrides:
generatePublic in class KeyFactory
Parameters:
keySpec - the key specification
Returns:
A GMSS public key
Throws:
InvalidKeySpecException - if the KeySpec is not supported

generatePrivate

public PrivateKey generatePrivate(KeySpec keySpec)
                           throws InvalidKeySpecException
Converts, if possible, a key specification into a GMSSPrivateKey. Currently the following key specs are supported: GMSSPrivateKeySpec.

Overrides:
generatePrivate in class KeyFactory
Parameters:
keySpec - the key specification
Returns:
The GMSS private key
Throws:
InvalidKeySpecException - if the KeySpec is not supported
See Also:
GMSSPrivateKey, GMSSPrivateKeySpec

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 specs are supported:

Overrides:
getKeySpec in class KeyFactory
Parameters:
key - the key
spec - the class of which type the returned class should be
Returns:
The specification of the GMSS key
Throws:
InvalidKeySpecException - if the specification is not supported
See Also:
GMSSPrivateKey, GMSSPrivateKeySpec, GMSSPublicKey, GMSSPublicKeySpec

translateKey

public Key translateKey(Key key)
                 throws InvalidKeyException
Translates a key into a form known by the FlexiProvider. Currently the following key types are supported: GMSSPrivateKey, GMSSPublicKey.

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