C# Class Subtext.Web.Controls.CaptchaBase

Inheritance: System.Web.UI.WebControls.BaseValidator
Show file Open project: ayende/Subtext

Private Properties

Property Type Description
InitializeEncryptionAlgorithm System.Security.Cryptography.SymmetricAlgorithm
ValidateCaptcha bool

Public Methods

Method Description
DecryptString ( string encryptedEncodedText ) : string

Decrypts the base64 encrypted string and returns the cleartext.

EncryptString ( string clearText ) : string

Encrypts the string and returns a base64 encoded encrypted string.

Protected Methods

Method Description
ControlPropertiesValid ( ) : bool

Checks the properties of the control for valid values.

EncryptAnswer ( string answer ) : string

Encrypts the answer along with the current datetime.

EvaluateIsValid ( ) : bool

When overridden in a derived class, this method contains the code to determine whether the value in the input control is valid.

GetClientSpecifiedAnswer ( ) : string
GetEncryptedAnswerFromForm ( ) : AnswerAndDate

Gets the encrypted answer from form.

Private Methods

Method Description
InitializeEncryptionAlgorithm ( ) : SymmetricAlgorithm
ValidateCaptcha ( ) : bool

Method Details

ControlPropertiesValid() protected method

Checks the properties of the control for valid values.
protected ControlPropertiesValid ( ) : bool
return bool

DecryptString() public static method

Decrypts the base64 encrypted string and returns the cleartext.
Thrown the string to be decrypted /// was encrypted using a different encryptor (for example, if we recompile and /// receive an old string).
public static DecryptString ( string encryptedEncodedText ) : string
encryptedEncodedText string The clear text.
return string

EncryptAnswer() protected method

Encrypts the answer along with the current datetime.
protected EncryptAnswer ( string answer ) : string
answer string The answer.
return string

EncryptString() public static method

Encrypts the string and returns a base64 encoded encrypted string.
public static EncryptString ( string clearText ) : string
clearText string The clear text.
return string

EvaluateIsValid() protected method

When overridden in a derived class, this method contains the code to determine whether the value in the input control is valid.
protected EvaluateIsValid ( ) : bool
return bool

GetClientSpecifiedAnswer() protected method

protected GetClientSpecifiedAnswer ( ) : string
return string

GetEncryptedAnswerFromForm() protected method

Gets the encrypted answer from form.
Thrown when the user takes too long to submit a captcha answer.
protected GetEncryptedAnswerFromForm ( ) : AnswerAndDate
return AnswerAndDate