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
public abstract class SignatureRSA extends AbstractSignature
RSASignature
- Author:
- Apache MINA SSHD Project
- See Also:
- RFC4253 section 6.6
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
SignatureRSA(String algorithm)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected int
getVerifierSignatureSize()
static int
getVerifierSignatureSize(RSAKey key)
void
initVerifier(SessionContext session, PublicKey key)
boolean
verify(SessionContext session, byte[] sig)
Verify against the given signature-
Methods inherited from class org.apache.sshd.common.signature.AbstractSignature
doInitSignature, doVerify, extractEncodedSignature, getAlgorithm, getSignature, initSigner, sign, toString, update
-
-
-
-
Constructor Detail
-
SignatureRSA
protected SignatureRSA(String algorithm)
-
-
Method Detail
-
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
public void initVerifier(SessionContext session, PublicKey key) throws Exception
- 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
public static int getVerifierSignatureSize(RSAKey key)
-
verify
public boolean verify(SessionContext session, byte[] sig) throws Exception
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
-
-