Package com.subgraph.orchid.circuits.hs

Examples of com.subgraph.orchid.circuits.hs.HSDescriptorCookie


   
    assertNull(config.getHidServAuth(onion));
   
    config.addHidServAuth(onion, descriptor);
   
    HSDescriptorCookie cookie = config.getHidServAuth(onion);
    assertNotNull(cookie);
    assertEquals(hex, new String(Hex.encode(cookie.getValue())));
    assertSame(cookie, config.getHidServAuth(address));
  }
View Full Code Here


public class TorConfigHSAuth {
 
  private final Map<String, HSDescriptorCookie> map = new HashMap<String, HSDescriptorCookie>();

  void add(String key, String b64Value) {
    final HSDescriptorCookie cookie = createFromBase64(b64Value);
    final String k = validateKey(key);
    map.put(k, cookie);
  }
View Full Code Here

    final int flag = (lastByte & 0xFF) >> 4;
    final byte[] cookie = new byte[decoded.length - 1];
    System.arraycopy(decoded, 0, cookie, 0, cookie.length);
    switch(flag) {
    case 0:
      return new HSDescriptorCookie(CookieType.COOKIE_BASIC, cookie);
    case 1:
      return new HSDescriptorCookie(CookieType.COOKIE_STEALTH, cookie);
    default:
      throw new TorException("Illegal cookie descriptor with flag value: "+ flag);
    }
  }
View Full Code Here

TOP

Related Classes of com.subgraph.orchid.circuits.hs.HSDescriptorCookie

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.