EncryptedStorage
class EncryptedStorage<Path>(fs: FileSystemProvider.ReadWrite<Path>, encryption: Encryption) : Storage<Path> (source)
Secure implementation of Storage that provides transparent encryption of stored data. This implementation is suitable for sensitive information that needs to be protected at rest.
Security features:
Transparent encryption/decryption
No plaintext storage on disk
Support for various encryption algorithms
Secure error handling
Usage example:
val storage = EncryptedStorage(
fs = JVMFileSystemProvider,
encryption = Aes256GCMEncryption(secretKey)
)
// Store sensitive data
storage.write(secretPath, "sensitive information")
// Read encrypted data
val decrypted = storage.read(secretPath)
Content copied to clipboard
Parameters
Path
Platform-specific path type
fs
File system provider for I/O operations
encryption
Service for data encryption/decryption