예제 #1
0
        public void VerifySignatureAlgorithm(ITlsContext ctx, SignatureAndHashAlgorithm algorithm)
        {
            AssertTls12(ctx);

            if (!ctx.IsAlgorithmSupported(algorithm))
            {
                throw new TlsException(AlertDescription.IlegalParameter);
            }
        }
예제 #2
0
 public void VerifySignatureParameters(ITlsContext ctx, SignatureParameters parameters)
 {
     foreach (var algorithm in parameters.SignatureAndHashAlgorithms)
     {
         if (!ctx.IsAlgorithmSupported(algorithm))
         {
             throw new TlsException(AlertDescription.IlegalParameter);
         }
     }
 }
예제 #3
0
        public SignatureAndHashAlgorithm SelectSignatureAlgorithm(ITlsContext ctx, SignatureParameters parameters)
        {
            AssertTls12(ctx);

            foreach (var algorithm in parameters.SignatureAndHashAlgorithms)
            {
                if (ctx.IsAlgorithmSupported(algorithm))
                {
                    return(algorithm);
                }
            }

            throw new TlsException(AlertDescription.IlegalParameter, "No supported signature type available.");
        }
예제 #4
0
		public void VerifySignatureParameters (ITlsContext ctx, SignatureParameters parameters)
		{
			foreach (var algorithm in parameters.SignatureAndHashAlgorithms) {
				if (!ctx.IsAlgorithmSupported (algorithm))
					throw new TlsException (AlertDescription.IlegalParameter);
			}
		}
예제 #5
0
		public void VerifySignatureAlgorithm (ITlsContext ctx, SignatureAndHashAlgorithm algorithm)
		{
			AssertTls12 (ctx);

			if (!ctx.IsAlgorithmSupported (algorithm))
				throw new TlsException (AlertDescription.IlegalParameter);
		}
예제 #6
0
		public SignatureAndHashAlgorithm SelectSignatureAlgorithm (ITlsContext ctx, SignatureParameters parameters)
		{
			AssertTls12 (ctx);

			foreach (var algorithm in parameters.SignatureAndHashAlgorithms) {
				if (ctx.IsAlgorithmSupported (algorithm))
					return algorithm;
			}

			throw new TlsException (AlertDescription.IlegalParameter, "No supported signature type available.");
		}