com.mindbright.ssh2
public final class SSH2DSS extends SSH2SimpleSignature
| Modifier and Type | Class and Description |
|---|---|
static class |
SSH2DSS.DSASIG |
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
SSH2_KEY_FORMAT |
draftIncompatibleSignature, signatureAlgorithm, ssh2KeyFormatalgorithm, pubKeyBlob, publicKey, signature| Constructor and Description |
|---|
SSH2DSS()
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
java.security.PublicKey |
decodePublicKey(byte[] pubKeyBlob)
Decode a public key blob.
|
byte[] |
encodePublicKey(java.security.PublicKey publicKey)
Encode the given public key into a public key blob.
|
byte[] |
sign(byte[] data)
Sign the given data.
|
boolean |
verify(byte[] sigBlob,
byte[] data)
Verify that the given signature matches the given data and the
public key.
|
decodeSignature, encodeSignature, getKeyFormat, getSignatureAlgorithm, getVerifyInstance, setIncompatibilityclearSensitiveData, getAlgorithmName, getEncodingInstance, getInstance, getPublicKey, getPublicKeyBlob, initSign, initVerify, initVerify, setPublicKeypublic static final java.lang.String SSH2_KEY_FORMAT
public byte[] encodePublicKey(java.security.PublicKey publicKey)
throws SSH2Exception
SSH2SignatureencodePublicKey in class SSH2SignaturepublicKey - The public key to encode. Must be an instance of
DSAPublicKey.SSH2Exceptionpublic java.security.PublicKey decodePublicKey(byte[] pubKeyBlob)
throws SSH2Exception
SSH2SignaturedecodePublicKey in class SSH2SignaturepubKeyBlob - A byte array containing a public key blob.Publickey instance.SSH2Exceptionpublic byte[] sign(byte[] data)
throws SSH2SignatureException
SSH2Signaturesign in interface SSH2PKISignersign in class SSH2Signaturedata - Data to sign.SSH2SignatureExceptionpublic boolean verify(byte[] sigBlob,
byte[] data)
throws SSH2SignatureException
SSH2Signatureverify in class SSH2SignaturesigBlob - Signature blob encoded in the ssh format.data - Signed data.SSH2SignatureException