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

public Class SignatureDSA

extends AbstractSignature
Class Inheritance
Imports
java.io.StreamCorruptedException, java.math.BigInteger, java.security.SignatureException, java.util.Map, org.apache.sshd.common.keyprovider.KeyPairProvider, org.apache.sshd.common.session.SessionContext, org.apache.sshd.common.util.NumberUtils, .ValidateUtils, org.apache.sshd.common.util.buffer.BufferUtils, org.apache.sshd.common.util.io.der.DERParser, .DERWriter

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

Field Summary

Modifier and TypeField and Description
public static final String
public static final int
public static final int

Constructor Summary

AccessConstructor and Description
public
protected
SignatureDSA(String algorithm)

Method Summary

Modifier and TypeMethod and Description
public static void
putBigInteger(BigInteger value, byte[] result, int offset)

public byte[]
sign(SessionContext
The SessionContext for calling this method - may be null if not called within a session context
session
)

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

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

Compute the signature

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:
doInitSignaturedoVerifyextractEncodedSignatureextractEncodedSignaturegetAlgorithmgetSignatureinitSignerinitVerifiertoStringupdate

Field Detail

DEFAULT_ALGORITHMback to summary
public static final String DEFAULT_ALGORITHM
DSA_SIGNATURE_LENGTHback to summary
public static final int DSA_SIGNATURE_LENGTH
MAX_SIGNATURE_VALUE_LENGTHback to summary
public static final int MAX_SIGNATURE_VALUE_LENGTH

Constructor Detail

SignatureDSAback to summary
public SignatureDSA()
SignatureDSAback to summary
protected SignatureDSA(String algorithm)

Method Detail

putBigIntegerback to summary
public static void putBigInteger(BigInteger value, byte[] result, int offset)
signback to summary
public byte[] sign(SessionContext session) throws Exception

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

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

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

Compute the signature

Parameters
session:SessionContext

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

Returns:byte[]

The signature value

Annotations
@Override
Exceptions
Exception:
If failed to calculate the signature
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