Package org.apache.sshd.common.kex
Class XDH
java.lang.Object
org.apache.sshd.common.kex.AbstractDH
org.apache.sshd.common.kex.XDH
Provides Diffie-Hellman SSH key exchange algorithms for the Montgomery curves specified in RFC 8731.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final MontgomeryCurve
protected byte[]
protected final boolean
Fields inherited from class org.apache.sshd.common.kex.AbstractDH
myKeyAgree
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected byte[]
Lazy-called byAbstractDH.getE()
if the public key data has not been generated yet.protected byte[]
Lazy-called byAbstractDH.getK()
if the shared secret data has not been calculated yetint
void
void
void
setF
(byte[] f) Methods inherited from class org.apache.sshd.common.kex.AbstractDH
checkKeyAgreementNecessity, getE, getHash, getK, getKeyEncapsulation, isPublicDataAvailable, isSharedSecretAvailable, stripLeadingZeroes, toString
-
Field Details
-
curve
-
raw
protected final boolean raw -
f
protected byte[] f
-
-
Constructor Details
-
XDH
- Throws:
Exception
-
-
Method Details
-
getKeySize
public int getKeySize() -
calculateE
Description copied from class:AbstractDH
Lazy-called byAbstractDH.getE()
if the public key data has not been generated yet.- Specified by:
calculateE
in classAbstractDH
- Returns:
- The calculated public key data
- Throws:
Exception
- If failed to generate the relevant data
-
setF
public void setF(byte[] f) - Specified by:
setF
in classAbstractDH
-
putE
- Overrides:
putE
in classAbstractDH
-
putF
- Overrides:
putF
in classAbstractDH
-
calculateK
Description copied from class:AbstractDH
Lazy-called byAbstractDH.getK()
if the shared secret data has not been calculated yet- Specified by:
calculateK
in classAbstractDH
- Returns:
- The shared secret data
- Throws:
Exception
- If failed to calculate it
-