Package org.apache.sshd.client.kex
Class SM2Client
java.lang.Object
org.apache.sshd.common.util.logging.AbstractLoggingBean
org.apache.sshd.client.kex.SM2Client
- All Implemented Interfaces:
KeyExchange,NamedResource,SessionContextHolder,SessionHolder<Session>
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected byteprotected byte[]protected Digestprotected byte[]protected byte[]protected byte[]private intprivate intprotected byte[]private AbstractClientSessionprotected byte[]protected byte[]Fields inherited from class org.apache.sshd.common.util.logging.AbstractLoggingBean
logFields inherited from interface org.apache.sshd.common.kex.KeyExchange
GROUP_KEX_OPCODES_MAP, SIMPLE_KEX_OPCODES_MAPFields inherited from interface org.apache.sshd.common.NamedResource
BY_NAME_COMPARATOR, NAME_EXTRACTOR -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbyte[]getH()Retrieves the computedhparametergetHash()The message digest used by this key exchange algorithm.byte[]getK()Retrieves the computed k parametergetName()voidinit(byte[] v_s, byte[] v_c, byte[] i_s, byte[] i_c) Initialize the key exchange algorithm.booleanProcess the next packetvoidsetSession(Session session) Methods inherited from class org.apache.sshd.common.util.logging.AbstractLoggingBean
debug, debug, debug, debug, debug, error, error, error, error, error, getSimplifiedLogger, info, info, warn, warn, warn, warn, warn, warn, warn, warnMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.sshd.common.session.SessionHolder
getSessionContext
-
Field Details
-
session
-
v_s
protected byte[] v_s -
v_c
protected byte[] v_c -
i_s
protected byte[] i_s -
i_c
protected byte[] i_c -
hash
-
k
protected byte[] k -
h
protected byte[] h -
expected
protected byte expected -
RANDLONLEN
private int RANDLONLEN -
KLEN
private int KLEN -
randomc
protected byte[] randomc
-
-
Constructor Details
-
SM2Client
public SM2Client() -
SM2Client
-
-
Method Details
-
setSession
-
init
Description copied from interface:KeyExchangeInitialize the key exchange algorithm.- Specified by:
initin interfaceKeyExchange- Parameters:
v_s- the server identification stringv_c- the client identification stringi_s- the server key initialization packeti_c- the client key initialization packet- Throws:
Exception- if an error occurs
-
next
Description copied from interface:KeyExchangeProcess the next packet- Specified by:
nextin interfaceKeyExchange- Parameters:
cmd- the commandbuffer- the packet contents positioned after the command- Returns:
- a boolean indicating if the processing is complete or if more packets are to be received
- Throws:
Exception- if an error occurs
-
getSession
- Specified by:
getSessionin interfaceSessionHolder<Session>
-
getHash
Description copied from interface:KeyExchangeThe message digest used by this key exchange algorithm.- Specified by:
getHashin interfaceKeyExchange- Returns:
- the message digest
-
getH
public byte[] getH()Description copied from interface:KeyExchangeRetrieves the computedhparameter- Specified by:
getHin interfaceKeyExchange- Returns:
- The
hparameter
-
getK
public byte[] getK()Description copied from interface:KeyExchangeRetrieves the computed k parameter- Specified by:
getKin interfaceKeyExchange- Returns:
- The
kparameter
-
getName
- Specified by:
getNamein interfaceNamedResource- Returns:
- The resource name
-