Top Inners Fields Constructors Methods
org.bouncycastle.jcajce.provider

pack-priv Class ProvEC

extends AsymmetricAlgorithmProvider
Class Inheritance
Imports
java.io.IOException, java.security.InvalidAlgorithmParameterException, .InvalidKeyException, .InvalidParameterException, .Key, .KeyPair, .PrivateKey, .PublicKey, .SecureRandom, java.security.interfaces.ECPrivateKey, .ECPublicKey, java.security.spec.AlgorithmParameterSpec, .ECGenParameterSpec, .ECParameterSpec, .ECPrivateKeySpec, .ECPublicKeySpec, .InvalidKeySpecException, .InvalidParameterSpecException, .KeySpec, java.util.HashMap, .Hashtable, .Map, org.bouncycastle.asn1.ASN1ObjectIdentifier, .DERNull, org.bouncycastle.asn1.nist.NISTObjectIdentifiers, org.bouncycastle.asn1.pkcs.PrivateKeyInfo, org.bouncycastle.asn1.sec.SECObjectIdentifiers, org.bouncycastle.asn1.teletrust.TeleTrusTObjectIdentifiers, org.bouncycastle.asn1.x509.SubjectPublicKeyInfo, org.bouncycastle.asn1.x9.X962Parameters, .X9ECParameters, .X9ObjectIdentifiers, org.bouncycastle.crypto.AgreementFactory, .Algorithm, .AsymmetricKeyPairGenerator, .CryptoServicesRegistrar, .Parameters, .SignatureOperatorFactory, org.bouncycastle.crypto.asymmetric.AsymmetricECPrivateKey, .AsymmetricECPublicKey, .AsymmetricKeyPair, .ECDomainParameters, .ECDomainParametersID, .ECDomainParametersIndex, .ECImplicitDomainParameters, .NamedECDomainParameters, org.bouncycastle.crypto.fips.FipsAlgorithm, .FipsEC, .FipsKDF, .FipsSHS, org.bouncycastle.crypto.general.EC, .SecureHash, org.bouncycastle.jcajce.spec.DHUParameterSpec, .ECDomainParameterSpec, .MQVParameterSpec, .UserKeyingMaterialSpec, org.bouncycastle.util.Integers, .Properties

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static class
pack-priv static class
pack-priv static class

Field Summary

Modifier and TypeField and Description
private static final AgreementFactory<T extends Parameters>
private static final AgreementFactory<T extends Parameters>
private static final SignatureOperatorFactory<T extends Parameters>
private static final AgreementFactory<T extends Parameters>
private static SignatureOperatorFactory<T extends Parameters>
private static final Map<String, String>
private static final String
private static final PrivateKeyConverter<AsymmetricECPrivateKey>
private static final PublicKeyConverter<AsymmetricECPublicKey>

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
private void
addCDHAlgorithm(BouncyCastleFipsProvider provider, String digestName, final FipsKDF.AgreementKDFPRF prf, ASN1ObjectIdentifier algOid, AsymmetricKeyInfoConverter converter, final ParametersCreator<T extends Parameters> cdhParametersCreator)

private void
addCDHUAlgorithm(BouncyCastleFipsProvider provider, String digestName, final FipsKDF.AgreementKDFPRF prf, final ParametersCreator<T extends Parameters> cdhParametersCreator)

private void
addConcatCDHAlgorithm(BouncyCastleFipsProvider provider, String digestName, final FipsKDF.AgreementKDFPRF prf, final ParametersCreator<T extends Parameters> cdhParametersCreator)

private void
addConcatCDHUAlgorithm(BouncyCastleFipsProvider provider, String digestName, final FipsKDF.AgreementKDFPRF prf, final ParametersCreator<T extends Parameters> cdhParametersCreator)

private void
addConcatMQVAlgorithm(BouncyCastleFipsProvider provider, String digestName, final FipsKDF.AgreementKDFPRF prf, final ParametersCreator<T extends Parameters> mqvParametersCreator)

private void
addDHAlgorithm(BouncyCastleFipsProvider provider, String digestName, final FipsKDF.AgreementKDFPRF prf, ASN1ObjectIdentifier algOid, AsymmetricKeyInfoConverter converter, final ParametersCreator<T extends Parameters> dhParametersCreator)

private void
addMQVAlgorithm(BouncyCastleFipsProvider provider, String digestName, final FipsKDF.AgreementKDFPRF prf, ASN1ObjectIdentifier algOid, AsymmetricKeyInfoConverter converter, final ParametersCreator<T extends Parameters> mqvParametersCreator)

