Package freenet.keys

Examples of freenet.keys.ClientSSK


    for(int i=0;i<5;i++) {
      String test = "test" + i;
      ClientSSKBlock block = encodeBlockSSK(test, random);
      SSKBlock sskBlock = (SSKBlock) block.getBlock();
      store.put(sskBlock, false, false);
      ClientSSK key = block.getClientKey();
      NodeSSK ssk = (NodeSSK) key.getNodeKey();
      pubkeyCache.cacheKey(ssk.getPubKeyHash(), ssk.getPubKey(), false, false, false, false, false);
      SSKBlock verify = store.fetch(ssk, false, false, false, false, null);
      String data = decodeBlockSSK(verify, key);
      assertEquals(test, data);
    }
View Full Code Here


    } catch (KeyCollisionException e) {
      assertTrue(false);
     
    }
   
    ClientSSK key = block1.getClientKey();
    pubkeyCache.cacheKey(sskBlock.getKey().getPubKeyHash(), sskBlock.getKey().getPubKey(), false, false, false, false, false);
    // Check that it's in the cache, *not* the underlying store.
    NodeSSK ssk = (NodeSSK) key.getNodeKey();
    SSKBlock verify = store.fetch(ssk, false, false, false, false, null);
    String data = decodeBlockSSK(verify, key);
    assertEquals(test1, data);
   
    saltStore.close();
View Full Code Here

    for(int i=0;i<5;i++) {
      String test = "test" + i;
      ClientSSKBlock block = encodeBlockSSK(test, random);
      SSKBlock sskBlock = (SSKBlock) block.getBlock();
      store.put(sskBlock, false, false);
      ClientSSK key = block.getClientKey();
      NodeSSK ssk = (NodeSSK) key.getNodeKey();
      pubkeyCache.cacheKey(ssk.getPubKeyHash(), ssk.getPubKey(), false, false, false, false, false);
      // Check that it's in the cache, *not* the underlying store.
      assertEquals(saltStore.fetch(ssk.getRoutingKey(), ssk.getFullKey(), false, false, false, false, null), null);
      SSKBlock verify = store.fetch(ssk, false, false, false, false, null);
      String data = decodeBlockSSK(verify, key);
View Full Code Here

   

    for(int i=0;i<5;i++) {
      String test = tests.remove(0); //get the first element
      ClientSSKBlock block = sskBlocks.remove(0); //get the first element
      ClientSSK key = block.getClientKey();
      NodeSSK ssk = (NodeSSK) key.getNodeKey();
      SSKBlock verify = store.fetch(ssk, false, false, false, false, null);
      String data = decodeBlockSSK(verify, key);
      assertEquals(test, data);
    }
   
View Full Code Here

    }
   
    for(int i=0;i<5;i++) {
      String test = tests.remove(0); //get the first element
      ClientSSKBlock block = sskBlocks.remove(0); //get the first element
      ClientSSK key = block.getClientKey();
      NodeSSK ssk = (NodeSSK) key.getNodeKey();
      SSKBlock verify = store.fetch(ssk, false, false, false, false, null);
      String data = decodeBlockSSK(verify, key);
      assertEquals(test, data);
    }
   
View Full Code Here

    } catch (KeyCollisionException e) {
      assertTrue(false);
     
    }
   
    ClientSSK key = block1.getClientKey();
    pubkeyCache.cacheKey(sskBlock.getKey().getPubKeyHash(), sskBlock.getKey().getPubKey(), false, false, false, false, false);
    // Check that it's in the cache, *not* the underlying store.
    NodeSSK ssk = (NodeSSK) key.getNodeKey();
    SSKBlock verify = store.fetch(ssk, false, false, false, false, null);
    String data = decodeBlockSSK(verify, key);
    assertEquals(test1, data);
   
    if(useSlotFilter) {
View Full Code Here

        if(onStartup) arkNo++;
        // this is the number of the ref we are parsing.
        // we want the number of the next edition.
        // on startup we want to fetch the old edition in case there's been a corruption.
        FreenetURI uri = new FreenetURI(arkPubKey);
        ClientSSK ssk = new ClientSSK(uri);
        ark = new USK(ssk, arkNo);
      } else if(forDiffNodeRef && arkPubKey == null && myARK != null && arkNo > -1) {
        // get the ARK URI from the previous ARK and the edition from the SFS
        ark = myARK.copy(arkNo);
      } else if(forDiffNodeRef && arkPubKey != null && myARK != null && arkNo <= -1) {
View Full Code Here

        return new USKStoreChecker(checkers);
      else return null;
    }

    public ClientSSKBlock decode(SSKBlock block, long edition) throws SSKVerifyException {
      ClientSSK csk = origUSK.getSSK(edition);
      assert(Arrays.equals(csk.ehDocname, block.getKey().getKeyBytes()));
      return ClientSSKBlock.construct(block, csk);
    }
View Full Code Here

          }
          if(alreadyRunning.remove(l)) {
            if(logDEBUG) Logger.debug(this, "Ignoring (2): "+l);
            continue;
          }
          ClientSSK key;
          // FIXME reuse ehDocnames somehow
          // The problem is we need a ClientSSK for the high level stuff.
          key = origUSK.getSSK(ed);
          l.key = key;
          l.ignoreStore = true;
View Full Code Here

    @Override
    public void onFoundEdition(long l, USK newUSK, ClientContext context, boolean metadata, short codec, byte[] data, boolean newKnownGood, boolean newSlotToo) {
      if(l < usk.suggestedEdition && datastoreOnly)
        l = usk.suggestedEdition;
      ClientSSK key = usk.getSSK(l);
      try {
        if(l == usk.suggestedEdition) {
          SingleFileFetcher sf = new SingleFileFetcher(parent, cb, null, key, metaStrings, key.getURI().addMetaStrings(metaStrings),
              0, ctx, false, realTimeFlag, actx, null, null, maxRetries, recursionLevel+1, dontTellClientGet, token, false, true, false, (short)0, context, false);
          if(tag != null) {
            cb.onTransition(tag, sf, context);
          }
          sf.schedule(context);
View Full Code Here

TOP

Related Classes of freenet.keys.ClientSSK

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.