C# 클래스 P2PStateServer.SHA256_AESAuthenticator

Represents an authentication object that hashes data with he SHA256 hash algorithm and encrypts/decrypts data with the Rjindael algorithm
파일 보기 프로젝트 열기: tenor/p2pStateServer 1 사용 예제들

공개 메소드들

메소드 설명
GetClientResponseDigest ( string Algorithm, string Username, string Realm, string Nonce, int NonceCount, string ClientNonce, string QOP, string URI ) : string

Calculate a Server Response Digest in Accordance to RFC 2617

GetNewChallenge ( ) : string

Generates a new random challenge

GetServerResponseDigest ( string Algorithm, string Username, string Realm, string Nonce, int NonceCount, string ClientNonce, string QOP, string URI ) : string

Calculate a Server Response Digest in Accordance to RFC 2617

GetSessionKey ( string Username, string Realm, string Nonce, string ClientNonce ) : byte[]

Calculates a session key from the supplied data

Protect ( byte Data, byte SessionKey ) : byte[]

Encrypts data using the AES algorithm

SHA256_AESAuthenticator ( string Password ) : System

Initializes a new instance of the SHA256_AESAuthenticator class

Unprotect ( byte Data, byte SessionKey, int Length ) : byte[]

Decrypts data using the AES algorithm

비공개 메소드들

메소드 설명
CalculateDigest ( string Username, string Realm, string Password, string Nonce, int NonceCount, string ClientNonce, string QOP, string Method, string URI, HashAlgorithm HashAlg ) : string

Calculate a Response Digest in Accordance to RFC 2617

Decrypt ( byte Data, SymmetricAlgorithm DecryptionObject, int UnEncryptedSize ) : byte[]

Decrypts data

EnHex ( byte data ) : string

Calculates a Hex string representation of data, in accordance to the 32LHEX format of the Authorization Request Header in RFC 2617

Encrypt ( byte Data, SymmetricAlgorithm EncryptionObject ) : byte[]

Encrypt data

GetHashAlgorithm ( ) : HashAlgorithm

Gets the HashAlgorithm object used by this Authenticator

메소드 상세

GetClientResponseDigest() 공개 메소드

Calculate a Server Response Digest in Accordance to RFC 2617
public GetClientResponseDigest ( string Algorithm, string Username, string Realm, string Nonce, int NonceCount, string ClientNonce, string QOP, string URI ) : string
Algorithm string The Algorithm name
Username string The Username
Realm string The Realm
Nonce string The Nonce
NonceCount int The Nonce count
ClientNonce string The Client nonce
QOP string QOP
URI string URI
리턴 string

GetNewChallenge() 공개 메소드

Generates a new random challenge
public GetNewChallenge ( ) : string
리턴 string

GetServerResponseDigest() 공개 메소드

Calculate a Server Response Digest in Accordance to RFC 2617
public GetServerResponseDigest ( string Algorithm, string Username, string Realm, string Nonce, int NonceCount, string ClientNonce, string QOP, string URI ) : string
Algorithm string The Algorithm name
Username string The Username
Realm string The Realm
Nonce string The Nonce
NonceCount int The Nonce count
ClientNonce string The Client nonce
QOP string QOP
URI string URI
리턴 string

GetSessionKey() 공개 메소드

Calculates a session key from the supplied data
public GetSessionKey ( string Username, string Realm, string Nonce, string ClientNonce ) : byte[]
Username string The Username
Realm string The Realm
Nonce string The Nonce
ClientNonce string The ClientNonce
리턴 byte[]

Protect() 공개 메소드

Encrypts data using the AES algorithm
public Protect ( byte Data, byte SessionKey ) : byte[]
Data byte Plaintext data
SessionKey byte The encryption session key
리턴 byte[]

SHA256_AESAuthenticator() 공개 메소드

Initializes a new instance of the SHA256_AESAuthenticator class
public SHA256_AESAuthenticator ( string Password ) : System
Password string Secret password used for authentication and generating encryption keys
리턴 System

Unprotect() 공개 메소드

Decrypts data using the AES algorithm
public Unprotect ( byte Data, byte SessionKey, int Length ) : byte[]
Data byte Encrypted Data
SessionKey byte Encrytion Session key
Length int Length of descrypted data
리턴 byte[]