Top Constructors Methods
org.bouncycastle.jcajce.provider.asymmetric.util

public abstract Class BaseKeyFactorySpi

extends KeyFactorySpi
implements AsymmetricKeyInfoConverter
Class Inheritance
All Implemented Interfaces
org.bouncycastle.jcajce.provider.util.AsymmetricKeyInfoConverter
Known Direct Subclasses
org.bouncycastle.jcajce.provider.asymmetric.EXTERNAL.KeyFactory, org.bouncycastle.jcajce.provider.asymmetric.COMPOSITE.KeyFactory, org.bouncycastle.jcajce.provider.asymmetric.compositesignatures.KeyFactorySpi, org.bouncycastle.jcajce.provider.asymmetric.dh.KeyFactorySpi, org.bouncycastle.jcajce.provider.asymmetric.dsa.KeyFactorySpi, org.bouncycastle.jcajce.provider.asymmetric.dstu.KeyFactorySpi, org.bouncycastle.jcajce.provider.asymmetric.ec.KeyFactorySpi, org.bouncycastle.jcajce.provider.asymmetric.ecgost.KeyFactorySpi, org.bouncycastle.jcajce.provider.asymmetric.ecgost12.KeyFactorySpi, org.bouncycastle.jcajce.provider.asymmetric.edec.KeyFactorySpi, org.bouncycastle.jcajce.provider.asymmetric.elgamal.KeyFactorySpi, org.bouncycastle.jcajce.provider.asymmetric.gost.KeyFactorySpi, org.bouncycastle.jcajce.provider.asymmetric.rsa.KeyFactorySpi
Imports
java.security.Key, .PrivateKey, .PublicKey, java.security.spec.InvalidKeySpecException, .KeySpec, .PKCS8EncodedKeySpec, .X509EncodedKeySpec, org.bouncycastle.asn1.pkcs.PrivateKeyInfo, org.bouncycastle.asn1.x509.SubjectPublicKeyInfo, org.bouncycastle.jcajce.provider.util.AsymmetricKeyInfoConverter

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected PrivateKey
engineGeneratePrivate(KeySpec
the specification (key material) of the private key.
keySpec
)

Implements abstract java.security.KeyFactorySpi.engineGeneratePrivate.

Generates a private key object from the provided key specification (key material).

protected PublicKey
engineGeneratePublic(KeySpec
the specification (key material) of the public key.
keySpec
)

Implements abstract java.security.KeyFactorySpi.engineGeneratePublic.

Generates a public key object from the provided key specification (key material).

protected KeySpec
engineGetKeySpec(Key
the key.
key
,
Class<T>
the specification class in which the key material should be returned.
spec
)

Implements abstract java.security.KeyFactorySpi.engineGetKeySpec.

Returns a specification (key material) of the given key object.

Inherited from java.security.KeyFactorySpi:
engineTranslateKey

Constructor Detail

BaseKeyFactorySpiback to summary
public BaseKeyFactorySpi()

Method Detail

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

Implements abstract java.security.KeyFactorySpi.engineGeneratePrivate.

Doc from java.security.KeyFactorySpi.engineGeneratePrivate.

Generates a private key object from the provided key specification (key material).

Parameters
keySpec:KeySpec

the specification (key material) of the private key.

Returns:PrivateKey

the private key.

Exceptions
InvalidKeySpecException:
if the given key specification is inappropriate for this key factory to produce a private key.
engineGeneratePublicback to summary
protected PublicKey engineGeneratePublic(KeySpec keySpec) throws InvalidKeySpecException

Implements abstract java.security.KeyFactorySpi.engineGeneratePublic.

Doc from java.security.KeyFactorySpi.engineGeneratePublic.

Generates a public key object from the provided key specification (key material).

Parameters
keySpec:KeySpec

the specification (key material) of the public key.

Returns:PublicKey

the public key.

Exceptions
InvalidKeySpecException:
if the given key specification is inappropriate for this key factory to produce a public key.
engineGetKeySpecback to summary
protected KeySpec engineGetKeySpec(Key key, Class<T> spec) 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.

spec: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).