The library contains contains RSA digital signature algorithm
- RSASignature(BigInteger p, BigInteger q, BigInteger privateexp, CryptoHash hashFunction)
- p,q - prime number
- privateexp - private exponent, 1 < p < (p-1)(q-1), gcd(privateexp, (p-1)(q-1)) = 1,
- hashFunction - The object to get the hash function (Must implement the interface CryptoHash)
-
BigInteger sign(byte[] message) - Sign an array of bytes
- return signature = hash(message)^d mod r
-
static boolean checkSignature(RSAPublicKey key, BigInteger signature, byte[] message, CryptoHash hashFunction) - Verifies signature validity