Mono Class Library: System.Web.Security.FormsAuthentication Overview | Members

System.Web.Security.FormsAuthentication.Encrypt Method

Encrypts the System.Web.Security.FormsAuthenticationTicket based on the configuration information for the application.

public static string Encrypt (FormsAuthenticationTicket ticket)

Parameters

ticket
The ticket to encrypt.q

Returns

A string representing the ticket.

The ticket might be just a string representation of the ticket, a string representation with a checksum or string representation with a checksum and encryption. Depending on the settings.

Remarks

The actual method to encrypt the data depends on the setting in the "mode" attribute in the <authentication> section in the <system.web> section of the application configuration.

The possible values are:

ValueEffect
AllChecksums and encrypts the ticket; Prevents tampering and visibility from the user
NoneEncodes the tickets as a hex string, the ticket can be tampered and the content viewed by a client
EncryptionEncrypts the tickets, but does not checksum the results.
ValidationAppends a checksum to the sequence, to avoid a client tampering with the data.

The default mode is "All".

Requirements

Namespace: System.Web.Security
Assembly: System.Web (in System.Web.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0