Example #1
0
        /**
         * return true if the internal state represents the signature described
         * in the passed in array.
         */
        public bool verifySignature(byte[] signature)
        {
            byte[] hash = new byte[digest.getDigestSize()];
            digest.doFinal(hash, 0);

            BigInteger[] sig;

            try
            {
                sig = derDecode(signature);
            } catch
            {
                throw new Exception("Error decoding signature bytes.");
            }
            return(dsaSigner.verifySignature(hash, sig[0], sig[1]));
        }