com.mindbright.ssh2
public abstract class SSH2SimpleSignature extends SSH2Signature
Modifier and Type | Field and Description |
---|---|
protected boolean |
draftIncompatibleSignature |
protected java.lang.String |
signatureAlgorithm |
protected java.lang.String |
ssh2KeyFormat |
algorithm, pubKeyBlob, publicKey, signature
Modifier | Constructor and Description |
---|---|
protected |
SSH2SimpleSignature(java.lang.String signatureAlgorithm,
java.lang.String ssh2KeyFormat)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
byte[] |
decodeSignature(byte[] sigBlob)
Decode a signature encoded according to the ssh standard.
|
byte[] |
encodeSignature(byte[] sigRaw)
Encode the given signature into the form specified by the ssh
standard.
|
static java.lang.String |
getKeyFormat(byte[] pubKeyBlob)
Get the key format of the given public key.
|
java.lang.String |
getSignatureAlgorithm()
Get the signature algorithm name.
|
static SSH2Signature |
getVerifyInstance(byte[] pubKeyBlob)
Get an instance of
SSH2Signature which is prepared to
do a verify operation which the given public key. |
void |
setIncompatibility(SSH2Transport transport)
Set the appropriate incompatibility mode which depends on the
peer version.
|
clearSensitiveData, decodePublicKey, encodePublicKey, getAlgorithmName, getEncodingInstance, getInstance, getPublicKey, getPublicKeyBlob, initSign, initVerify, initVerify, setPublicKey, sign, verify
protected java.lang.String signatureAlgorithm
protected java.lang.String ssh2KeyFormat
protected boolean draftIncompatibleSignature
protected SSH2SimpleSignature(java.lang.String signatureAlgorithm, java.lang.String ssh2KeyFormat)
signatureAlgorithm
- The algorithm name to use when looking in
the crypto provider for the implementation.ssh2KeyFormat
- The ssh2 name for this algorithm.public static SSH2Signature getVerifyInstance(byte[] pubKeyBlob) throws SSH2Exception
SSH2Signature
which is prepared to
do a verify operation which the given public key.pubKeyBlob
- Blob containing the public key to use.SSH2Exception
public final java.lang.String getSignatureAlgorithm()
getSignatureAlgorithm
in class SSH2Signature
public byte[] encodeSignature(byte[] sigRaw)
encodeSignature
in class SSH2Signature
sigRaw
- The signature as a raw byte array.public byte[] decodeSignature(byte[] sigBlob) throws SSH2SignatureException
decodeSignature
in class SSH2Signature
sigBlob
- a signature blob encoded according to the ssh standard.SSH2SignatureException
public static java.lang.String getKeyFormat(byte[] pubKeyBlob)
pubKeyBlob
- the public key blob (encoded accoring to the
ssh standard).public void setIncompatibility(SSH2Transport transport)
setIncompatibility
in interface SSH2PKISigner
setIncompatibility
in class SSH2Signature
transport
- SSH2Transport
object which
identifies the peer.