Search in sources :

Example 1 with CryptoFileSystem

use of org.cryptomator.cryptofs.CryptoFileSystem in project cryptomator by cryptomator.

the class Vault method createCryptoFileSystem.

private CryptoFileSystem createCryptoFileSystem(CharSequence passphrase) throws IOException, CryptoException {
    CryptoFileSystemProperties fsProps = //
    CryptoFileSystemProperties.cryptoFileSystemProperties().withPassphrase(//
    passphrase).withMasterkeyFilename(//
    MASTERKEY_FILENAME).build();
    CryptoFileSystem fs = CryptoFileSystemProvider.newFileSystem(getPath(), fsProps);
    closer.closeLater(fs);
    return fs;
}
Also used : CryptoFileSystem(org.cryptomator.cryptofs.CryptoFileSystem) CryptoFileSystemProperties(org.cryptomator.cryptofs.CryptoFileSystemProperties)

Example 2 with CryptoFileSystem

use of org.cryptomator.cryptofs.CryptoFileSystem in project cryptomator by cryptomator.

the class Vault method lock.

public synchronized void lock() throws Exception {
    if (servlet != null) {
        servlet.stop();
    }
    CryptoFileSystem fs = cryptoFileSystem.getAndSet(null);
    if (fs != null) {
        fs.close();
    }
    Platform.runLater(() -> {
        unlocked.set(false);
    });
}
Also used : CryptoFileSystem(org.cryptomator.cryptofs.CryptoFileSystem)

Aggregations

CryptoFileSystem (org.cryptomator.cryptofs.CryptoFileSystem)2 CryptoFileSystemProperties (org.cryptomator.cryptofs.CryptoFileSystemProperties)1