EncryptionManagerEncryptContainerItem Method |
Encrypts a MtoContainerItem over the a aes key or a rsa key depending on the EncryptionVersion and sets its encrypted value. Also sets the Public key in the data correctly.
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.2.4.33163 (18.08.2025)+dec6f51c484240b8abaa8be3c442061ed610820b
Syntaxpublic byte[] EncryptContainerItem(
PsrContainerItem item,
byte[] plainValue,
Func<byte[]> getCurrentSymmetricKey = null
)
Parameters
- item
- Type: PsrApi.DataPsrContainerItem
The data to encrypt - plainValue
- Type: SystemByte
The value to encrypt - 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
ExceptionsException | Condition |
---|
ArgumentOutOfRangeException | |
See Also