コード例 #1
0
		public EllipticCurveKeyExchange (TlsContext context)
		{
			curveType = ECCurveType.named_curve;
			namedCurve = context.Configuration.UserSettings.NamedCurve ?? NamedCurve.secp256k1;
			domainParameters = NamedCurveHelper.GetECParameters (namedCurve);

			GenerateKeyPair (context, domainParameters, out serverQ, out serverD);
			publicBytes = ExternalizeKey (serverQ);

			Signature = new SignatureTls12 (context.Session.ServerSignatureAlgorithm);
			using (var buffer = CreateParameterBuffer (context.HandshakeParameters))
				Signature.Create (buffer, context.Configuration.PrivateKey);
		}
コード例 #2
0
        public EllipticCurveKeyExchange(TlsContext context)
        {
            curveType        = ECCurveType.named_curve;
            namedCurve       = context.Configuration.UserSettings.NamedCurve ?? NamedCurve.secp256k1;
            domainParameters = NamedCurveHelper.GetECParameters(namedCurve);

            GenerateKeyPair(context, domainParameters, out serverQ, out serverD);
            publicBytes = ExternalizeKey(serverQ);

            Signature = new SignatureTls12(context.Session.ServerSignatureAlgorithm);
            using (var buffer = CreateParameterBuffer(context.HandshakeParameters))
                Signature.Create(buffer, context.Configuration.PrivateKey);
        }