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 String
static final NavigableSet
<String> private int
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetSshAlgorithmName
(String algo) protected int
static int
void
initVerifier
(SessionContext session, PublicKey key) boolean
verify
(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:
initVerifier
in interfaceSignature
- Overrides:
initVerifier
in classAbstractSignature
- Parameters:
session
- TheSessionContext
for calling this method - may benull
if not called within a session contextkey
- ThePublicKey
to be used for verifying signatures- Throws:
Exception
- If failed to initialize
-
getVerifierSignatureSize
-
verify
Description copied from interface:Signature
Verify against the given signature- Parameters:
session
- TheSessionContext
for calling this method - may benull
if not called within a session contextsig
- The signed data- Returns:
true
if signature is valid- Throws:
Exception
- If failed to extract signed data for validation
-