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)); }
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); } } }
public override bool Verify(byte[] hash, AsymmetricAlgorithm key) { return(SignatureHelper.VerifySignature(HashAlgorithmType.Md5Sha1, hash, key, Signature)); }
public override bool Verify(byte[] hash, AsymmetricAlgorithm key) { return(SignatureHelper.VerifySignature(SignatureAlgorithm, hash, key, Signature)); }