Encrypts data according to a specified protection type.
[Visual Basic]
Overloads Public Function ProtectData( _
ByVal type As ProtectionType, _
ByVal data As Byte() _
) As Byte()
An array of encrypted bytes.
The number of the returned bytes will be larger than the number of input bytes. The method will use the entropy from the Entropy property.
Exception Type | Condition |
---|---|
ArgumentNullException | data is a null reference (Nothing in Visual Basic). |
CryptographicException | An error occurs during the encryption process. Under some circumstances, Microsoft cryptographic service providers may not allow encryption when used in France. This may occur on down-level platforms such as Windows 98 and Windows NT 4.0, depending on the system's configuration and the version of the CSPs. |
DataProtectionCryptoServiceProvider Class | DataProtectionCryptoServiceProvider Members | Org.Mentalis.Security.Cryptography Namespace | DataProtectionCryptoServiceProvider.ProtectData Overload List