Exemplo n.º 1
0
        public SecureBuffer CreateSignature(SignatureAndHashAlgorithm type, AsymmetricAlgorithm key)
        {
            var algorithm = GetAlgorithm(type.Hash);

            using (var hash = new SecureBuffer(algorithm.GetRunningHash()))
                return(SignatureHelper.CreateSignature(type, (HashAlgorithm)algorithm, hash, key));
        }
Exemplo n.º 2
0
        void CreateServer(TlsContext ctx)
        {
            dh = new DiffieHellmanManaged();
            Y  = dh.CreateKeyExchange();
            var dhparams = dh.ExportParameters(true);

            P = dhparams.P;
            G = dhparams.G;

            using (var buffer = CreateParameterBuffer(ctx.HandshakeParameters))
                Signature = SignatureHelper.CreateSignature(SignatureAlgorithm, buffer, ctx.Configuration.PrivateKey);
        }
Exemplo n.º 3
0
 public override void Create(byte[] hash, AsymmetricAlgorithm key)
 {
     Signature = SignatureHelper.CreateSignature(HashAlgorithmType.Md5Sha1, hash, key);
 }
Exemplo n.º 4
0
 public override void Create(byte[] hash, AsymmetricAlgorithm key)
 {
     Signature = SignatureHelper.CreateSignature(SignatureAlgorithm, hash, key);
 }