Package net.schmizz.sshj.transport.kex
Class Curve25519DH
- java.lang.Object
-
- net.schmizz.sshj.transport.kex.DHBase
-
- net.schmizz.sshj.transport.kex.Curve25519DH
-
public class Curve25519DH extends DHBase
Key Exchange Method using Curve25519 as defined in RFC 8731
-
-
Field Summary
Fields Modifier and Type Field Description private static java.lang.String
ALGORITHM
private byte[]
algorithmId
private int
algorithmIdLength
private int
encodedKeyLength
private static int
KEY_LENGTH
-
Constructor Summary
Constructors Constructor Description Curve25519DH()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) void
computeK(byte[] peerPublicKey)
Compute Shared Secret Key using Diffie-Hellman Curve25519 known as X25519private java.security.spec.KeySpec
getPeerPublicKeySpec(byte[] peerPublicKey)
void
init(java.security.spec.AlgorithmParameterSpec params, Factory<Random> randomFactory)
Initialize Key Agreement with generated Public and Private Key Pairprivate void
setPublicKey(java.security.PublicKey publicKey)
-
-
-
Field Detail
-
ALGORITHM
private static final java.lang.String ALGORITHM
- See Also:
- Constant Field Values
-
KEY_LENGTH
private static final int KEY_LENGTH
- See Also:
- Constant Field Values
-
encodedKeyLength
private int encodedKeyLength
-
algorithmIdLength
private int algorithmIdLength
-
algorithmId
private byte[] algorithmId
-
-
Method Detail
-
computeK
void computeK(byte[] peerPublicKey) throws java.security.GeneralSecurityException
Compute Shared Secret Key using Diffie-Hellman Curve25519 known as X25519
-
init
public void init(java.security.spec.AlgorithmParameterSpec params, Factory<Random> randomFactory) throws java.security.GeneralSecurityException
Initialize Key Agreement with generated Public and Private Key Pair
-
setPublicKey
private void setPublicKey(java.security.PublicKey publicKey)
-
getPeerPublicKeySpec
private java.security.spec.KeySpec getPeerPublicKeySpec(byte[] peerPublicKey)
-
-