Ejemplo n.º 1
0
        public DSAKeyPair(BigInteger p, BigInteger g, BigInteger q, BigInteger x)
        {
            BigInteger y = g.modPow(x, p);

            _publickey = new DSAPublicKey(p, g, q, y);
            _x         = x;
        }
Ejemplo n.º 2
0
 public DSAKeyPair(BigInteger p, BigInteger g, BigInteger q, BigInteger y, BigInteger x)
 {
     _publickey = new DSAPublicKey(p, g, q, y);
     _x = x;
 }
Ejemplo n.º 3
0
 public DSAKeyPair(BigInteger p, BigInteger g, BigInteger q, BigInteger x)
 {
     BigInteger y = g.modPow(x, p);
     _publickey = new DSAPublicKey(p, g, q, y);
     _x = x;
 }
Ejemplo n.º 4
0
 public DSAKeyPair(BigInteger p, BigInteger g, BigInteger q, BigInteger y, BigInteger x)
 {
     _publickey = new DSAPublicKey(p, g, q, y);
     _x         = x;
 }
Ejemplo n.º 5
0
        private void VerifyHostKeyByDSS(SSH2DataReader pubkey, byte[] sigbody, byte[] hash)
        {
            BigInteger p = pubkey.ReadMPInt();
            BigInteger q = pubkey.ReadMPInt();
            BigInteger g = pubkey.ReadMPInt();
            BigInteger y = pubkey.ReadMPInt();
            Debug.Assert(pubkey.Rest==0);

            //Debug.WriteLine(p.ToHexString());
            //Debug.WriteLine(q.ToHexString());
            //Debug.WriteLine(g.ToHexString());
            //Debug.WriteLine(y.ToHexString());

            DSAPublicKey pk = new DSAPublicKey(p,g,q,y);
            pk.Verify(sigbody, HashAlgorithmProvider.OpenAlgorithm(HashAlgorithmNames.Sha1).HashData(hash.AsBuffer()).ToArray());
            _cInfo._hostkey = pk;
        }