Examples of asBytesHash()


Examples of freenet.crypt.DSAPublicKey.asBytesHash()

      } catch (IOException e) {
        throw new KeyVerifyException("Failed to construct pubkey: "+e, e);
      } catch (CryptFormatException e) {
        throw new KeyVerifyException("Failed to construct pubkey: "+e, e);
      }
      NodeSSK key = new NodeSSK(pubKey.asBytesHash(), keyBytes, pubKey, subtype);
      return new SSKBlock(dataBytes, headersBytes, key, false);
    } else {
      throw new KeyVerifyException("No such key type "+Integer.toHexString(type));
    }
  }
View Full Code Here

Examples of freenet.crypt.DSAPublicKey.asBytesHash()

      // DSAPrivateKey is invalid
      Logger.error(InsertableClientSSK.class, "Caught "+e, e);
      throw new MalformedURLException("SSK private key (routing key) is invalid: " + e);
    }
    DSAPublicKey pubKey = new DSAPublicKey(g, privKey);
    byte[] pkHash = pubKey.asBytesHash();
    return new InsertableClientSSK(uri.getDocName(), pkHash, pubKey, privKey, uri.getCryptoKey(), keyType);
  }
 
  public ClientSSKBlock encode(Bucket sourceData, boolean asMetadata, boolean dontCompress, short alreadyCompressedCodec, long sourceLength, RandomSource r, String compressordescriptor, boolean pre1254) throws SSKEncodeException, IOException, InvalidCompressionCodecException {
    byte[] compressedData;
View Full Code Here

Examples of freenet.crypt.DSAPublicKey.asBytesHash()

    Random random = new MersenneTwister(1010101);
    HashMap<ByteArrayWrapper, DSAPublicKey> map = new HashMap<ByteArrayWrapper, DSAPublicKey>();
    for(int i=0;i<keys;i++) {
      DSAPrivateKey privKey = new DSAPrivateKey(group, random);
      DSAPublicKey key = new DSAPublicKey(group, privKey);
      byte[] hash = key.asBytesHash();
      ByteArrayWrapper w = new ByteArrayWrapper(hash);
      map.put(w, key.cloneKey());
      pk.put(hash, key, false);
      assertTrue(pk.fetch(hash, false, false, null).equals(key));
    }
View Full Code Here

Examples of freenet.crypt.DSAPublicKey.asBytesHash()

    Random random = new MersenneTwister(1010101);
    HashMap<ByteArrayWrapper, DSAPublicKey> map = new HashMap<ByteArrayWrapper, DSAPublicKey>();
    for(int i=0;i<keys;i++) {
      DSAPrivateKey privKey = new DSAPrivateKey(group, random);
      DSAPublicKey key = new DSAPublicKey(group, privKey);
      byte[] hash = key.asBytesHash();
      ByteArrayWrapper w = new ByteArrayWrapper(hash);
      map.put(w, key.cloneKey());
      pubkeys.cacheKey(hash, key, false, false, false, false, false);
      assertTrue(pubkeys.getKey(hash, false, false, null).equals(key));
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.