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 key
with its correspondingpublic key
for asymmetric encryption. The big advantage of asymmetric encryption is that no secret has to be shared between the parties. Thepublic key
can be made public and shared. Anybody knowing your public key canencrypt
data for you that only you as the owner of the correspondingprivate key
candecrypt
. On the other hand only you as the owner of theprivate key
cansign
arbitrary data in a way so that everybody canverify
this 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 KeyPair
getKeyPair()
default Set<Key>
getKeys()
PR
getPrivateKey()
PU
getPublicKey()
-
-
-
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.
-
-