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, ssh2KeyFormat
algorithm, 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, setIncompatibility
clearSensitiveData, getAlgorithmName, getEncodingInstance, getInstance, getPublicKey, getPublicKeyBlob, initSign, initVerify, initVerify, setPublicKey
public static final java.lang.String SSH2_KEY_FORMAT
public byte[] encodePublicKey(java.security.PublicKey publicKey) throws SSH2Exception
SSH2Signature
encodePublicKey
in class SSH2Signature
publicKey
- The public key to encode. Must be an instance of
DSAPublicKey
.SSH2Exception
public java.security.PublicKey decodePublicKey(byte[] pubKeyBlob) throws SSH2Exception
SSH2Signature
decodePublicKey
in class SSH2Signature
pubKeyBlob
- A byte array containing a public key blob.Publickey
instance.SSH2Exception
public byte[] sign(byte[] data) throws SSH2SignatureException
SSH2Signature
sign
in interface SSH2PKISigner
sign
in class SSH2Signature
data
- Data to sign.SSH2SignatureException
public boolean verify(byte[] sigBlob, byte[] data) throws SSH2SignatureException
SSH2Signature
verify
in class SSH2Signature
sigBlob
- Signature blob encoded in the ssh format.data
- Signed data.SSH2SignatureException