Module io.github.mmm.crypto.bc
Class AsymmetricKeyCreatorEcBc
- java.lang.Object
-
- io.github.mmm.crypto.algorithm.AbstractSecurityAlgorithm
-
- io.github.mmm.crypto.algorithm.AbstractCryptoAlgorithmWithProvider
-
- io.github.mmm.crypto.algorithm.CryptoAlgorithmImpl
-
- io.github.mmm.crypto.algorithm.CryptoAlgorithmImplWithRandom
-
- io.github.mmm.crypto.asymmetric.key.AbstractAsymmetricKeyCreator<org.bouncycastle.jcajce.provider.asymmetric.ec.BCECPrivateKey,org.bouncycastle.jcajce.provider.asymmetric.ec.BCECPublicKey,AsymmetricKeyPairEcBc>
-
- io.github.mmm.crypto.asymmetric.key.ec.bc.AsymmetricKeyCreatorEcBc
-
- All Implemented Interfaces:
CryptoAlgorithm
,AsymmetricKeyCreator<org.bouncycastle.jcajce.provider.asymmetric.ec.BCECPrivateKey,org.bouncycastle.jcajce.provider.asymmetric.ec.BCECPublicKey,AsymmetricKeyPairEcBc>
,AsymmetricKeyPairFactory<org.bouncycastle.jcajce.provider.asymmetric.ec.BCECPrivateKey,org.bouncycastle.jcajce.provider.asymmetric.ec.BCECPublicKey,AsymmetricKeyPairEcBc>
,AsymmetricKeyPairFactorySimple<org.bouncycastle.jcajce.provider.asymmetric.ec.BCECPrivateKey,org.bouncycastle.jcajce.provider.asymmetric.ec.BCECPublicKey,AsymmetricKeyPairEcBc>
,PrivateKeyFactory<org.bouncycastle.jcajce.provider.asymmetric.ec.BCECPrivateKey>
,PublicKeyFactory<org.bouncycastle.jcajce.provider.asymmetric.ec.BCECPublicKey>
,KeyCreator
public class AsymmetricKeyCreatorEcBc extends AbstractAsymmetricKeyCreator<org.bouncycastle.jcajce.provider.asymmetric.ec.BCECPrivateKey,org.bouncycastle.jcajce.provider.asymmetric.ec.BCECPublicKey,AsymmetricKeyPairEcBc>
Implementation ofAsymmetricKeyCreator
forAsymmetricKeyPairEcBc
.- Since:
- 1.0.0
-
-
Field Summary
-
Fields inherited from class io.github.mmm.crypto.algorithm.AbstractCryptoAlgorithmWithProvider
provider
-
-
Constructor Summary
Constructors Constructor Description AsymmetricKeyCreatorEcBc(org.bouncycastle.jce.spec.ECParameterSpec ecParameters)
The constructor.AsymmetricKeyCreatorEcBc(org.bouncycastle.jce.spec.ECParameterSpec ecParameters, RandomFactory randomFactory)
The constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AsymmetricKeyPairEcBc
createKeyPair(org.bouncycastle.jcajce.provider.asymmetric.ec.BCECPrivateKey privateKey, org.bouncycastle.jcajce.provider.asymmetric.ec.BCECPublicKey publicKey)
int
getKeyLength(org.bouncycastle.jcajce.provider.asymmetric.ec.BCECPrivateKey privateKey)
int
getKeyLength(org.bouncycastle.jcajce.provider.asymmetric.ec.BCECPublicKey publicKey)
protected void
init(KeyPairGenerator keyPairGenerator)
void
verifyKey(org.bouncycastle.jcajce.provider.asymmetric.ec.BCECPrivateKey privateKey)
Verify that the given key matches the criteria of this key creator such askey length
.void
verifyKey(org.bouncycastle.jcajce.provider.asymmetric.ec.BCECPublicKey publicKey)
Verify that the given key matches the criteria of this key creator such askey length
.-
Methods inherited from class io.github.mmm.crypto.asymmetric.key.AbstractAsymmetricKeyCreator
asData, asData, asData, createKeyPair, createPrivateKey, createPublicKey, generateKeyPair, getKeyLength, register, register
-
Methods inherited from class io.github.mmm.crypto.algorithm.CryptoAlgorithmImplWithRandom
createSecureRandom, getRandomFactory
-
Methods inherited from class io.github.mmm.crypto.algorithm.CryptoAlgorithmImpl
getAlgorithm
-
Methods inherited from class io.github.mmm.crypto.algorithm.AbstractCryptoAlgorithmWithProvider
getProvider
-
Methods inherited from class io.github.mmm.crypto.algorithm.AbstractSecurityAlgorithm
creationFailedException, creationFailedException, creationFailedException, creationFailedException, getAlgorithm, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface io.github.mmm.crypto.asymmetric.key.AsymmetricKeyCreator
asBinary, asBinary, asBinary, asData, asData, asData, createKeyPair, createPrivateKey, createPublicKey
-
Methods inherited from interface io.github.mmm.crypto.asymmetric.key.AsymmetricKeyPairFactory
asBinary
-
Methods inherited from interface io.github.mmm.crypto.algorithm.CryptoAlgorithm
getAlgorithm
-
Methods inherited from interface io.github.mmm.crypto.asymmetric.key.PrivateKeyFactory
asBinary
-
Methods inherited from interface io.github.mmm.crypto.asymmetric.key.PublicKeyFactory
asBinary
-
-
-
-
Constructor Detail
-
AsymmetricKeyCreatorEcBc
public AsymmetricKeyCreatorEcBc(org.bouncycastle.jce.spec.ECParameterSpec ecParameters)
The constructor.- Parameters:
ecParameters
- theECParameterSpec
.
-
AsymmetricKeyCreatorEcBc
public AsymmetricKeyCreatorEcBc(org.bouncycastle.jce.spec.ECParameterSpec ecParameters, RandomFactory randomFactory)
The constructor.- Parameters:
ecParameters
- theECParameterSpec
.randomFactory
- therandom factory
.
-
-
Method Detail
-
createKeyPair
public AsymmetricKeyPairEcBc createKeyPair(org.bouncycastle.jcajce.provider.asymmetric.ec.BCECPrivateKey privateKey, org.bouncycastle.jcajce.provider.asymmetric.ec.BCECPublicKey publicKey)
- Parameters:
privateKey
- thePrivateKey
.publicKey
- the correspondingPublicKey
.- Returns:
- the
AsymmetricKeyPair
.
-
getKeyLength
public int getKeyLength(org.bouncycastle.jcajce.provider.asymmetric.ec.BCECPrivateKey privateKey)
- Parameters:
privateKey
- thePrivateKey
.- Returns:
- the
key length
of the given key in bits.
-
verifyKey
public void verifyKey(org.bouncycastle.jcajce.provider.asymmetric.ec.BCECPrivateKey privateKey)
Description copied from interface:AsymmetricKeyCreator
Verify that the given key matches the criteria of this key creator such askey length
.- Parameters:
privateKey
- thePrivateKey
to verify.
-
getKeyLength
public int getKeyLength(org.bouncycastle.jcajce.provider.asymmetric.ec.BCECPublicKey publicKey)
- Parameters:
publicKey
- thePublicKey
.- Returns:
- the
key length
of the given key in bits.
-
verifyKey
public void verifyKey(org.bouncycastle.jcajce.provider.asymmetric.ec.BCECPublicKey publicKey)
Description copied from interface:AsymmetricKeyCreator
Verify that the given key matches the criteria of this key creator such askey length
.- Parameters:
publicKey
- thePublicKey
to verify.
-
init
protected void init(KeyPairGenerator keyPairGenerator) throws Exception
- Overrides:
init
in classAbstractAsymmetricKeyCreator<org.bouncycastle.jcajce.provider.asymmetric.ec.BCECPrivateKey,org.bouncycastle.jcajce.provider.asymmetric.ec.BCECPublicKey,AsymmetricKeyPairEcBc>
- Parameters:
keyPairGenerator
- theKeyPairGenerator
toinitialize
.- Throws:
Exception
- on error.
-
-