internal static SshUserAuthRequestPublicKey CreateForSignature(string username, IIdentityFile identity)
        {
            var p = new SshUserAuthRequestPublicKey(username, identity)
            {
                SignatureIncluded = true
            };

            return(p);
        }
示例#2
0
        public SshUserAuthRequestSignature(string username, IIdentityFile identity, byte[] sessionId)
            : base(username, identity)
        {
            var buffer = SshUserAuthRequestPublicKey.CreateForSignature(username, identity).ToSshMessage();

            using (var pw1 = new PacketWriter())
            {
                pw1.WriteString(sessionId);
                pw1.Write(buffer);
                using (var pw2 = new PacketWriter())
                {
                    pw2.WriteBytes(identity.AlgorithmName);
                    pw2.WriteString(identity.Sign(((MemoryStream)pw1.BaseStream).ToArray()));
                    Signature = ((MemoryStream)pw2.BaseStream).ToArray();
                }
            }
        }