Package org.apache.sshd.common.signature
Class AbstractSecurityKeySignature
java.lang.Object
org.apache.sshd.common.signature.AbstractSecurityKeySignature
- All Implemented Interfaces:
AlgorithmNameProvider,Signature
- Direct Known Subclasses:
SignatureSkECDSA,SignatureSkED25519
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate MessageDigestprivate static final intprivate final Stringprivate SecurityKeyPublicKey<?> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract Signatureprotected abstract StringvoidinitSigner(SessionContext session, PrivateKey key) voidinitVerifier(SessionContext session, PublicKey key) byte[]sign(SessionContext session) Compute the signaturevoidupdate(SessionContext session, byte[] hash, int off, int len) Update the computed signature with the given databooleanverify(SessionContext session, byte[] sig) Verify against the given signatureMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.sshd.common.AlgorithmNameProvider
getAlgorithmMethods inherited from interface org.apache.sshd.common.signature.Signature
getSshAlgorithmName, update
-
Field Details
-
FLAG_USER_PRESENCE
private static final int FLAG_USER_PRESENCE- See Also:
-
keyType
-
publicKey
-
challengeDigest
-
-
Constructor Details
-
AbstractSecurityKeySignature
-
-
Method Details
-
initVerifier
- Specified by:
initVerifierin interfaceSignature- Parameters:
session- TheSessionContextfor calling this method - may benullif not called within a session contextkey- ThePublicKeyto be used for verifying signatures- Throws:
GeneralSecurityException
-
update
Description copied from interface:SignatureUpdate the computed signature with the given data- Specified by:
updatein interfaceSignature- Parameters:
session- TheSessionContextfor calling this method - may benullif not called within a session contexthash- The hash data bufferoff- Offset of hash data in bufferlen- Length of hash data
-
getSignatureKeyType
-
getDelegateSignature
-
verify
Description copied from interface:SignatureVerify against the given signature- Specified by:
verifyin interfaceSignature- Parameters:
session- TheSessionContextfor calling this method - may benullif not called within a session contextsig- The signed data- Returns:
trueif signature is valid- Throws:
Exception- If failed to extract signed data for validation
-
initSigner
- Specified by:
initSignerin interfaceSignature- Parameters:
session- TheSessionContextfor calling this method - may benullif not called within a session contextkey- ThePrivateKeyto be used for signing
-
sign
Description copied from interface:SignatureCompute the signature- Specified by:
signin interfaceSignature- Parameters:
session- TheSessionContextfor calling this method - may benullif not called within a session context- Returns:
- The signature value
-