Package com.wireguard.crypto
Class KeyPair
- java.lang.Object
-
- com.wireguard.crypto.KeyPair
-
public class KeyPair extends java.lang.Object
Represents a Curve25519 key pair as used by WireGuard.Instances of this class are immutable.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Key
getPrivateKey()
Returns the private key from the key pair.Key
getPublicKey()
Returns the public key from the key pair.
-
-
-
Constructor Detail
-
KeyPair
public KeyPair()
Creates a key pair using a newly-generated private key.
-
KeyPair
public KeyPair(Key privateKey)
Creates a key pair using an existing private key.- Parameters:
privateKey
- a private key, used to derive the public key
-
-