Package org.apache.sshd.common.signature
Class SignatureRSA
java.lang.Object
org.apache.sshd.common.signature.AbstractSignature
org.apache.sshd.common.signature.SignatureRSA
- All Implemented Interfaces:
AlgorithmNameProvider,Signature
- Direct Known Subclasses:
SignatureRSASHA1,SignatureRSASHA256,SignatureRSASHA512
RSA
Signature- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Stringstatic final NavigableSet<String> private int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetSshAlgorithmName(String algo) protected intstatic intvoidinitVerifier(SessionContext session, PublicKey key) booleanverify(SessionContext session, byte[] sig) Verify against the given signatureMethods inherited from class org.apache.sshd.common.signature.AbstractSignature
doInitSignature, doVerify, extractEncodedSignature, extractEncodedSignature, getAlgorithm, getSignature, initSigner, sign, toString, update
-
Field Details
-
SUPPORTED_KEY_TYPES
-
verifierSignatureSize
private int verifierSignatureSize -
sshAlgorithmName
-
-
Constructor Details
-
SignatureRSA
-
-
Method Details
-
getSshAlgorithmName
- Parameters:
algo- - the negotiated value- Returns:
- The original ssh name of the signature algorithm
-
getVerifierSignatureSize
protected int getVerifierSignatureSize()- Returns:
- The expected number of bytes in the signature - non-positive if not initialized or not intended to be used for verification
-
initVerifier
- Specified by:
initVerifierin interfaceSignature- Overrides:
initVerifierin classAbstractSignature- Parameters:
session- TheSessionContextfor calling this method - may benullif not called within a session contextkey- ThePublicKeyto be used for verifying signatures- Throws:
Exception- If failed to initialize
-
getVerifierSignatureSize
-
verify
Description copied from interface:SignatureVerify against the given signature- 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
-