EncryptionManagerEncryptDocument Method |
Encrypts a file and automatically creates a new key or reuses the existing key.
If a new key was created, its key to decrypt the data will be returned.
Namespace:
PsrApi.Managers
Assembly:
PsrApi (in PsrApi.dll) Version: 9.3.0.33526 (08.10.2025)+e4d6269d444890d28afbdf39a4add0d0ad0df4f2
Syntaxpublic byte[] EncryptDocument(
PsrContainerItem container,
string plainFilePath,
string encryptedFilePath,
Func<byte[]> getCurrentSymmetricKey = null
)
Parameters
- container
- Type: PsrApi.DataPsrContainerItem
The container to encrypt - plainFilePath
- Type: SystemString
The plain source file - encryptedFilePath
- Type: SystemString
The path to the file where the encrypted file gets created - getCurrentSymmetricKey (Optional)
- Type: SystemFuncByte
Null if its a new data. If the data existed before - a function to get the current symmetric key (This will only be used if the datakeys of the encryption collection are symmetric
Return Value
Type:
ByteIf a new key was created, it will be returned, else null
See Also