Click or drag to resize

DataProtectionProtect Method

Encrypts the data in a specified byte array and returns a byte array that contains the encrypted data.

Namespace: GSF.Security.Cryptography
Assembly: GSF.Core (in GSF.Core.dll) Version: 2.4.258-beta+f8b6aa3dbfe0b4cc2b0b0760dd5d2a3dd4f59d09
Syntax
public static byte[] Protect(
	byte[] userData,
	byte[] optionalEntropy,
	DataProtectionScope scope
)
View Source

Parameters

userData  Byte
A byte array that contains data to encrypt.
optionalEntropy  Byte
An optional additional byte array used to increase the complexity of the encryption, or null for no additional complexity.
scope  DataProtectionScope
One of the enumeration values that specifies the scope of encryption.

Return Value

Byte
A byte array representing the encrypted data.
Exceptions
ExceptionCondition
ArgumentNullExceptionThe userData parameter is null.
CryptographicExceptionThe encryption failed.
NotSupportedExceptionThe operating system does not support this method.
OutOfMemoryExceptionThe system ran out of memory while encrypting the data.
See Also