Skip to content

Commit

Permalink
Added docs on crypto/shortening decorator classes
Browse files Browse the repository at this point in the history
  • Loading branch information
tobihagemann committed Jun 28, 2020
1 parent cfe3e67 commit 1cc2706
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
7 changes: 7 additions & 0 deletions CloudAccess/VaultFormat7/VaultFormat7ProviderDecorator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,13 @@ private extension URL {
}
}

/**
Cloud provider decorator for Cryptomator vaults in vault format 7 (without name shortening).

With this decorator, you can call the cloud provider methods with cleartext URLs (relative to `vaultURL`) and the decorator passes ciphertext URLs (absolute) to the delegate. It transparently encrypts/decrypts filenames and file contents according to vault format 7, see the security architecture page on [docs.cryptomator.org](https://docs.cryptomator.org/en/1.5/security/architecture/).

Use the factory methods to create a new crypto decorator. In order to be fully compatible with vault format 7, pass an instance of `VaultFormat7ShorteningProviderDecorator` (shortening decorator) as the delegate.
*/
public class VaultFormat7ProviderDecorator: CloudProvider {
let delegate: CloudProvider
let vaultURL: URL
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,13 @@ private extension URL {
}
}

/**
Cloud provider decorator for Cryptomator vaults in vault format 7 (only name shortening).

With this decorator, it is expected that the cloud provider methods are being called with ciphertext URLs. It transparently deflates/inflates filenames according to vault format 7, see the name shortening section at the security architecture page on [docs.cryptomator.org](https://docs.cryptomator.org/en/1.5/security/architecture/#name-shortening).

It's meaningless to use this shortening decorator without being decorated by an instance of `VaultFormat7ProviderDecorator` (crypto decorator). This shortening decorator explicitly only shortens the fourth path component relative `vaultURL`.
*/
public class VaultFormat7ShorteningProviderDecorator: CloudProvider {
let delegate: CloudProvider
let shortenedNameCache: VaultFormat7ShortenedNameCache
Expand Down

0 comments on commit 1cc2706

Please sign in to comment.