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

pack-priv Class ProvElgamal

extends AsymmetricAlgorithmProvider
Class Inheritance
Imports
java.io.IOException, java.security.InvalidAlgorithmParameterException, .InvalidKeyException, .Key, .KeyPair, .PrivateKey, .PublicKey, .SecureRandom, java.security.spec.AlgorithmParameterSpec, .InvalidKeySpecException, .KeySpec, .MGF1ParameterSpec, java.util.HashMap, .Map, javax.crypto.interfaces.DHPrivateKey, .DHPublicKey, javax.crypto.spec.DHParameterSpec, .DHPrivateKeySpec, .DHPublicKeySpec, .OAEPParameterSpec, .PSource, org.bouncycastle.asn1.ASN1Encoding, org.bouncycastle.asn1.oiw.ElGamalParameter, .OIWObjectIdentifiers, org.bouncycastle.asn1.pkcs.PrivateKeyInfo, org.bouncycastle.asn1.x509.SubjectPublicKeyInfo, org.bouncycastle.crypto.CryptoServicesRegistrar, .DigestAlgorithm, .Parameters, org.bouncycastle.crypto.asymmetric.AsymmetricDHPrivateKey, .AsymmetricDHPublicKey, .AsymmetricKeyPair, .DHDomainParameters, org.bouncycastle.crypto.fips.FipsDH, org.bouncycastle.crypto.general.ElGamal, org.bouncycastle.jcajce.spec.DHDomainParameterSpec

Elgamal cipher support (yes, that's actually the correct spelling...)

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 Map<String, String>
private static final String

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

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

Field Detail

generalDhAttributesback to summary
private static final Map<String, String> generalDhAttributes
PREFIXback to summary
private static final String PREFIX

Constructor Detail

ProvElgamalback to summary
pack-priv ProvElgamal()

Method Detail

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 ProvElgamal.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 ElGamalParameter.
protected void
Inherited from org.bouncycastle.jcajce.provider.DHAlgorithmParametersSpi:
engineInitlocalEngineGetParameterSpec

Constructor Detail

AlgorithmParametersSpiback to summary
pack-priv AlgorithmParametersSpi()

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 ElGamalParameter.

 ElGamalParameter ::= 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 ProvElgamal.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 ProvElgamal.KeyPairGeneratorSpi

extends KeyPairGenerator
Class Inheritance

Field Summary

Modifier and TypeField and Description
pack-priv ElGamal.KeyPairGenerator
pack-priv boolean
pack-priv ElGamal.KeyGenParameters
private final BouncyCastleFipsProvider
pack-priv SecureRandom
pack-priv 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
pack-priv ElGamal.KeyPairGenerator engine
initialisedback to summary
pack-priv boolean initialised
paramback to summary
pack-priv ElGamal.KeyGenParameters param
providerback to summary
private final BouncyCastleFipsProvider provider

Hides java.security.KeyPairGenerator.provider.

randomback to summary
pack-priv SecureRandom random
strengthback to summary
pack-priv int strength

Constructor Detail

KeyPairGeneratorSpiback to summary
public KeyPairGeneratorSpi(BouncyCastleFipsProvider provider)

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.