public void
private static ECDomainParameters
private static SignatureOperatorFactory<T extends Parameters>
private static NamedECDomainParameters
Inherited from org.bouncycastle.jcajce.provider.AsymmetricAlgorithmProvider:
addKeyAgreementAlgorithmaddSignatureAlgorithmaddSignatureAlgorithmregisterOidregisterOidAlgorithmParameters

Field Detail

fipsDHFactoryback to summary
private static final AgreementFactory<T extends Parameters> fipsDHFactory
fipsDHUFactoryback to summary
private static final AgreementFactory<T extends Parameters> fipsDHUFactory
fipsDsaFactoryback to summary
private static final SignatureOperatorFactory<T extends Parameters> fipsDsaFactory
fipsMQVFactoryback to summary
private static final AgreementFactory<T extends Parameters> fipsMQVFactory
genDsaFactoryback to summary
private static SignatureOperatorFactory<T extends Parameters> genDsaFactory
generalEcAttributesback to summary
private static final Map<String, String> generalEcAttributes
PREFIXback to summary
private static final String PREFIX
privateKeyConverterback to summary
private static final PrivateKeyConverter<AsymmetricECPrivateKey> privateKeyConverter
publicKeyConverterback to summary
private static final PublicKeyConverter<AsymmetricECPublicKey> publicKeyConverter

Constructor Detail

ProvECback to summary
pack-priv ProvEC()

Method Detail

addCDHAlgorithmback to summary
private void addCDHAlgorithm(BouncyCastleFipsProvider provider, String digestName, final FipsKDF.AgreementKDFPRF prf, ASN1ObjectIdentifier algOid, AsymmetricKeyInfoConverter converter, final ParametersCreator<T extends Parameters> cdhParametersCreator)
addCDHUAlgorithmback to summary
private void addCDHUAlgorithm(BouncyCastleFipsProvider provider, String digestName, final FipsKDF.AgreementKDFPRF prf, final ParametersCreator<T extends Parameters> cdhParametersCreator)
addConcatCDHAlgorithmback to summary
private void addConcatCDHAlgorithm(BouncyCastleFipsProvider provider, String digestName, final FipsKDF.AgreementKDFPRF prf, final ParametersCreator<T extends Parameters> cdhParametersCreator)
addConcatCDHUAlgorithmback to summary
private void addConcatCDHUAlgorithm(BouncyCastleFipsProvider provider, String digestName, final FipsKDF.AgreementKDFPRF prf, final ParametersCreator<T extends Parameters> cdhParametersCreator)
addConcatMQVAlgorithmback to summary
private void addConcatMQVAlgorithm(BouncyCastleFipsProvider provider, String digestName, final FipsKDF.AgreementKDFPRF prf, final ParametersCreator<T extends Parameters> mqvParametersCreator)
addDHAlgorithmback to summary
private void addDHAlgorithm(BouncyCastleFipsProvider provider, String digestName, final FipsKDF.AgreementKDFPRF prf, ASN1ObjectIdentifier algOid, AsymmetricKeyInfoConverter converter, final ParametersCreator<T extends Parameters> dhParametersCreator)
addMQVAlgorithmback to summary
private void addMQVAlgorithm(BouncyCastleFipsProvider provider, String digestName, final FipsKDF.AgreementKDFPRF prf, ASN1ObjectIdentifier algOid, AsymmetricKeyInfoConverter converter, final ParametersCreator<T extends Parameters> mqvParametersCreator)
configureback to summary
public void configure(final BouncyCastleFipsProvider provider)

Implements abstract org.bouncycastle.jcajce.provider.AlgorithmProvider.configure.

getDomainParametersFromGenSpecback to summary
private static ECDomainParameters getDomainParametersFromGenSpec(ECGenParameterSpec genSpec)
getGeneralDSAFactoryback to summary
private static SignatureOperatorFactory<T extends Parameters> getGeneralDSAFactory()
getNamedECDomainParametersFromNameback to summary
private static NamedECDomainParameters getNamedECDomainParametersFromName(final String curveName)
org.bouncycastle.jcajce.provider back to summary

pack-priv Class ProvEC.ECAlgParams

extends X509AlgorithmParameters
Class Inheritance

Field Summary

Modifier and TypeField and Description
private ECDomainParameters

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
private static ECDomainParameters
decodeCurveParameters(byte[] encoding)

protected void
engineInit(AlgorithmParameterSpec
the parameter specification.
algorithmParameterSpec
)

Implements abstract java.security.AlgorithmParametersSpi.engineInit.

Initializes this parameters object using the parameters specified in paramSpec.
protected String
engineToString()

Implements abstract java.security.AlgorithmParametersSpi.engineToString.

Returns a formatted string describing the parameters.
protected AlgorithmParameterSpec
protected byte[]
protected void
Inherited from org.bouncycastle.jcajce.provider.X509AlgorithmParameters:
engineGetEncodedengineInit

