Module io.github.mmm.crypto
Interface AsymmetricKeyPair<PR extends PrivateKey,PU extends PublicKey>
-
- Type Parameters:
PR- type ofgetPrivateKey()PU- type ofgetPublicKey().
- All Superinterfaces:
KeySet
- All Known Implementing Classes:
AbstractAsymmetricKeyPair,AsymmetricKeyPairEc,AsymmetricKeyPairEcBc,AsymmetricKeyPairEcJce,AsymmetricKeyPairGeneric,AsymmetricKeyPairRsa
public interface AsymmetricKeyPair<PR extends PrivateKey,PU extends PublicKey> extends KeySet
Interface for a key pair consisting of aprivate keywith its correspondingpublic keyfor asymmetric encryption. The big advantage of asymmetric encryption is that no secret has to be shared between the parties. Thepublic keycan be made public and shared. Anybody knowing your public key canencryptdata for you that only you as the owner of the correspondingprivate keycandecrypt. On the other hand only you as the owner of theprivate keycansignarbitrary data in a way so that everybody canverifythis signature using yourpublic key.- Since:
- 1.0.0
- Author:
- Joerg Hohwiller (hohwille at users.sourceforge.net)
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description KeyPairgetKeyPair()default Set<Key>getKeys()PRgetPrivateKey()PUgetPublicKey()
-
-
-
Method Detail
-
getPrivateKey
PR getPrivateKey()
- Returns:
- the
private key. Has to be kept secret.
-
getPublicKey
PU getPublicKey()
- Returns:
- the
public key. May be distributed or published.
-
-