Module io.github.mmm.crypto.bc
Class AsymmetricKeyPairFactoryEcBc
- java.lang.Object
-
- io.github.mmm.crypto.asymmetric.key.AbstractAsymmetricKeyPairFactory<org.bouncycastle.jcajce.provider.asymmetric.ec.BCECPrivateKey,org.bouncycastle.jcajce.provider.asymmetric.ec.BCECPublicKey,AsymmetricKeyPairEcBc>
-
- io.github.mmm.crypto.asymmetric.key.ec.bc.AsymmetricKeyPairFactoryEcBc
-
- All Implemented Interfaces:
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>
- Direct Known Subclasses:
AsymmetricKeyPairFactoryEcBcCompact
,AsymmetricKeyPairFactoryEcBcUncompressed
public abstract class AsymmetricKeyPairFactoryEcBc extends AbstractAsymmetricKeyPairFactory<org.bouncycastle.jcajce.provider.asymmetric.ec.BCECPrivateKey,org.bouncycastle.jcajce.provider.asymmetric.ec.BCECPublicKey,AsymmetricKeyPairEcBc>
Abstract base implementation ofAbstractAsymmetricKeyPairFactory
for EC using BouncyCastle.- Since:
- 1.0.0
-
-
Field Summary
Fields Modifier and Type Field Description protected int
byteLength
protected org.bouncycastle.jce.spec.ECParameterSpec
ecParameters
-
Constructor Summary
Constructors Constructor Description AsymmetricKeyPairFactoryEcBc(org.bouncycastle.jce.spec.ECParameterSpec ecParameters)
The constructor.AsymmetricKeyPairFactoryEcBc(org.bouncycastle.jce.spec.ECParameterSpec ecParameters, KeyFactory keyFactory)
The constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[]
asData(AsymmetricKeyPairEcBc keyPair)
byte[]
asData(org.bouncycastle.jcajce.provider.asymmetric.ec.BCECPrivateKey privateKey)
AsymmetricKeyPairEcBc
createKeyPair(byte[] data)
AsymmetricKeyPairEcBc
createKeyPair(org.bouncycastle.jcajce.provider.asymmetric.ec.BCECPrivateKey privateKey, org.bouncycastle.jcajce.provider.asymmetric.ec.BCECPublicKey publicKey)
org.bouncycastle.jcajce.provider.asymmetric.ec.BCECPrivateKey
createPrivateKey(byte[] data)
-
Methods inherited from class io.github.mmm.crypto.asymmetric.key.AbstractAsymmetricKeyPairFactory
createPrivateKey, createPublicKey, getKeyFactory, 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.AsymmetricKeyPairFactory
asBinary
-
Methods inherited from interface io.github.mmm.crypto.asymmetric.key.PrivateKeyFactory
asBinary
-
Methods inherited from interface io.github.mmm.crypto.asymmetric.key.PublicKeyFactory
asBinary, asData, createPublicKey
-
-
-
-
Field Detail
-
ecParameters
protected final org.bouncycastle.jce.spec.ECParameterSpec ecParameters
- See Also:
CryptoEllipticCurveBc.getEcParameters()
-
byteLength
protected final int byteLength
- See Also:
CryptoEllipticCurveBc.getByteLength()
-
-
Constructor Detail
-
AsymmetricKeyPairFactoryEcBc
public AsymmetricKeyPairFactoryEcBc(org.bouncycastle.jce.spec.ECParameterSpec ecParameters)
The constructor.- Parameters:
ecParameters
- theECParameterSpec
.
-
AsymmetricKeyPairFactoryEcBc
public AsymmetricKeyPairFactoryEcBc(org.bouncycastle.jce.spec.ECParameterSpec ecParameters, KeyFactory keyFactory)
The constructor.- Parameters:
ecParameters
- theECParameterSpec
.keyFactory
- theKeyFactory
.
-
-
Method Detail
-
asData
public byte[] asData(org.bouncycastle.jcajce.provider.asymmetric.ec.BCECPrivateKey privateKey)
- Parameters:
privateKey
- thePrivateKey
to serialize.- Returns:
- the serialized binary data.
-
createPrivateKey
public org.bouncycastle.jcajce.provider.asymmetric.ec.BCECPrivateKey createPrivateKey(byte[] data)
- Parameters:
data
- thePrivateKey
as rawbyte
array.- Returns:
- the deserialized
PrivateKey
.
-
asData
public byte[] asData(AsymmetricKeyPairEcBc keyPair)
- Parameters:
keyPair
- theAsymmetricKeyPair
to serialize.- Returns:
- the serialized binary data.
-
createKeyPair
public AsymmetricKeyPairEcBc createKeyPair(byte[] data)
- Parameters:
data
- theAsymmetricKeyPair
in its binary form.- Returns:
- the deserialized
AsymmetricKeyPair
.
-
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
.
-
-