Field Detail

domainParametersback to summary
private ECDomainParameters domainParameters

Constructor Detail

ECAlgParamsback to summary
pack-priv ECAlgParams()

Method Detail

decodeCurveParametersback to summary
private static ECDomainParameters decodeCurveParameters(byte[] encoding) throws IOException
engineInitback to summary
protected void engineInit(AlgorithmParameterSpec algorithmParameterSpec) throws InvalidParameterSpecException

Implements abstract java.security.AlgorithmParametersSpi.engineInit.

Doc from java.security.AlgorithmParametersSpi.engineInit.

Initializes this parameters object using the parameters specified in paramSpec.

Parameters
algorithmParameterSpec:AlgorithmParameterSpec

the parameter specification.

Annotations
@Override
Exceptions
InvalidParameterSpecException:
if the given parameter specification is inappropriate for the initialization of this parameter object.
engineToStringback to summary
protected String engineToString()

Implements abstract java.security.AlgorithmParametersSpi.engineToString.

Doc from java.security.AlgorithmParametersSpi.engineToString.

Returns a formatted string describing the parameters.

Returns:String

a formatted string describing the parameters.

localEngineGetParameterSpecback to summary
protected AlgorithmParameterSpec localEngineGetParameterSpec(Class<T> paramSpec) throws InvalidParameterSpecException

Implements abstract org.bouncycastle.jcajce.provider.BaseAlgorithmParameters.localEngineGetParameterSpec.

Annotations
@Override
localGetEncodedback to summary
protected byte[] localGetEncoded() throws IOException

Implements abstract org.bouncycastle.jcajce.provider.BaseAlgorithmParameters.localGetEncoded.

localInitback to summary
protected void localInit(byte[] encoding) throws IOException

Implements abstract org.bouncycastle.jcajce.provider.BaseAlgorithmParameters.localInit.

org.bouncycastle.jcajce.provider back to summary

pack-priv Class ProvEC.ECKeyFactory

extends BaseKeyFactory
implements AsymmetricKeyInfoConverter
Class Inheritance
All Implemented Interfaces
org.bouncycastle.jcajce.provider.AsymmetricKeyInfoConverter

Field Summary

Modifier and TypeField and Description
private final Algorithm

Constructor Summary

AccessConstructor and Description
pack-priv
pack-priv

Method Summary

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

Overrides org.bouncycastle.jcajce.provider.BaseKeyFactory.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
)

Overrides org.bouncycastle.jcajce.provider.BaseKeyFactory.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
)

Overrides org.bouncycastle.jcajce.provider.BaseKeyFactory.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

Field Detail

algorithmback to summary
private final Algorithm algorithm

Constructor Detail

ECKeyFactoryback to summary
pack-priv ECKeyFactory(Algorithm algorithm)
ECKeyFactoryback to summary
pack-priv ECKeyFactory(Parameters parameters)

Method Detail

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

Overrides org.bouncycastle.jcajce.provider.BaseKeyFactory.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

Overrides org.bouncycastle.jcajce.provider.BaseKeyFactory.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

Overrides org.bouncycastle.jcajce.provider.BaseKeyFactory.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).
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 keyInfo) throws IOException

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

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

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

org.bouncycastle.jcajce.provider back to summary

pack-priv Class ProvEC.ECKeyPairGenerator

extends KeyPairGenerator
Class Inheritance

Field Summary

Modifier and TypeField and Description
private final Algorithm
private static Hashtable<K, V>
private AsymmetricKeyPairGenerator<T extends Parameters, P extends AsymmetricPublicKey, S extends AsymmetricPrivateKey>
private final BouncyCastleFipsProvider
private boolean
private final Parameters
private int

Constructor Summary

AccessConstructor and Description
public
public
public
ECKeyPairGenerator(BouncyCastleFipsProvider fipsProvider, Algorithm algorithmType, Parameters parameters)

Method Summary

Modifier and TypeMethod and Description
public KeyPair
public void
initialize(int
the keysize. This is an algorithm-specific metric, such as modulus length, specified in number of bits.
strength
)

Overrides java.security.KeyPairGenerator.initialize.

Initializes the key pair generator for a certain keysize using a default parameter set and the SecureRandom implementation of the highest-priority installed provider as the source of randomness.
public void
initialize(int
the keysize. This is an algorithm-specific metric, such as modulus length, specified in number of bits.
strength
,
SecureRandom
the source of randomness.
random
)

Overrides java.security.KeyPairGenerator.initialize.

Initializes the key pair generator for a certain keysize with the given source of randomness (and a default parameter set).
public void
initialize(AlgorithmParameterSpec
the parameter set used to generate the keys.
params
)

