Пример #1
0
        static BufLen CreateKnCBuf(I2PKeysAndCert kns)
        {
            var ar  = kns.ToByteArray();
            var buf = new BufLen(I2PHashSHA256.GetHash(ar, 0, ar.Length));

            return(buf);
        }
Пример #2
0
        public I2PIdentHash(I2PKeysAndCert kns)
        {
            var ar = kns.ToByteArray();

            Hash       = new BufLen(I2PHashSHA256.GetHash(ar, 0, ar.Length));
            CachedHash = Hash.GetHashCode();
        }
Пример #3
0
 public I2PLeaseSet(I2PKeysAndCert dest, IEnumerable <I2PLease> leases, I2PLeaseInfo info)
 {
     Destination = dest;
     Leases      = new List <I2PLease>();
     if (leases != null)
     {
         Leases.AddRange(leases);
     }
     Info             = info;
     PublicKey        = info.PublicKey;
     PublicSigningKey = info.PublicSigningKey;
 }
Пример #4
0
        public I2PLeaseSet(BufRef reader)
        {
            Destination      = new I2PDestination(reader);
            PublicKey        = new I2PPublicKey(reader, I2PKeyType.DefaultAsymetricKeyCert);
            PublicSigningKey = new I2PSigningPublicKey(reader, Destination.Certificate);

            var leases     = new List <I2PLease>();
            int leasecount = reader.Read8();

            for (int i = 0; i < leasecount; ++i)
            {
                leases.Add(new I2PLease(reader));
            }
            Leases    = leases;
            Signature = new I2PSignature(reader, Destination.Certificate);
        }
Пример #5
0
 public I2PIdentHash(I2PKeysAndCert kns) : this(CreateKnCBuf(kns))
 {
 }