Top Description Fields Constructors Methods
org.apache.sshd.common.signature

public abstract Class SignatureRSA

extends AbstractSignature
Class Inheritance
Known Direct Subclasses
org.apache.sshd.common.signature.SignatureRSASHA1, org.apache.sshd.common.signature.SignatureRSASHA256, org.apache.sshd.common.signature.SignatureRSASHA512
Imports
java.math.BigInteger, java.security.PublicKey, java.security.interfaces.RSAKey, java.util.Collections, .Map, .NavigableSet, .TreeSet, java.util.stream.Collectors, .Stream, org.apache.sshd.common.config.keys.KeyUtils, org.apache.sshd.common.keyprovider.KeyPairProvider, org.apache.sshd.common.session.SessionContext, org.apache.sshd.common.util.ValidateUtils

RSA Signature
Author
Apache MINA SSHD Project
See Also
RFC4253 section 6.6

Field Summary

Modifier and TypeField and Description
private final String
public static final NavigableSet<String>
private int

Constructor Summary

AccessConstructor and Description
protected
SignatureRSA(String algorithm, String sshAlgorithmName)

Method Summary

Modifier and TypeMethod and Description
public String
protected int

Returns:

The expected number of bytes in the signature - non-positive if not initialized or not intended to be used for verification
getVerifierSignatureSize
()

public static int
public void
initVerifier(SessionContext
The SessionContext for calling this method - may be null if not called within a session context
session
,
PublicKey
The PublicKey to be used for verifying signatures
key
)

Overrides org.apache.sshd.common.signature.AbstractSignature.initVerifier.

Implements org.apache.sshd.common.signature.Signature.initVerifier.

public boolean
verify(SessionContext
The SessionContext for calling this method - may be null if not called within a session context
session
,
byte[]
The signed data
sig
)

Implements org.apache.sshd.common.signature.Signature.verify.

Verify against the given signature

Inherited from org.apache.sshd.common.signature.AbstractSignature:
doInitSignaturedoVerifyextractEncodedSignatureextractEncodedSignaturegetAlgorithmgetSignatureinitSignersigntoStringupdate

Field Detail

sshAlgorithmNameback to summary
private final String sshAlgorithmName
SUPPORTED_KEY_TYPESback to summary
public static final NavigableSet<String> SUPPORTED_KEY_TYPES
verifierSignatureSizeback to summary
private int verifierSignatureSize

Constructor Detail

SignatureRSAback to summary
protected SignatureRSA(String algorithm, String sshAlgorithmName)

Method Detail

getSshAlgorithmNameback to summary
public String getSshAlgorithmName(String algo)

Overrides default org.apache.sshd.common.signature.Signature.getSshAlgorithmName.

Parameters
algo:String

Doc from org.apache.sshd.common.signature.Signature.getSshAlgorithmName.

- the negotiated value

Returns:String

Doc from org.apache.sshd.common.signature.Signature.getSshAlgorithmName.

The original ssh name of the signature algorithm

Annotations
@Override
getVerifierSignatureSizeback to summary
protected int getVerifierSignatureSize()
Returns:int

The expected number of bytes in the signature - non-positive if not initialized or not intended to be used for verification

getVerifierSignatureSizeback to summary
public static int getVerifierSignatureSize(RSAKey key)
initVerifierback to summary
public void initVerifier(SessionContext session, PublicKey key) throws Exception

Overrides org.apache.sshd.common.signature.AbstractSignature.initVerifier.

Implements org.apache.sshd.common.signature.Signature.initVerifier.

Parameters
session:SessionContext

Doc from org.apache.sshd.common.signature.Signature.initVerifier.

The SessionContext for calling this method - may be null if not called within a session context

key:PublicKey

Doc from org.apache.sshd.common.signature.Signature.initVerifier.

The PublicKey to be used for verifying signatures

Annotations
@Override
Exceptions
Exception:

Doc from org.apache.sshd.common.signature.Signature.initVerifier.

If failed to initialize

verifyback to summary
public boolean verify(SessionContext session, byte[] sig) throws Exception

Implements org.apache.sshd.common.signature.Signature.verify.

Doc from org.apache.sshd.common.signature.Signature.verify.

Verify against the given signature

Parameters
session:SessionContext

The SessionContext for calling this method - may be null if not called within a session context

sig:byte[]

The signed data

Returns:boolean

true if signature is valid

Annotations
@Override
Exceptions
Exception:
If failed to extract signed data for validation