Package freenet.keys

Examples of freenet.keys.NodeSSK


  }

  @Override
  public short definitelyWantKey(Key key, byte[] saltedKey, ClientContext context) {
    if(!(key instanceof NodeSSK)) return -1;
    NodeSSK k = (NodeSSK) key;
    if(!origUSK.samePubKeyHash(k))
      return -1;
    long lastSlot = uskManager.lookupLatestSlot(origUSK) + 1;
    synchronized(this) {
      if(watchingKeys.match(k, lastSlot) != -1) return progressPollPriority;
View Full Code Here


  }

  @Override
  public boolean probablyWantKey(Key key, byte[] saltedKey) {
    if(!(key instanceof NodeSSK)) return false;
    NodeSSK k = (NodeSSK) key;
    if(!origUSK.samePubKeyHash(k))
      return false;
    long lastSlot = uskManager.lookupLatestSlot(origUSK) + 1;
    synchronized(this) {
      return watchingKeys.match(k, lastSlot) != -1;
View Full Code Here

        // ehDocnames[0] is firstSlot
        // ehDocnames[checkFrom-firstSlot] is checkFrom
        int offset = (int)(checkFrom - firstSlot);
        NodeSSK[] keysToCheck = new NodeSSK[WATCH_KEYS - offset];
        for(int x=0, i=offset; i<WATCH_KEYS; i++, x++) {
          keysToCheck[x] = new NodeSSK(pubKeyHash, ehDocnames.get(i), cryptoAlgorithm);
        }
        return new StoreSubChecker(keysToCheck, checkFrom, checkTo);
      }
View Full Code Here

      byte[] routingKey, byte[] fullKey,
      boolean canReadClientCache, boolean canReadSlashdotCache, BlockMetadata meta, DSAPublicKey knownPublicKey)
  throws SSKVerifyException {
    if(data == null || headers == null) throw new SSKVerifyException("Need data and headers");
    if(fullKey == null) throw new SSKVerifyException("Need full key to reconstruct an SSK");
    NodeSSK key;
    key = NodeSSK.construct(fullKey);
    if(knownPublicKey != null)
      key.setPubKey(knownPublicKey);
    else if(!key.grabPubkey(pubkeyCache, canReadClientCache, canReadSlashdotCache, meta))
      throw new SSKVerifyException("No pubkey found");
    SSKBlock block = new SSKBlock(data, headers, key, false);
    return block;
  }
View Full Code Here

TOP

Related Classes of freenet.keys.NodeSSK

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.