if (d.getCertificate().getCertificateType() != Certificate.CERTIFICATE_TYPE_SIGNED) return false; int len = PublicKey.KEYSIZE_BYTES + SigningPublicKey.KEYSIZE_BYTES; // no cert System.arraycopy(d.getSigningPublicKey().getData(), 0, data, PublicKey.KEYSIZE_BYTES, SigningPublicKey.KEYSIZE_BYTES); Signature sig = new Signature(); byte[] payload = d.getCertificate().getPayload(); Hash signerHash = null; if (payload == null) {
synchronized(_cache) { rv = _cache.get(sk); if (rv != null && rv.getPublicKey().equals(pk) && rv.getCertificate().equals(c)) {
Destination dest = _facade.lookupDestinationLocally(_key); if (dest != null) { Certificate cert = dest.getCertificate(); if (cert.getCertificateType() == Certificate.CERTIFICATE_TYPE_KEY) keyCert = cert;
} else { int itype = dest.getCertificate().getCertificateType(); SigType stype = SigType.getByCode(itype); if (stype == null || !stype.isAvailable()) {
LeaseSet ls = (LeaseSet) entry; Destination d = ls.getDestination(); Certificate c = d.getCertificate(); if (c.getCertificateType() == Certificate.CERTIFICATE_TYPE_KEY) { try {
/** * Creates a new <code>RelayPeer</code> with a given I2P destination and * an empty list of reachability data. * @param destination */ public RelayPeer(Destination destination) { // initialize the Destination part of the RelayPeer setCertificate(destination.getCertificate()); setSigningPublicKey(destination.getSigningPublicKey()); setPublicKey(destination.getPublicKey()); // initialize RelayPeer-specific data samples = new LinkedList<Boolean>(); }
KademliaPeer(Destination destination, long lastReception) { // initialize the Destination part of the KademliaPeer setCertificate(destination.getCertificate()); setSigningPublicKey(destination.getSigningPublicKey()); setPublicKey(destination.getPublicKey()); // initialize KademliaPeer-specific fields destinationHash = destination.calculateHash(); if (destinationHash == null) log.error("calculateHash() returned null!"); firstSeen = lastReception; }