예제 #1
0
        public bool VerifySignature(SignatureAndHashAlgorithm type, AsymmetricAlgorithm key, SecureBuffer signature)
        {
            var algorithm = GetAlgorithm(type.Hash);

            using (var hash = new SecureBuffer(algorithm.GetRunningHash()))
                return(SignatureHelper.VerifySignature(type, (HashAlgorithm)algorithm, hash, key, signature));
        }
예제 #2
0
 public override void HandleServer(TlsContext ctx)
 {
     using (var buffer = CreateParameterBuffer(ctx.HandshakeParameters)) {
         var certificate = ctx.Session.PendingCrypto.ServerCertificates [0];
         if (!SignatureHelper.VerifySignature(SignatureAlgorithm, buffer, certificate.RSA, Signature))
         {
             throw new TlsException(AlertDescription.HandshakeFailure);
         }
     }
 }
예제 #3
0
 public override bool Verify(byte[] hash, AsymmetricAlgorithm key)
 {
     return(SignatureHelper.VerifySignature(HashAlgorithmType.Md5Sha1, hash, key, Signature));
 }
예제 #4
0
 public override bool Verify(byte[] hash, AsymmetricAlgorithm key)
 {
     return(SignatureHelper.VerifySignature(SignatureAlgorithm, hash, key, Signature));
 }