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

pack-priv Class ProvDH

extends AsymmetricAlgorithmProvider
Class Inheritance
Imports
java.io.IOException, java.security.InvalidAlgorithmParameterException, .InvalidKeyException, .Key, .KeyPair, .PrivateKey, .PublicKey, .SecureRandom, java.security.spec.AlgorithmParameterSpec, .InvalidKeySpecException, .InvalidParameterSpecException, .KeySpec, java.util.HashMap, .Map, javax.crypto.interfaces.DHPrivateKey, .DHPublicKey, javax.crypto.spec.DHParameterSpec, .DHPrivateKeySpec, .DHPublicKeySpec, org.bouncycastle.asn1.ASN1Encodable, .ASN1Encoding, org.bouncycastle.asn1.pkcs.DHParameter, .PKCSObjectIdentifiers, .PrivateKeyInfo, org.bouncycastle.asn1.x509.SubjectPublicKeyInfo, org.bouncycastle.asn1.x9.DomainParameters, .ValidationParams, .X9ObjectIdentifiers, org.bouncycastle.crypto.AgreementFactory, .Algorithm, .CryptoServicesRegistrar, .Parameters, org.bouncycastle.crypto.asymmetric.AsymmetricDHPrivateKey, .AsymmetricDHPublicKey, .AsymmetricKeyPair, .DHDomainParameters, .DHValidationParameters, org.bouncycastle.crypto.fips.FipsDH, .FipsKDF, .FipsUnapprovedOperationError, org.bouncycastle.jcajce.spec.DHDomainParameterSpec, .DHUParameterSpec, .MQVParameterSpec, .UserKeyingMaterialSpec

Nested and Inner Type Summary

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

Field Summary

Modifier and TypeField and Description
private static final ParametersCreator<T extends Parameters>
private static final AgreementFactory<T extends Parameters>
private static final AgreementFactory<T extends Parameters>
private static final AgreementFactory<T extends Parameters>
private static final Map<String, String>
private static final ParametersCreator<T extends Parameters>
private static final ParametersCreator<T extends Parameters>
private static final String
pack-priv static final PrivateKeyConverter<AsymmetricDHPrivateKey>
pack-priv static final PublicKeyConverter<AsymmetricDHPublicKey>

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
private void
private void
private void
private void
private void
private void
public void
Inherited from org.bouncycastle.jcajce.provider.AsymmetricAlgorithmProvider:
addKeyAgreementAlgorithmaddSignatureAlgorithmaddSignatureAlgorithmregisterOidregisterOidAlgorithmParameters

Field Detail

dhuParametersCreatorback to summary
private static final ParametersCreator<T extends Parameters> dhuParametersCreator
fipsDHFactoryback to summary
private static final AgreementFactory<T extends Parameters> fipsDHFactory
fipsDHUFactoryback to summary
private static final AgreementFactory<T extends Parameters> fipsDHUFactory
fipsMQVFactoryback to summary
private static final AgreementFactory<T extends Parameters> fipsMQVFactory
generalDhAttributesback to summary
private static final Map<String, String> generalDhAttributes
mqvParametersCreatorback to summary
private static final ParametersCreator<T extends Parameters> mqvParametersCreator
parametersCreatorback to summary
private static final ParametersCreator<T extends Parameters> parametersCreator
PREFIXback to summary
private static final String PREFIX
privateKeyConverterback to summary
pack-priv static final PrivateKeyConverter<AsymmetricDHPrivateKey> privateKeyConverter
publicKeyConverterback to summary
pack-priv static final PublicKeyConverter<AsymmetricDHPublicKey> publicKeyConverter

Constructor Detail

ProvDHback to summary
pack-priv ProvDH()

Method Detail

