public boolean verifySignature(byte[] signature, byte[] data)
throws InvalidSignatureException {
try {
// Check for differing version of the transport protocol
if (signature.length != 40) {
ByteArrayReader bar = new ByteArrayReader(signature);
byte[] sig = bar.readBinaryString();
//if (log.isDebugEnabled()) {log.debug("Signature blob is " + new String(sig));}
String header = new String(sig);
if (log.isDebugEnabled())
log.debug("Header is " + header);
if (!header.equals("ssh-dss")) {
throw new InvalidSignatureException();
}
signature = bar.readBinaryString();
//if (log.isDebugEnabled()) {log.debug("Read signature from blob: " + new String(signature));}
}
// Using a SimpleASNWriter