public void VerifySignatureAlgorithm (ITlsContext ctx, SignatureAndHashAlgorithm algorithm) { AssertTls12 (ctx); if (!ctx.IsAlgorithmSupported (algorithm)) throw new TlsException (AlertDescription.IlegalParameter); }
public void Add(SignatureAndHashAlgorithm algorithm) { SignatureAndHashAlgorithms.Add(algorithm); }
public virtual void AssertServerSignatureAlgorithm (ITlsContext ctx, SignatureAndHashAlgorithm algorithm) { if (ctx.IsServer) throw new InvalidOperationException (); AssertTls12 (ctx); VerifySignatureAlgorithm (ctx, algorithm); if (ctx.HasCurrentSignatureParameters && ctx.CurrentSignatureParameters != null) { if (!ctx.CurrentSignatureParameters.SignatureAndHashAlgorithms.Contains (algorithm)) throw new TlsException (AlertDescription.IlegalParameter); } else if (!algorithm.Equals (SignatureParameters.DefaultAlgorithm)) { throw new TlsException (AlertDescription.IlegalParameter); } }
public virtual void AssertCertificateVerifySignatureAlgorithm (ITlsContext ctx, SignatureAndHashAlgorithm algorithm) { if (!ctx.IsServer) throw new InvalidOperationException (); AssertTls12 (ctx); VerifySignatureAlgorithm (ctx, algorithm); ClientCertificateParameters parameters; if (ctx.HasClientCertificateParameters && ctx.ClientCertificateParameters != null) parameters = ctx.ClientCertificateParameters; else parameters = null; if (parameters != null && parameters.HasSignatureParameters && parameters.SignatureParameters != null) { if (!parameters.SignatureParameters.SignatureAndHashAlgorithms.Contains (algorithm)) throw new TlsException (AlertDescription.IlegalParameter); } else if (!algorithm.Equals (SignatureParameters.DefaultAlgorithm)) { throw new TlsException (AlertDescription.IlegalParameter); } }
public virtual void AssertClientSignatureAlgorithm (ITlsContext ctx, SignatureAndHashAlgorithm algorithm) { if (!ctx.IsServer) throw new InvalidOperationException (); AssertTls12 (ctx); VerifySignatureAlgorithm (ctx, algorithm); }
public bool IsAlgorithmSupported (SignatureAndHashAlgorithm algorithm) { if (HasNegotiatedProtocol && NegotiatedProtocol != TlsProtocolCode.Tls12) throw new TlsException (AlertDescription.IlegalParameter); return SignatureHelper.IsAlgorithmSupported (algorithm); }
public virtual void AssertCertificateVerifySignatureAlgorithm(ITlsContext ctx, SignatureAndHashAlgorithm algorithm) { if (!ctx.IsServer) { throw new InvalidOperationException(); } AssertTls12(ctx); VerifySignatureAlgorithm(ctx, algorithm); ClientCertificateParameters parameters; if (ctx.HasClientCertificateParameters && ctx.ClientCertificateParameters != null) { parameters = ctx.ClientCertificateParameters; } else { parameters = null; } if (parameters != null && parameters.HasSignatureParameters && parameters.SignatureParameters != null) { if (!parameters.SignatureParameters.SignatureAndHashAlgorithms.Contains(algorithm)) { throw new TlsException(AlertDescription.IlegalParameter); } } else if (!algorithm.Equals(SignatureParameters.DefaultAlgorithm)) { throw new TlsException(AlertDescription.IlegalParameter); } }
public void Add (SignatureAndHashAlgorithm algorithm) { SignatureAndHashAlgorithms.Add (algorithm); }
protected override SignatureAndHashAlgorithm SelectSignatureAlgorithm () { var algorithm = base.SelectSignatureAlgorithm (); DebugHelper.WriteLine ("SIGNATURE ALGORITHM: {0}", algorithm); algorithm = new SignatureAndHashAlgorithm (HashAlgorithmType.Sha1, SignatureAlgorithmType.Rsa); DebugHelper.WriteLine ("NEW SIGNATURE ALGORITHM: {0}", algorithm); return algorithm; }