Top Description Inners Fields Constructors Methods
org.conscrypt

public abstract Class KeyGeneratorImpl

extends KeyGeneratorSpi
Class Inheritance
Known Direct Subclasses
org.conscrypt.KeyGeneratorImpl.HmacMD5, org.conscrypt.KeyGeneratorImpl.HmacSHA1, org.conscrypt.KeyGeneratorImpl.HmacSHA224, org.conscrypt.KeyGeneratorImpl.HmacSHA256, org.conscrypt.KeyGeneratorImpl.HmacSHA384, org.conscrypt.KeyGeneratorImpl.HmacSHA512, org.conscrypt.KeyGeneratorImpl.DESEDE, org.conscrypt.KeyGeneratorImpl.AES, org.conscrypt.KeyGeneratorImpl.ChaCha20, org.conscrypt.KeyGeneratorImpl.ARC4
Annotations
@Internal
Imports
java.security.InvalidAlgorithmParameterException, .InvalidParameterException, .SecureRandom, java.security.spec.AlgorithmParameterSpec, javax.crypto.KeyGeneratorSpi, .SecretKey, javax.crypto.spec.DESedeKeySpec, .SecretKeySpec

An implementation of javax.crypto.KeyGenerator suitable for use with other Conscrypt algorithms.

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
public static class
public static class
public static class
public static class
public static class
public static class
public static class
public static class
public static class

Field Summary

Modifier and TypeField and Description
private final String
private int
protected SecureRandom

Constructor Summary

AccessConstructor and Description
private
KeyGeneratorImpl(String algorithm, int defaultKeySizeBits)

Method Summary

Modifier and TypeMethod and Description
protected void
checkKeySize(int keySize)

protected byte[]
doKeyGeneration(int keyBytes)

protected SecretKey
engineGenerateKey()

Implements abstract javax.crypto.KeyGeneratorSpi.engineGenerateKey.

Generates a secret key.
protected void
engineInit(SecureRandom
the source of randomness for this generator
secureRandom
)

Implements abstract javax.crypto.KeyGeneratorSpi.engineInit.

Initializes the key generator.
protected void
engineInit(AlgorithmParameterSpec
the key generation parameters
params
,
SecureRandom
the source of randomness for this key generator
secureRandom
)

Implements abstract javax.crypto.KeyGeneratorSpi.engineInit.

Initializes the key generator with the specified parameter set and a user-provided source of randomness.
protected void
engineInit(int
the keysize. This is an algorithm-specific metric, specified in number of bits.
keySize
,
SecureRandom
the source of randomness for this key generator
secureRandom
)

Implements abstract javax.crypto.KeyGeneratorSpi.engineInit.

Initializes this key generator for a certain keysize, using the given source of randomness.

Field Detail

algorithmback to summary
private final String algorithm
keySizeBitsback to summary
private int keySizeBits
secureRandomback to summary
protected SecureRandom secureRandom

Constructor Detail

KeyGeneratorImplback to summary
private KeyGeneratorImpl(String algorithm, int defaultKeySizeBits)

Method Detail

checkKeySizeback to summary
protected void checkKeySize(int keySize)
doKeyGenerationback to summary
protected byte[] doKeyGeneration(int keyBytes)
engineGenerateKeyback to summary
protected SecretKey engineGenerateKey()

Implements abstract javax.crypto.KeyGeneratorSpi.engineGenerateKey.

Doc from javax.crypto.KeyGeneratorSpi.engineGenerateKey.

Generates a secret key.

Returns:SecretKey

the new key

Annotations
@Override
engineInitback to summary
protected void engineInit(SecureRandom secureRandom)

Implements abstract javax.crypto.KeyGeneratorSpi.engineInit.

Doc from javax.crypto.KeyGeneratorSpi.engineInit.

Initializes the key generator.

Parameters
secureRandom:SecureRandom

the source of randomness for this generator

Annotations
@Override
engineInitback to summary
protected void engineInit(AlgorithmParameterSpec params, SecureRandom secureRandom) throws InvalidAlgorithmParameterException

Implements abstract javax.crypto.KeyGeneratorSpi.engineInit.

Doc from javax.crypto.KeyGeneratorSpi.engineInit.

Initializes the key generator with the specified parameter set and a user-provided source of randomness.

Parameters
params:AlgorithmParameterSpec

the key generation parameters

secureRandom:SecureRandom

the source of randomness for this key generator

Annotations
@Override
Exceptions
InvalidAlgorithmParameterException:
if params is inappropriate for this key generator
engineInitback to summary
protected void engineInit(int keySize, SecureRandom secureRandom)

Implements abstract javax.crypto.KeyGeneratorSpi.engineInit.

Doc from javax.crypto.KeyGeneratorSpi.engineInit.

Initializes this key generator for a certain keysize, using the given source of randomness.

Parameters
keySize:int

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

secureRandom:SecureRandom

the source of randomness for this key generator

Annotations
@Override
org.conscrypt back to summary

public final Class KeyGeneratorImpl.AES

extends KeyGeneratorImpl
Class Inheritance

Field Summary

Inherited from org.conscrypt.KeyGeneratorImpl:
secureRandom

Constructor Summary

AccessConstructor and Description
public
AES()

Method Summary

Modifier and TypeMethod and Description
protected void
Inherited from org.conscrypt.KeyGeneratorImpl:
doKeyGenerationengineGenerateKeyengineInitengineInitengineInit

Constructor Detail

AESback to summary
public AES()

Method Detail

checkKeySizeback to summary
protected void checkKeySize(int keySize)

