static BufLen CreateKnCBuf(I2PKeysAndCert kns) { var ar = kns.ToByteArray(); var buf = new BufLen(I2PHashSHA256.GetHash(ar, 0, ar.Length)); return(buf); }
public I2PIdentHash(I2PKeysAndCert kns) { var ar = kns.ToByteArray(); Hash = new BufLen(I2PHashSHA256.GetHash(ar, 0, ar.Length)); CachedHash = Hash.GetHashCode(); }
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; }
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); }
public I2PIdentHash(I2PKeysAndCert kns) : this(CreateKnCBuf(kns)) { }