VerifySignature() abstract public method

abstract public VerifySignature ( byte rgbHash, byte rgbSignature ) : bool
rgbHash byte
rgbSignature byte
return bool
コード例 #1
0
 // Verify the signature for a specific hash value.
 public override bool VerifySignature(byte[] rgbHash, byte[] rgbSignature)
 {
     if (keyContainer == null)
     {
         throw new CryptographicException
                   (_("Crypto_MissingKey"));
     }
     return(keyContainer.VerifySignature(rgbHash, rgbSignature));
 }
コード例 #2
0
        public override bool VerifySignature(byte[] rgbHash, byte[] rgbSignature)
        {
            if (dsa == null)
            {
                throw new CryptographicUnexpectedOperationException(
                          Locale.GetText("missing key"));
            }

            return(dsa.VerifySignature(rgbHash, rgbSignature));
        }
コード例 #3
0
        public bool VerifyHash(byte[] rgbHash, string str, byte[] rgbSignature)
        {
            if (rgbHash == null)
            {
                throw new ArgumentNullException(nameof(rgbHash));
            }
            if (rgbSignature == null)
            {
                throw new ArgumentNullException(nameof(rgbSignature));
            }

            // For compat with Windows, no check for rgbHash.Length != SHA1_HASHSIZE

            // Only SHA1 allowed; the default value is SHA1
            if (str != null && string.Compare(str, "SHA1", StringComparison.OrdinalIgnoreCase) != 0)
            {
                throw new CryptographicException(SR.Cryptography_UnknownHashAlgorithm, str);
            }

            return(_impl.VerifySignature(rgbHash, rgbSignature));
        }
コード例 #4
0
        public override bool VerifySignature(byte[] rgbHash, byte[] rgbSignature)
        {
            if (rgbHash == null)
            {
                throw new ArgumentNullException(nameof(rgbHash));
            }
            if (rgbSignature == null)
            {
                throw new ArgumentNullException(nameof(rgbSignature));
            }
            if (_dsaKey == null)
            {
                throw new CryptographicUnexpectedOperationException(SR.Cryptography_MissingKey);
            }

            return(_dsaKey.VerifySignature(rgbHash, rgbSignature));
        }
コード例 #5
0
        public override bool VerifySignature(byte[] rgbHash, byte[] rgbSignature)
        {
            if (rgbHash == null)
            {
                throw new ArgumentNullException("rgbHash");
            }
            if (rgbSignature == null)
            {
                throw new ArgumentNullException("rgbSignature");
            }
            Contract.EndContractBlock();

            if (_dsaKey == null)
            {
                throw new CryptographicUnexpectedOperationException(Environment.GetResourceString("Cryptography_MissingKey"));
            }

            return(_dsaKey.VerifySignature(rgbHash, rgbSignature));
        }
コード例 #6
0
        public override bool Verify(Signature signature)
        {
            //Verify the signature's type is an RSA signature.
            if (!(signature is DSASignature))
            {
                throw new SecurityException("Signature is not an DSA signature.");
            }

            //Verify the identity of the signature matches this signature algorithm.
            if (!signature.Identity.Equals(identity))
            {
                throw new SecurityException("Signature's identity does not match.");
            }

            //Synchronize around the hash algorithm to prevent collisions.
            lock (hashAlgorithm)
            {
                //Initialize the hash algorithm.
                hashAlgorithm.Initialize();

                //Verify the signature, re-computing the hash and supplying the given signature array.
                return(dsa.VerifySignature(hashAlgorithm.ComputeHash(signature.Data), ((DSASignature)signature).Signature));
            }
        }
コード例 #7
0
ファイル: DSAWrapper.cs プロジェクト: z77ma/runtime
 public override bool VerifySignature(byte[] rgbHash, byte[] rgbSignature) =>
 _wrapped.VerifySignature(rgbHash, rgbSignature);