Package freenet.crypt

Examples of freenet.crypt.MasterSecret


      return new DatabaseKey(databaseKey, random);
  }

  /** Used for creating keys for persistent encrypted tempfiles */
    public MasterSecret getPersistentMasterSecret() {
        return new MasterSecret(tempfilesMasterSecret.clone());
    }
View Full Code Here


        File keysFile = new File(base, "test.master.keys");
        DummyRandomSource random = new DummyRandomSource(77391);
        MasterKeys original = MasterKeys.read(keysFile, random, password);
        byte[] clientCacheMasterKey = original.clientCacheMasterKey;
        DatabaseKey dkey = original.createDatabaseKey(random);
        MasterSecret tempfileMasterSecret = original.getPersistentMasterSecret();
        MasterKeys restored = MasterKeys.read(keysFile, random, password);
        assertArrayEquals(clientCacheMasterKey, restored.clientCacheMasterKey);
        assertEquals(dkey,restored.createDatabaseKey(random));
        assertEquals(tempfileMasterSecret, restored.getPersistentMasterSecret());
    }
View Full Code Here

        File keysFile = new File(base, "test.master.keys");
        DummyRandomSource random = new DummyRandomSource(77391);
        MasterKeys original = MasterKeys.read(keysFile, random, oldPassword);
        byte[] clientCacheMasterKey = original.clientCacheMasterKey;
        DatabaseKey dkey = original.createDatabaseKey(random);
        MasterSecret tempfileMasterSecret = original.getPersistentMasterSecret();
        // Change password.
        original.changePassword(keysFile, newPassword, random);
        // Now restore.
        if(!oldPassword.equals(newPassword)) {
            try {
View Full Code Here

            }
        });
       
        initDiskSpaceLimits(nodeConfig, sortOrder);
       
        cryptoSecretTransient = new MasterSecret();
        tempBucketFactory = new TempBucketFactory(node.executor, tempFilenameGenerator, nodeConfig.getLong("maxRAMBucketSize"), nodeConfig.getLong("RAMBucketPoolSize"), node.fastWeakRandom, nodeConfig.getBoolean("encryptTempBuckets"), minDiskFreeShortTerm, cryptoSecretTransient);

        bandwidthStatsPutter = new PersistentStatsPutter();
       
    clientLayerPersister = new ClientLayerPersister(node.executor, node.ticker,
View Full Code Here

    dbFile = userDir.file("node.db4o");
    dbFileCrypt = userDir.file("node.db4o.crypt");

        byte[] clientCacheKey = null;
       
        MasterSecret persistentSecret = null;
        for(int i=0;i<2; i++) {

            try {
                if(securityLevels.physicalThreatLevel == PHYSICAL_THREAT_LEVEL.MAXIMUM) {
                    keys = MasterKeys.createRandom(secureRandom);
View Full Code Here

    }
    setPasswordInner(k, inFirstTimeWizard);
  }

  private void setPasswordInner(MasterKeys keys, boolean inFirstTimeWizard) throws MasterKeysWrongPasswordException, MasterKeysFileSizeException, IOException {
      MasterSecret secret = keys.getPersistentMasterSecret();
        clientCore.setupMasterSecret(secret);
    boolean wantClientCache = false;
    boolean wantDatabase = false;
    synchronized(this) {
      wantClientCache = clientCacheAwaitingPassword;
View Full Code Here

    @Override
    public LockableRandomAccessBuffer makeRAF(long size) throws IOException {
        long realSize = size;
        long paddedSize = size;
        MasterSecret secret = null;
        synchronized(this) {
            if(reallyEncrypt && this.secret != null) {
                secret = this.secret;
                realSize += TempBucketFactory.CRYPT_TYPE.headerLen;
                paddedSize = PaddedEphemerallyEncryptedBucket.paddedLength(realSize, PaddedEphemerallyEncryptedBucket.MIN_PADDED_SIZE);
View Full Code Here

TOP

Related Classes of freenet.crypt.MasterSecret

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.