de.flexiprovider.pqc.hbc.cmss
Class CMSSKeyFactory

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

public class CMSSKeyFactory
extends KeyFactory

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

Author:
Elena Klintsevich
See Also:
de.flexiprovider.pqc.hbc.cmss2.CMSSPrivateKey, de.flexiprovider.pqc.hbc.cmss2.CMSSPrivateKeySpec, de.flexiprovider.pqc.hbc.cmss2.CMSSPublicKey, de.flexiprovider.pqc.hbc.cmss2.CMSSPublicKeySpec, KeyFactory

Field Summary
static java.lang.String OID
          The OID of CMSS2
 
Constructor Summary
CMSSKeyFactory()
           
 
Method Summary
 PrivateKey generatePrivate(KeySpec keySpec)
          Converts, if possible, a key specification into a CMSSPrivateKey.
 PublicKey generatePublic(KeySpec keySpec)
          Converts, if possible, a key specification into a CMSSPublicKey.
 KeySpec getKeySpec(Key key, java.lang.Class keySpec)
          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 OID of CMSS2
Constructor Detail

CMSSKeyFactory

public CMSSKeyFactory()
Method Detail

generatePublic

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

generatePrivate

public final PrivateKey generatePrivate(KeySpec keySpec)
                                 throws InvalidKeySpecException
Converts, if possible, a key specification into a CMSSPrivateKey. Currently the following key specs are supported: CMSSPrivateKeySpec.
Overrides:
generatePrivate in class KeyFactory
Parameters:
keySpec - - the key specification
Returns:
a CMSS2 private key
Throws:
InvalidKeySpecException - if the KeySpec is not supported.
See Also:
de.flexiprovider.pqc.hbc.cmss2.CMSSPrivateKey, de.flexiprovider.pqc.hbc.cmss2.CMSSPrivateKeySpec

getKeySpec

public final KeySpec getKeySpec(Key key,
                                java.lang.Class keySpec)
                         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
keySpec - the key specification
Returns:
the specification of the CMSS2 key
Throws:
InvalidKeySpecException - if the key type or key specification is not supported.
See Also:
de.flexiprovider.pqc.hbc.cmss2.CMSSPrivateKey, de.flexiprovider.pqc.hbc.cmss2.CMSSPrivateKeySpec, de.flexiprovider.pqc.hbc.cmss2.CMSSPublicKey, de.flexiprovider.pqc.hbc.cmss2.CMSSPublicKeySpec

translateKey

public final Key translateKey(Key key)
                       throws InvalidKeyException
Translates a key into a form known by the FlexiProvider. Currently the following key types are supported: CMSSPrivateKey, CMSSPublicKey.
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.