C# Class LumiSoft.Net.AUTH.AuthHelper

Provides helper methods for authentications(APOP,CRAM-MD5,DIGEST-MD5).
Show file Open project: jeske/StepsDB-alpha

Public Methods

Method Description
Apop ( string password, string passwordTag ) : string

Calculates APOP authentication compare value.

Base64de ( string text ) : string

Decodes specified base64 string.

Base64en ( string text ) : string

Encodes specified string to base64 string.

Cram_Md5 ( string password, string hashKey ) : string

Calculates CRAM-MD5 authentication compare value.

Create_Digest_Md5_ServerResponse ( string realm, string nonce ) : string

Creates AUTH Digest-md5 server response what server must send to client.

Digest_Md5 ( bool client_server, string realm, string userName, string password, string nonce, string cnonce, string digest_uri ) : string

Calculates DIGEST-MD5 authentication compare value.

GenerateNonce ( ) : string

Generates random nonce value.

Hex ( string text ) : string

Converts specified string to hexa string.

HmacMd5 ( string hashKey, string text ) : string

Calculates keyed md5 hash from specifieed text and with specified hash key.

Md5 ( string text ) : string

Calculates md5 hash from specified string.

Method Details

Apop() public static method

Calculates APOP authentication compare value.
public static Apop ( string password, string passwordTag ) : string
password string Password.
passwordTag string Password tag.
return string

Base64de() public static method

Decodes specified base64 string.
public static Base64de ( string text ) : string
text string Base64 string to decode.
return string

Base64en() public static method

Encodes specified string to base64 string.
public static Base64en ( string text ) : string
text string Text to encode.
return string

Cram_Md5() public static method

Calculates CRAM-MD5 authentication compare value.
public static Cram_Md5 ( string password, string hashKey ) : string
password string Password.
hashKey string Hash calculation key
return string

Create_Digest_Md5_ServerResponse() public static method

Creates AUTH Digest-md5 server response what server must send to client.
public static Create_Digest_Md5_ServerResponse ( string realm, string nonce ) : string
realm string Use domain or machine name for this.
nonce string Server password tag.Random hex string is suggested.
return string

Digest_Md5() public static method

Calculates DIGEST-MD5 authentication compare value.
public static Digest_Md5 ( bool client_server, string realm, string userName, string password, string nonce, string cnonce, string digest_uri ) : string
client_server bool Specifies if client or server value calculated. /// Client and server has diffrent calculation method.
realm string Use domain or machine name for this.
userName string User name.
password string Password.
nonce string Server password tag.
cnonce string Client password tag.
digest_uri string
return string

GenerateNonce() public static method

Generates random nonce value.
public static GenerateNonce ( ) : string
return string

Hex() public static method

Converts specified string to hexa string.
public static Hex ( string text ) : string
text string
return string

HmacMd5() public static method

Calculates keyed md5 hash from specifieed text and with specified hash key.
public static HmacMd5 ( string hashKey, string text ) : string
hashKey string
text string
return string

Md5() public static method

Calculates md5 hash from specified string.
public static Md5 ( string text ) : string
text string
return string