Package freenet.crypt

Examples of freenet.crypt.EncryptedRandomAccessBucket


    private File getFile(TempBucket bucket) {
        if(!this.enableCrypto())
            return ((TempFileBucket)(((TempBucket) bucket).getUnderlying())).getFile();
        else {
            EncryptedRandomAccessBucket erab = (EncryptedRandomAccessBucket) bucket.getUnderlying();
            RandomAccessBucket b = erab.getUnderlying();
            if(b instanceof PaddedRandomAccessBucket) {
                b = ((PaddedRandomAccessBucket)b).getUnderlying();
            }
            return ((TempFileBucket) b).getFile();
        }
View Full Code Here


        case PaddedRandomAccessBucket.MAGIC:
            return new PaddedRandomAccessBucket(dis, fg, persistentFileTracker, masterKey);
        case RAFBucket.MAGIC:
            return new RAFBucket(dis, fg, persistentFileTracker, masterKey);
        case EncryptedRandomAccessBucket.MAGIC:
            return new EncryptedRandomAccessBucket(dis, fg, persistentFileTracker, masterKey);
        default:
            throw new StorageFormatException("Unknown magic value for bucket "+magic);
        }
    }
View Full Code Here

  private RandomAccessBucket _makeFileBucket() throws IOException {
    RandomAccessBucket ret = new TempFileBucket(filenameGenerator.makeRandomFilename(), filenameGenerator, true);
    // Do we want it to be encrypted?
    if(reallyEncrypt) {
            ret = new PaddedRandomAccessBucket(ret);
        ret = new EncryptedRandomAccessBucket(CRYPT_TYPE, ret, secret);
    }
    return ret;
  }
View Full Code Here

    if(rawBucket == null)
      rawBucket = new PersistentTempFileBucket(fg.makeRandomFilename(), fg, this);
    synchronized(encryptLock) {
        if(encrypt) {
                rawBucket = new PaddedRandomAccessBucket(rawBucket);
            rawBucket = new EncryptedRandomAccessBucket(TempBucketFactory.CRYPT_TYPE,
                    rawBucket, secret);
        }
    }
    if(mustWrap)
      rawBucket = new DelayedFreeRandomAccessBucket(this, rawBucket);
View Full Code Here

TOP

Related Classes of freenet.crypt.EncryptedRandomAccessBucket

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.