Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Protect Method

DataProtector.Protect Method

.NET Framework 4.6 and 4.5

Protects the specified user data.

Namespace:  System.Security.Cryptography
Assembly:  System.Security (in System.Security.dll)

public byte[] Protect(
	byte[] userData
)

Parameters

userData
Type: System.Byte[]

The data to be protected.

Return Value

Type: System.Byte[]
A byte array that contains the encrypted data.

ExceptionCondition
ArgumentNullException

userData is null.

.NET Framework

Supported in: 4.6, 4.5
Show:
© 2015 Microsoft