Top Description Fields Constructors Methods
org.bouncycastle.pqc.jcajce.provider.mceliece

public Class McElieceCCA2KeyFactorySpi

extends KeyFactorySpi
implements AsymmetricKeyInfoConverter
Class Inheritance
All Implemented Interfaces
org.bouncycastle.jcajce.provider.util.AsymmetricKeyInfoConverter
Imports
java.io.IOException, java.security.InvalidKeyException, .Key, .KeyFactorySpi, .PrivateKey, .PublicKey, java.security.spec.InvalidKeySpecException, .KeySpec, .PKCS8EncodedKeySpec, .X509EncodedKeySpec, org.bouncycastle.asn1.ASN1Primitive, org.bouncycastle.asn1.pkcs.PrivateKeyInfo, org.bouncycastle.asn1.x509.SubjectPublicKeyInfo, org.bouncycastle.jcajce.provider.util.AsymmetricKeyInfoConverter, org.bouncycastle.pqc.asn1.McElieceCCA2PrivateKey, .McElieceCCA2PublicKey, .PQCObjectIdentifiers, org.bouncycastle.pqc.legacy.crypto.mceliece.McElieceCCA2PrivateKeyParameters, .McElieceCCA2PublicKeyParameters

This class is used to translate between McEliece CCA2 keys and key specifications.
See Also
BCMcElieceCCA2PrivateKey, BCMcElieceCCA2PublicKey

Field Summary

Modifier and TypeField and Description
public static final String
OID

The OID of the algorithm.

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected PrivateKey

Returns:

the McEliece CCA2 private key
engineGeneratePrivate
(KeySpec
the key specification
keySpec
)

Implements abstract java.security.KeyFactorySpi.engineGeneratePrivate.

Converts, if possible, a key specification into a BCMcElieceCCA2PrivateKey.
protected PublicKey

Returns:

the McEliece CCA2 public key
engineGeneratePublic
(KeySpec
the key specification
keySpec
)

Implements abstract java.security.KeyFactorySpi.engineGeneratePublic.

Converts, if possible, a key specification into a BCMcElieceCCA2PublicKey.
protected KeySpec
engineGetKeySpec(Key
the key.
key
,
Class<T>
the specification class in which the key material should be returned.
tClass
)

Implements abstract java.security.KeyFactorySpi.engineGetKeySpec.

Returns a specification (key material) of the given key object.
protected Key
engineTranslateKey(Key
the key whose provider is unknown or untrusted.
key
)

Implements abstract java.security.KeyFactorySpi.engineTranslateKey.

Translates a key object, whose provider may be unknown or potentially untrusted, into a corresponding key object of this key factory.
public PrivateKey
public PublicKey
public KeySpec

Returns:

the specification of the McEliece CCA2 key
getKeySpec
(Key
the key
key
,
Class<T>
the key specification
keySpec
)

Converts, if possible, a given key into a key specification.

public Key

Returns:

a key of a known key type
translateKey
(Key
the key
key
)

Translates a key into a form known by the FlexiProvider.

Field Detail

OIDback to summary
public static final String OID

The OID of the algorithm.

Constructor Detail

McElieceCCA2KeyFactorySpiback to summary
public McElieceCCA2KeyFactorySpi()

Method Detail

engineGeneratePrivateback to summary
protected PrivateKey engineGeneratePrivate(KeySpec keySpec) throws InvalidKeySpecException

Implements abstract java.security.KeyFactorySpi.engineGeneratePrivate.

Converts, if possible, a key specification into a BCMcElieceCCA2PrivateKey. Currently, the following key specifications are supported: PKCS8EncodedKeySpec.

Parameters
keySpec:KeySpec

the key specification

Returns:PrivateKey

the McEliece CCA2 private key

Exceptions
InvalidKeySpecException:
if the KeySpec is not supported.
engineGeneratePublicback to summary
protected PublicKey engineGeneratePublic(KeySpec keySpec) throws InvalidKeySpecException

Implements abstract java.security.KeyFactorySpi.engineGeneratePublic.

Converts, if possible, a key specification into a BCMcElieceCCA2PublicKey. Currently, the following key specifications are supported: X509EncodedKeySpec.

Parameters
keySpec:KeySpec

the key specification

Returns:PublicKey

the McEliece CCA2 public key

Exceptions
InvalidKeySpecException:
if the key specification is not supported.
engineGetKeySpecback to summary
protected KeySpec engineGetKeySpec(Key key, Class<T> tClass) throws InvalidKeySpecException

Implements abstract java.security.KeyFactorySpi.engineGetKeySpec.

Doc from java.security.KeyFactorySpi.engineGetKeySpec.

Returns a specification (key material) of the given key object. keySpec identifies the specification class in which the key material should be returned. It could, for example, be DSAPublicKeySpec.class, to indicate that the key material should be returned in an instance of the DSAPublicKeySpec class.

Parameters
key:Key

the key.

tClass:Class<T>

the specification class in which the key material should be returned.

Returns:KeySpec

the underlying key specification (key material) in an instance of the requested specification class.

Exceptions
InvalidKeySpecException:
if the requested key specification is inappropriate for the given key, or the given key cannot be dealt with (e.g., the given key has an unrecognized format).
engineTranslateKeyback to summary
protected Key engineTranslateKey(Key key) throws InvalidKeyException

Implements abstract java.security.KeyFactorySpi.engineTranslateKey.

Doc from java.security.KeyFactorySpi.engineTranslateKey.

Translates a key object, whose provider may be unknown or potentially untrusted, into a corresponding key object of this key factory.

Parameters
key:Key

the key whose provider is unknown or untrusted.

Returns:Key

the translated key.

Exceptions
InvalidKeyException:
if the given key cannot be processed by this key factory.
generatePrivateback to summary
public PrivateKey generatePrivate(PrivateKeyInfo pki) throws IOException

Implements org.bouncycastle.jcajce.provider.util.AsymmetricKeyInfoConverter.generatePrivate.

generatePublicback to summary
public PublicKey generatePublic(SubjectPublicKeyInfo pki) throws IOException

Implements org.bouncycastle.jcajce.provider.util.AsymmetricKeyInfoConverter.generatePublic.

getKeySpecback to summary
public KeySpec getKeySpec(Key key, Class<T> keySpec) throws InvalidKeySpecException

Converts, if possible, a given key into a key specification. Currently, the following key specifications are supported:

Parameters
key:Key

the key

keySpec:Class<T>

the key specification

Returns:KeySpec

the specification of the McEliece CCA2 key

Exceptions
InvalidKeySpecException:
if the key type or the key specification is not supported.
See Also
BCMcElieceCCA2PrivateKey, BCMcElieceCCA2PublicKey
translateKeyback to summary
public Key translateKey(Key key) throws InvalidKeyException

Translates a key into a form known by the FlexiProvider. Currently, only the following "source" keys are supported: BCMcElieceCCA2PrivateKey, BCMcElieceCCA2PublicKey.

Parameters
key:Key

the key

Returns:Key

a key of a known key type

Exceptions
InvalidKeyException:
if the key type is not supported.