Overrides java.security.KeyPairGenerator.initialize.

Initializes the key pair generator using the specified parameter set and the SecureRandom implementation of the highest-priority installed provider as the source of randomness.
public void
initialize(AlgorithmParameterSpec
the parameter set used to generate the keys.
params
,
SecureRandom
the source of randomness.
random
)

Overrides java.security.KeyPairGenerator.initialize.

Initializes the key pair generator with the given parameter set and source of randomness.
Inherited from java.security.KeyPairGenerator:
genKeyPairgetAlgorithmgetInstancegetInstancegetInstancegetProvider

Field Detail

algorithmTypeback to summary
private final Algorithm algorithmType
ecParametersback to summary
private static Hashtable<K, V> ecParameters
engineback to summary
private AsymmetricKeyPairGenerator<T extends Parameters, P extends AsymmetricPublicKey, S extends AsymmetricPrivateKey> engine
fipsProviderback to summary
private final BouncyCastleFipsProvider fipsProvider
initialisedback to summary
private boolean initialised
parametersback to summary
private final Parameters parameters
strengthback to summary
private int strength

Constructor Detail

ECKeyPairGeneratorback to summary
public ECKeyPairGenerator(BouncyCastleFipsProvider fipsProvider, Algorithm algorithmType)
ECKeyPairGeneratorback to summary
public ECKeyPairGenerator(BouncyCastleFipsProvider fipsProvider, Parameters parameters)
ECKeyPairGeneratorback to summary
public ECKeyPairGenerator(BouncyCastleFipsProvider fipsProvider, Algorithm algorithmType, Parameters parameters)

Method Detail

generateKeyPairback to summary
public KeyPair generateKeyPair()

Overrides java.security.KeyPairGenerator.generateKeyPair.

Doc from java.security.KeyPairGenerator.generateKeyPair.

Generates a key pair.

If this KeyPairGenerator has not been initialized explicitly, provider-specific defaults will be used for the size and other (algorithm-specific) values of the generated keys.

This will generate a new key pair every time it is called.

This method is functionally equivalent to genKeyPair.

Returns:KeyPair

the generated key pair

initializeback to summary
public void initialize(int strength)

Overrides java.security.KeyPairGenerator.initialize.

Doc from java.security.KeyPairGenerator.initialize.

Initializes the key pair generator for a certain keysize using a default parameter set and the SecureRandom implementation of the highest-priority installed provider as the source of randomness. (If none of the installed providers supply an implementation of SecureRandom, a system-provided source of randomness is used.)

Parameters
strength:int

the keysize. This is an algorithm-specific metric, such as modulus length, specified in number of bits.

initializeback to summary
public void initialize(int strength, SecureRandom random)

Overrides java.security.KeyPairGenerator.initialize.

Doc from java.security.KeyPairGenerator.initialize.

Initializes the key pair generator for a certain keysize with the given source of randomness (and a default parameter set).

Parameters
strength:int

the keysize. This is an algorithm-specific metric, such as modulus length, specified in number of bits.

random:SecureRandom

the source of randomness.

initializeback to summary
public void initialize(AlgorithmParameterSpec params) throws InvalidAlgorithmParameterException

Overrides java.security.KeyPairGenerator.initialize.

Doc from java.security.KeyPairGenerator.initialize.

Initializes the key pair generator using the specified parameter set and the SecureRandom implementation of the highest-priority installed provider as the source of randomness. (If none of the installed providers supply an implementation of SecureRandom, a system-provided source of randomness is used.)

This concrete method has been added to this previously-defined abstract class. This method calls the KeyPairGeneratorSpi initialize method, passing it params and a source of randomness (obtained from the highest-priority installed provider or system-provided if none of the installed providers supply one). That initialize method always throws an UnsupportedOperationException if it is not overridden by the provider.

Parameters
params:AlgorithmParameterSpec

the parameter set used to generate the keys.

Exceptions
InvalidAlgorithmParameterException:
if the given parameters are inappropriate for this key pair generator.
initializeback to summary
public void initialize(AlgorithmParameterSpec params, SecureRandom random) throws InvalidAlgorithmParameterException

Overrides java.security.KeyPairGenerator.initialize.

Doc from java.security.KeyPairGenerator.initialize.

Initializes the key pair generator with the given parameter set and source of randomness.

This concrete method has been added to this previously-defined abstract class. This method calls the KeyPairGeneratorSpi initialize method, passing it params and random. That initialize method always throws an UnsupportedOperationException if it is not overridden by the provider.

Parameters
params:AlgorithmParameterSpec

the parameter set used to generate the keys.

random:SecureRandom

the source of randomness.

Exceptions
InvalidAlgorithmParameterException:
if the given parameters are inappropriate for this key pair generator.