DataProtectionProtect Method
Encrypts the data in a specified byte array and returns a byte array that contains the encrypted data.
Namespace: Gemstone.Security.CryptographyAssembly: Gemstone.Common (in Gemstone.Common.dll) Version: 1.0.128 -- Release Build+d050cfc5563c89a1188cc3c6b2d417530856f490
public static byte[] Protect(
byte[] unencryptedData,
byte[]? optionalEntropy = null,
bool protectToLocalMachine = true,
string settingsCategory = "CryptographyServices"
)
Public Shared Function Protect (
unencryptedData As Byte(),
Optional optionalEntropy As Byte() = Nothing,
Optional protectToLocalMachine As Boolean = true,
Optional settingsCategory As String = "CryptographyServices"
) As Byte()
public:
static array<unsigned char>^ Protect(
array<unsigned char>^ unencryptedData,
array<unsigned char>^ optionalEntropy = nullptr,
bool protectToLocalMachine = true,
String^ settingsCategory = L"CryptographyServices"
)
Gemstone.Security.Cryptography.DataProtection.Protect = function(unencryptedData, optionalEntropy, protectToLocalMachine, settingsCategory);
- unencryptedData Byte
- A byte array that contains data to encrypt.
- optionalEntropy Byte (Optional)
- An optional additional byte array used to increase the complexity of the encryption, or null for no additional complexity.
- protectToLocalMachine Boolean (Optional)
- Set to true to protect data to the local machine; otherwise, set to false to protect data to the current user.
- settingsCategory String (Optional)
- The config file settings category under which the settings are defined.
ByteA byte array representing the encrypted data.
ArgumentNullException | The unencryptedData parameter is null. |
CryptographicException | The encryption failed. |