Package freenet.crypt

Examples of freenet.crypt.DSAPublicKey


    DSAGroup group = Global.DSAgroupBigA;
    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));
    }
    int x = 0;
    for(Map.Entry<ByteArrayWrapper, DSAPublicKey> entry : map.entrySet()) {
View Full Code Here


    final int CRYPTO_KEY_LENGTH = 32;
    byte[] ckey = new byte[CRYPTO_KEY_LENGTH];
    random.nextBytes(ckey);
    DSAGroup g = Global.DSAgroupBigA;
    DSAPrivateKey privKey = new DSAPrivateKey(g, random);
    DSAPublicKey pubKey = new DSAPublicKey(g, privKey);
    byte[] pkHash = SHA256.digest(pubKey.asBytes());
    String docName = "myDOC";
    InsertableClientSSK ik = new InsertableClientSSK(docName, pkHash, pubKey, privKey, ckey, Key.ALGO_AES_PCFB_256_SHA256);
   
    String test = "test";
    SimpleReadOnlyArrayBucket bucket = new SimpleReadOnlyArrayBucket(test.getBytes("UTF-8"));
View Full Code Here

    final int CRYPTO_KEY_LENGTH = 32;
    byte[] ckey = new byte[CRYPTO_KEY_LENGTH];
    random.nextBytes(ckey);
    DSAGroup g = Global.DSAgroupBigA;
    DSAPrivateKey privKey = new DSAPrivateKey(g, random);
    DSAPublicKey pubKey = new DSAPublicKey(g, privKey);
    byte[] pkHash = SHA256.digest(pubKey.asBytes());
    String docName = "myDOC";
    InsertableClientSSK ik = new InsertableClientSSK(docName, pkHash, pubKey, privKey, ckey, Key.ALGO_AES_PCFB_256_SHA256);
   
    String test = "test";
    SimpleReadOnlyArrayBucket bucket = new SimpleReadOnlyArrayBucket(test.getBytes("UTF-8"));
View Full Code Here

        throw new FSParseException("Changed DSA group?!");
    }

    sfs = fs.subset("dsaPubKey");
    if(sfs != null) {
      DSAPublicKey key;
      key = DSAPublicKey.create(sfs, peerCryptoGroup);
      if(!key.equals(this.peerPubKey))
        throw new FSParseException("Changed pubkey?!");
    }

    String newVersion = fs.get("version");
    if(newVersion == null) {
View Full Code Here

   */
  public void initCrypto() {
    MessageDigest md = SHA256.getMessageDigest();
    cryptoGroup = Global.DSAgroupBigA;
    privKey = new DSAPrivateKey(cryptoGroup, random);
    pubKey = new DSAPublicKey(cryptoGroup, privKey);
    myARK = InsertableClientSSK.createRandom(random, "ark");
    myARKNumber = 0;
    SHA256.returnMessageDigest(md);
    clientNonce = new byte[32];
    node.random.nextBytes(clientNonce);
View Full Code Here

TOP

Related Classes of freenet.crypt.DSAPublicKey

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.