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 Stringprivate byte[]private intprivate intprivate static final int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) voidcomputeK(byte[] peerPublicKey) Compute Shared Secret Key using Diffie-Hellman Curve25519 known as X25519private KeySpecgetPeerPublicKeySpec(byte[] peerPublicKey) voidinit(AlgorithmParameterSpec params, Factory<Random> randomFactory) Initialize Key Agreement with generated Public and Private Key Pairprivate voidsetPublicKey(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:
computeKin 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:
initin classDHBase- Parameters:
params- Parameters not usedrandomFactory- Random Factory not used- Throws:
GeneralSecurityException- Thrown on key agreement initialization failures
-
setPublicKey
-
getPeerPublicKeySpec
-