Module io.github.mmm.crypto
Class AsymmetricKeyPairFactoryEncoded<PR extends PrivateKey,PU extends PublicKey,PAIR extends AbstractAsymmetricKeyPair<PR,PU>>
- java.lang.Object
-
- io.github.mmm.crypto.asymmetric.key.AbstractAsymmetricKeyPairFactory<PR,PU,PAIR>
-
- io.github.mmm.crypto.asymmetric.key.generic.AsymmetricKeyPairFactoryEncoded<PR,PU,PAIR>
-
- Type Parameters:
PR- type ofPrivateKey.PU- type ofPublicKey.PAIR- type ofAsymmetricKeyPair.
- All Implemented Interfaces:
AsymmetricKeyPairFactory<PR,PU,PAIR>,AsymmetricKeyPairFactorySimple<PR,PU,PAIR>,PrivateKeyFactory<PR>,PublicKeyFactory<PU>
public class AsymmetricKeyPairFactoryEncoded<PR extends PrivateKey,PU extends PublicKey,PAIR extends AbstractAsymmetricKeyPair<PR,PU>> extends AbstractAsymmetricKeyPairFactory<PR,PU,PAIR>
Implementation ofAsymmetricKeyPairFactoryforencoded formatbased onPKCS8EncodedKeySpecandX509EncodedKeySpec.- Since:
- 1.0.0
-
-
Constructor Summary
Constructors Constructor Description AsymmetricKeyPairFactoryEncoded(KeyFactory keyFactory, AsymmetricKeyPairFactorySimple<PR,PU,PAIR> keyPairCreator)The constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[]asData(PAIR keyPair)byte[]asData(PR privateKey)byte[]asData(PU publicKey)PAIRcreateKeyPair(byte[] data)PAIRcreateKeyPair(PR privateKey, PU publicKey)PRcreatePrivateKey(byte[] data)PUcreatePublicKey(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
-
AsymmetricKeyPairFactoryEncoded
public AsymmetricKeyPairFactoryEncoded(KeyFactory keyFactory, AsymmetricKeyPairFactorySimple<PR,PU,PAIR> keyPairCreator)
The constructor.- Parameters:
keyFactory- theKeyFactory.keyPairCreator- theAsymmetricKeyPairFactorySimple.
-
-
Method Detail
-
asData
public byte[] asData(PR privateKey)
- Parameters:
privateKey- thePrivateKeyto serialize.- Returns:
- the serialized binary data.
-
createPrivateKey
public PR createPrivateKey(byte[] data)
- Parameters:
data- thePrivateKeyas rawbytearray.- Returns:
- the deserialized
PrivateKey.
-
asData
public byte[] asData(PU publicKey)
- Parameters:
publicKey- thePublicKeyto serialize.- Returns:
- the serialized binary data.
-
createPublicKey
public PU createPublicKey(byte[] data)
-
asData
public byte[] asData(PAIR keyPair)
- Parameters:
keyPair- theAsymmetricKeyPairto serialize.- Returns:
- the serialized binary data.
-
createKeyPair
public PAIR createKeyPair(PR privateKey, PU publicKey)
- Parameters:
privateKey- thePrivateKey.publicKey- the correspondingPublicKey.- Returns:
- the
AsymmetricKeyPair.
-
createKeyPair
public PAIR createKeyPair(byte[] data)
- Parameters:
data- theAsymmetricKeyPairin its binary form.- Returns:
- the deserialized
AsymmetricKeyPair.
-
-