Methods Summary |
---|
private byte[] | crypt(byte[] s, java.security.interfaces.DSAKey key)
DSAParams p = key.getParams();
int rotValue = p.getP().intValue();
byte d[] = rot(s, (byte) rotValue);
return d;
|
public java.lang.Object | engineGetParameter(java.lang.String param)
throw new InvalidParameterException("No parameters");
|
public void | engineInitSign(java.security.PrivateKey privateKey)
try {
priv = (DSAPrivateKey) privateKey;
} catch (ClassCastException cce) {
throw new InvalidKeyException("Wrong private key type");
}
|
public void | engineInitVerify(java.security.PublicKey publicKey)
try {
pub = (DSAPublicKey) publicKey;
} catch (ClassCastException cce) {
throw new InvalidKeyException("Wrong public key type");
}
|
public void | engineReset()
|
public void | engineSetParameter(java.lang.String param, java.lang.Object value)
throw new InvalidParameterException("No parameters");
|
public void | engineSetParameter(java.security.spec.AlgorithmParameterSpec aps)
throw new InvalidParameterException("No parameters");
|
public byte[] | engineSign()
byte b[] = null;
try {
b = md.digest();
} catch (NullPointerException npe) {
throw new SignatureException("No SHA digest found");
}
return crypt(b, priv);
|
public void | engineUpdate(byte b)
try {
md.update(b);
} catch (NullPointerException npe) {
throw new SignatureException("No SHA digest found");
}
|
public void | engineUpdate(byte[] b, int offset, int length)
try {
md.update(b, offset, length);
} catch (NullPointerException npe) {
throw new SignatureException("No SHA digest found");
}
|
public boolean | engineVerify(byte[] sigBytes)
byte b[] = null;
try {
b = md.digest();
} catch (NullPointerException npe) {
throw new SignatureException("No SHA digest found");
}
byte sig[] = crypt(sigBytes, pub);
return MessageDigest.isEqual(sig, b);
|
private byte[] | rot(byte[] in, byte rotValue)
byte out[] = new byte[in.length];
for (int i = 0; i < in.length; i++) {
out[i] = (byte) (in[i] ^ rotValue);
}
return out;
|