Module io.github.mmm.crypto
Class AsymmetricKeyPairFactoryRsaCompact
- java.lang.Object
-
- io.github.mmm.crypto.asymmetric.key.AbstractAsymmetricKeyPairFactory<RSAPrivateKey,RSAPublicKey,AsymmetricKeyPairRsa>
-
- io.github.mmm.crypto.asymmetric.key.rsa.AsymmetricKeyPairFactoryRsaCompact
-
- All Implemented Interfaces:
AsymmetricKeyPairFactory<RSAPrivateKey,RSAPublicKey,AsymmetricKeyPairRsa>
,AsymmetricKeyPairFactorySimple<RSAPrivateKey,RSAPublicKey,AsymmetricKeyPairRsa>
,PrivateKeyFactory<RSAPrivateKey>
,PublicKeyFactory<RSAPublicKey>
public class AsymmetricKeyPairFactoryRsaCompact extends AbstractAsymmetricKeyPairFactory<RSAPrivateKey,RSAPublicKey,AsymmetricKeyPairRsa>
Implementation ofAbstractAsymmetricKeyPairFactory
for RSA incompact format
.- Since:
- 1.0.0
-
-
Constructor Summary
Constructors Constructor Description AsymmetricKeyPairFactoryRsaCompact()
The constructor.AsymmetricKeyPairFactoryRsaCompact(KeyFactory keyFactory)
The constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[]
asData(AsymmetricKeyPairRsa keyPair)
byte[]
asData(RSAPrivateKey privateKey)
byte[]
asData(RSAPublicKey publicKey)
AsymmetricKeyPairRsa
createKeyPair(byte[] data)
AsymmetricKeyPairRsa
createKeyPair(RSAPrivateKey privateKey, RSAPublicKey publicKey)
RSAPrivateKey
createPrivateKey(byte[] data)
RSAPublicKey
createPublicKey(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
-
-
-
-
Constructor Detail
-
AsymmetricKeyPairFactoryRsaCompact
public AsymmetricKeyPairFactoryRsaCompact()
The constructor.
-
AsymmetricKeyPairFactoryRsaCompact
public AsymmetricKeyPairFactoryRsaCompact(KeyFactory keyFactory)
The constructor.- Parameters:
keyFactory
- theKeyFactory
.
-
-
Method Detail
-
asData
public byte[] asData(RSAPrivateKey privateKey)
- Parameters:
privateKey
- thePrivateKey
to serialize.- Returns:
- the serialized binary data.
-
createPrivateKey
public RSAPrivateKey createPrivateKey(byte[] data)
- Parameters:
data
- thePrivateKey
as rawbyte
array.- Returns:
- the deserialized
PrivateKey
.
-
asData
public byte[] asData(RSAPublicKey publicKey)
- Parameters:
publicKey
- thePublicKey
to serialize.- Returns:
- the serialized binary data.
-
createPublicKey
public RSAPublicKey createPublicKey(byte[] data)
-
asData
public byte[] asData(AsymmetricKeyPairRsa keyPair)
- Parameters:
keyPair
- theAsymmetricKeyPair
to serialize.- Returns:
- the serialized binary data.
-
createKeyPair
public AsymmetricKeyPairRsa createKeyPair(byte[] data)
- Parameters:
data
- theAsymmetricKeyPair
in its binary form.- Returns:
- the deserialized
AsymmetricKeyPair
.
-
createKeyPair
public AsymmetricKeyPairRsa createKeyPair(RSAPrivateKey privateKey, RSAPublicKey publicKey)
- Parameters:
privateKey
- thePrivateKey
.publicKey
- the correspondingPublicKey
.- Returns:
- the
AsymmetricKeyPair
.
-
-