Overrides org.conscrypt.KeyGeneratorImpl.checkKeySize.

Annotations
@Override
org.conscrypt back to summary

public final Class KeyGeneratorImpl.ARC4

extends KeyGeneratorImpl
Class Inheritance

Field Summary

Inherited from org.conscrypt.KeyGeneratorImpl:
secureRandom

Constructor Summary

AccessConstructor and Description
public
ARC4()

Method Summary

Modifier and TypeMethod and Description
protected void
Inherited from org.conscrypt.KeyGeneratorImpl:
doKeyGenerationengineGenerateKeyengineInitengineInitengineInit

Constructor Detail

ARC4back to summary
public ARC4()

Method Detail

checkKeySizeback to summary
protected void checkKeySize(int keySize)

Overrides org.conscrypt.KeyGeneratorImpl.checkKeySize.

Annotations
@Override
org.conscrypt back to summary

public final Class KeyGeneratorImpl.ChaCha20

extends KeyGeneratorImpl
Class Inheritance

Field Summary

Inherited from org.conscrypt.KeyGeneratorImpl:
secureRandom

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected void
Inherited from org.conscrypt.KeyGeneratorImpl:
doKeyGenerationengineGenerateKeyengineInitengineInitengineInit

Constructor Detail

ChaCha20back to summary
public ChaCha20()

Method Detail

checkKeySizeback to summary
protected void checkKeySize(int keySize)

Overrides org.conscrypt.KeyGeneratorImpl.checkKeySize.

Annotations
@Override
org.conscrypt back to summary

public final Class KeyGeneratorImpl.DESEDE

extends KeyGeneratorImpl
Class Inheritance

Field Summary

Inherited from org.conscrypt.KeyGeneratorImpl:
secureRandom

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected void
protected byte[]
Inherited from org.conscrypt.KeyGeneratorImpl:
engineGenerateKeyengineInitengineInitengineInit

Constructor Detail

DESEDEback to summary
public DESEDE()

Method Detail

checkKeySizeback to summary
protected void checkKeySize(int keySize)

Overrides org.conscrypt.KeyGeneratorImpl.checkKeySize.

Annotations
@Override
doKeyGenerationback to summary
protected byte[] doKeyGeneration(int keyBytes)

Overrides org.conscrypt.KeyGeneratorImpl.doKeyGeneration.

Annotations
@Override
org.conscrypt back to summary

public final Class KeyGeneratorImpl.HmacMD5

extends KeyGeneratorImpl
Class Inheritance

Field Summary

Inherited from org.conscrypt.KeyGeneratorImpl:
secureRandom

Constructor Summary

AccessConstructor and Description
public

Method Summary

Inherited from org.conscrypt.KeyGeneratorImpl:
checkKeySizedoKeyGenerationengineGenerateKeyengineInitengineInitengineInit

Constructor Detail

HmacMD5back to summary
public HmacMD5()
org.conscrypt back to summary

public final Class KeyGeneratorImpl.HmacSHA1

extends KeyGeneratorImpl
Class Inheritance

Field Summary

Inherited from org.conscrypt.KeyGeneratorImpl:
secureRandom

Constructor Summary

AccessConstructor and Description
public

Method Summary

Inherited from org.conscrypt.KeyGeneratorImpl:
checkKeySizedoKeyGenerationengineGenerateKeyengineInitengineInitengineInit

Constructor Detail

HmacSHA1back to summary
public HmacSHA1()
org.conscrypt back to summary

public final Class KeyGeneratorImpl.HmacSHA224

extends KeyGeneratorImpl
Class Inheritance

Field Summary

Inherited from org.conscrypt.KeyGeneratorImpl:
secureRandom

Constructor Summary

AccessConstructor and Description
public

Method Summary

Inherited from org.conscrypt.KeyGeneratorImpl:
checkKeySizedoKeyGenerationengineGenerateKeyengineInitengineInitengineInit

Constructor Detail

HmacSHA224back to summary
public HmacSHA224()
org.conscrypt back to summary

public final Class KeyGeneratorImpl.HmacSHA256

extends KeyGeneratorImpl
Class Inheritance

Field Summary

Inherited from org.conscrypt.KeyGeneratorImpl:
secureRandom

Constructor Summary

AccessConstructor and Description
public

Method Summary

Inherited from org.conscrypt.KeyGeneratorImpl:
checkKeySizedoKeyGenerationengineGenerateKeyengineInitengineInitengineInit

Constructor Detail

HmacSHA256back to summary
public HmacSHA256()
org.conscrypt back to summary

public final Class KeyGeneratorImpl.HmacSHA384

extends KeyGeneratorImpl
Class Inheritance

Field Summary

Inherited from org.conscrypt.KeyGeneratorImpl:
secureRandom

Constructor Summary

AccessConstructor and Description
public

Method Summary

Inherited from org.conscrypt.KeyGeneratorImpl:
checkKeySizedoKeyGenerationengineGenerateKeyengineInitengineInitengineInit

Constructor Detail

HmacSHA384back to summary
public HmacSHA384()
org.conscrypt back to summary

public final Class KeyGeneratorImpl.HmacSHA512

extends KeyGeneratorImpl
Class Inheritance

Field Summary

Inherited from org.conscrypt.KeyGeneratorImpl:
secureRandom

Constructor Summary

AccessConstructor and Description
public

Method Summary

Inherited from org.conscrypt.KeyGeneratorImpl:
checkKeySizedoKeyGenerationengineGenerateKeyengineInitengineInitengineInit

Constructor Detail

HmacSHA512back to summary
public HmacSHA512()