addConcatDHAlgorithmback to summary
private void addConcatDHAlgorithm(BouncyCastleFipsProvider provider, String digest, final FipsKDF.AgreementKDFPRF prf)
addConcatDHUAlgorithmback to summary
private void addConcatDHUAlgorithm(BouncyCastleFipsProvider provider, String digest, final FipsKDF.AgreementKDFPRF prf)
addConcatMQVAlgorithmback to summary
private void addConcatMQVAlgorithm(BouncyCastleFipsProvider provider, String digest, final FipsKDF.AgreementKDFPRF prf)
addX963DHAlgorithmback to summary
private void addX963DHAlgorithm(BouncyCastleFipsProvider provider, String digest, final FipsKDF.AgreementKDFPRF prf)
addX963DHUAlgorithmback to summary
private void addX963DHUAlgorithm(BouncyCastleFipsProvider provider, String digest, final FipsKDF.AgreementKDFPRF prf)
addX963MQVAlgorithmback to summary
private void addX963MQVAlgorithm(BouncyCastleFipsProvider provider, String digest, final FipsKDF.AgreementKDFPRF prf)
configureback to summary
public void configure(final BouncyCastleFipsProvider provider)

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

org.bouncycastle.jcajce.provider back to summary

pack-priv Class ProvDH.AlgorithmParametersSpi

extends DHAlgorithmParametersSpi
Class Inheritance

Field Summary

Inherited from org.bouncycastle.jcajce.provider.DHAlgorithmParametersSpi:
currentSpec

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
protected String
engineToString()

Implements abstract java.security.AlgorithmParametersSpi.engineToString.

Returns a formatted string describing the parameters.
protected byte[]
localGetEncoded()

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

Return the X.509 ASN.1 structure DHParameter.
protected void
Inherited from org.bouncycastle.jcajce.provider.DHAlgorithmParametersSpi:
engineInitlocalEngineGetParameterSpec

Constructor Detail

AlgorithmParametersSpiback to summary
pack-priv AlgorithmParametersSpi(String algorithm)

Method Detail

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.

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

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

Return the X.509 ASN.1 structure DHParameter.

 DHParameter ::= SEQUENCE {
                  prime INTEGER, -- p
                  base INTEGER, -- g}
localInitback to summary
protected void localInit(byte[] params) throws IOException

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

org.bouncycastle.jcajce.provider back to summary

pack-priv Class ProvDH.KeyFactorySpi

extends BaseKeyFactory
Class Inheritance

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
)

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

Constructor Detail

KeyFactorySpiback to summary
public KeyFactorySpi()

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 info) throws IOException

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

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

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

org.bouncycastle.jcajce.provider back to summary

pack-priv Class ProvDH.KeyPairGeneratorSpi

extends KeyPairGenerator
Class Inheritance

Field Summary

Modifier and TypeField and Description
private FipsDH.KeyPairGenerator
private final BouncyCastleFipsProvider
private boolean
private FipsDH.KeyGenParameters
private SecureRandom
private int

Constructor Summary

AccessConstructor and Description
public

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

engineback to summary
private FipsDH.KeyPairGenerator engine
fipsProviderback to summary
private final BouncyCastleFipsProvider fipsProvider
initialisedback to summary
private boolean initialised
paramback to summary
private FipsDH.KeyGenParameters param
randomback to summary
private SecureRandom random
strengthback to summary
private int strength

Constructor Detail

KeyPairGeneratorSpiback to summary
public KeyPairGeneratorSpi(BouncyCastleFipsProvider fipsProvider)

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.
org.bouncycastle.jcajce.provider back to summary

pack-priv Class ProvDH.MQVAlgorithmParametersSpi

extends DHAlgorithmParametersSpi
Class Inheritance

Field Summary

Inherited from org.bouncycastle.jcajce.provider.DHAlgorithmParametersSpi:
currentSpec

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
protected void
engineInit(AlgorithmParameterSpec
the parameter specification.
paramSpec
)

Overrides org.bouncycastle.jcajce.provider.DHAlgorithmParametersSpi.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 byte[]
protected void
Inherited from org.bouncycastle.jcajce.provider.DHAlgorithmParametersSpi:
localEngineGetParameterSpec

Constructor Detail

MQVAlgorithmParametersSpiback to summary
pack-priv MQVAlgorithmParametersSpi()

Method Detail

engineInitback to summary
protected void engineInit(AlgorithmParameterSpec paramSpec) throws InvalidParameterSpecException

Overrides org.bouncycastle.jcajce.provider.DHAlgorithmParametersSpi.engineInit.

Doc from java.security.AlgorithmParametersSpi.engineInit.

Initializes this parameters object using the parameters specified in paramSpec.

Parameters
paramSpec:AlgorithmParameterSpec

the parameter specification.

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.

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

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

Return DomainParameters from X9

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

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