Package org.moera.lib.crypto
Class KeyPair
java.lang.Object
org.moera.lib.crypto.KeyPair
Represents a pair of cryptographic keys: a private key and a public key.
This class is specifically designed for Elliptic Curve cryptography (EC).
-
Constructor Summary
ConstructorsConstructorDescriptionKeyPair
(ECPrivateKey privateKey, ECPublicKey publicKey) Constructs a newKeyPair
instance with the specified private and public keys.Constructs a newKeyPair
instance using aKeyPair
. -
Method Summary
Modifier and TypeMethodDescriptionRetrieves the elliptic curve private key associated with the key pair.Retrieves the elliptic curve public key associated with the key pair.
-
Constructor Details
-
KeyPair
Constructs a newKeyPair
instance with the specified private and public keys.- Parameters:
privateKey
- the elliptic curve private key associated with this key pairpublicKey
- the elliptic curve public key associated with this key pair
-
KeyPair
Constructs a newKeyPair
instance using aKeyPair
. The providedKeyPair
must contain an Elliptic Curve private key and public key.- Parameters:
keyPair
- theKeyPair
containing the EC private and public keys
-
-
Method Details
-
getPrivateKey
Retrieves the elliptic curve private key associated with the key pair.- Returns:
- the elliptic curve private key
-
getPublicKey
Retrieves the elliptic curve public key associated with the key pair.- Returns:
- the elliptic curve public key
-