Package org.conscrypt
Class KeyGeneratorImpl
- java.lang.Object
-
- javax.crypto.KeyGeneratorSpi
-
- org.conscrypt.KeyGeneratorImpl
-
- Direct Known Subclasses:
KeyGeneratorImpl.AES
,KeyGeneratorImpl.ARC4
,KeyGeneratorImpl.ChaCha20
,KeyGeneratorImpl.DESEDE
,KeyGeneratorImpl.HmacMD5
,KeyGeneratorImpl.HmacSHA1
,KeyGeneratorImpl.HmacSHA224
,KeyGeneratorImpl.HmacSHA256
,KeyGeneratorImpl.HmacSHA384
,KeyGeneratorImpl.HmacSHA512
@Internal public abstract class KeyGeneratorImpl extends javax.crypto.KeyGeneratorSpi
An implementation ofKeyGenerator
suitable for use with other Conscrypt algorithms.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
KeyGeneratorImpl.AES
static class
KeyGeneratorImpl.ARC4
static class
KeyGeneratorImpl.ChaCha20
static class
KeyGeneratorImpl.DESEDE
static class
KeyGeneratorImpl.HmacMD5
static class
KeyGeneratorImpl.HmacSHA1
static class
KeyGeneratorImpl.HmacSHA224
static class
KeyGeneratorImpl.HmacSHA256
static class
KeyGeneratorImpl.HmacSHA384
static class
KeyGeneratorImpl.HmacSHA512
-
Field Summary
Fields Modifier and Type Field Description private java.lang.String
algorithm
private int
keySizeBits
protected java.security.SecureRandom
secureRandom
-
Constructor Summary
Constructors Modifier Constructor Description private
KeyGeneratorImpl(java.lang.String algorithm, int defaultKeySizeBits)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
checkKeySize(int keySize)
protected byte[]
doKeyGeneration(int keyBytes)
protected javax.crypto.SecretKey
engineGenerateKey()
protected void
engineInit(int keySize, java.security.SecureRandom secureRandom)
protected void
engineInit(java.security.SecureRandom secureRandom)
protected void
engineInit(java.security.spec.AlgorithmParameterSpec params, java.security.SecureRandom secureRandom)
-
-
-
Method Detail
-
checkKeySize
protected void checkKeySize(int keySize)
-
engineInit
protected void engineInit(java.security.SecureRandom secureRandom)
- Specified by:
engineInit
in classjavax.crypto.KeyGeneratorSpi
-
engineInit
protected void engineInit(java.security.spec.AlgorithmParameterSpec params, java.security.SecureRandom secureRandom) throws java.security.InvalidAlgorithmParameterException
- Specified by:
engineInit
in classjavax.crypto.KeyGeneratorSpi
- Throws:
java.security.InvalidAlgorithmParameterException
-
engineInit
protected void engineInit(int keySize, java.security.SecureRandom secureRandom)
- Specified by:
engineInit
in classjavax.crypto.KeyGeneratorSpi
-
doKeyGeneration
protected byte[] doKeyGeneration(int keyBytes)
-
engineGenerateKey
protected javax.crypto.SecretKey engineGenerateKey()
- Specified by:
engineGenerateKey
in classjavax.crypto.KeyGeneratorSpi
-
-