Package net.schmizz.sshj.transport.kex
Class Curve25519DH
java.lang.Object
net.schmizz.sshj.transport.kex.DHBase
net.schmizz.sshj.transport.kex.Curve25519DH
Key Exchange Method using Curve25519 as defined in RFC 8731
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final String
private byte[]
private int
private int
private static final int
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) void
computeK
(byte[] peerPublicKey) Compute Shared Secret Key using Diffie-Hellman Curve25519 known as X25519private KeySpec
getPeerPublicKeySpec
(byte[] peerPublicKey) void
init
(AlgorithmParameterSpec params, Factory<Random> randomFactory) Initialize Key Agreement with generated Public and Private Key Pairprivate void
setPublicKey
(PublicKey publicKey)
-
Field Details
-
ALGORITHM
- See Also:
-
KEY_LENGTH
private static final int KEY_LENGTH- See Also:
-
encodedKeyLength
private int encodedKeyLength -
algorithmIdLength
private int algorithmIdLength -
algorithmId
private byte[] algorithmId
-
-
Constructor Details
-
Curve25519DH
public Curve25519DH()
-
-
Method Details
-
computeK
Compute Shared Secret Key using Diffie-Hellman Curve25519 known as X25519- Specified by:
computeK
in classDHBase
- Parameters:
peerPublicKey
- Peer public key bytes- Throws:
GeneralSecurityException
- Thrown on key agreement failures
-
init
public void init(AlgorithmParameterSpec params, Factory<Random> randomFactory) throws GeneralSecurityException Initialize Key Agreement with generated Public and Private Key Pair- Specified by:
init
in classDHBase
- Parameters:
params
- Parameters not usedrandomFactory
- Random Factory not used- Throws:
GeneralSecurityException
- Thrown on key agreement initialization failures
-
setPublicKey
-
getPeerPublicKeySpec
-