C# Class JocysCom.ClassLibrary.Security.Encryption

Summary description for Encryption
Show file Open project: x360ce/x360ce

Public Methods

Method Description
ComputeHash ( Array bytes, Array hashKeyBytes = null ) : Guid

Computes the HMAC MD5 hash value for the specified byte array.

One instance of the MD5 Crypto Service Provider can't operate properly with multiple simultaneous threads. Use lock to solve this problem.

ComputeHash ( string text, string hashKey = null ) : Guid

Computes the HMAC MD5 hash value for the specified text.

ComputeMd5Hash ( Array bytes ) : Guid

Computes the MD5 hash value for the specified byte array.

One instance of the MD5 Crypto Service Provider can't operate properly with multiple simultaneous threads. Use lock to solve this problem.

ComputeMd5Hash ( string text ) : Guid

Computes the MD5 hash value for the specified text. Use UTF-8 encoding to get bytes.

ComputeMd5Hash ( string text, Encoding encoding ) : Guid

Computes the MD5 hash value for the specified text.

Dispose ( ) : void
Encryption ( string prefix = null ) : System
GetNewRsaKeys ( ) : string

Get new public and private RSA key pair.

GetNewRsaKeys ( int keySize ) : string

Get new public and private RSA key pair for app.config file.

RsaDecrypt ( string base64Text ) : string

Decrypts data with the System.Security.Cryptography.RSA algorithm.

RsaEncrypt ( Array bytes ) : string

Encrypts data with the System.Security.Cryptography.RSA algorithm.

RsaEncrypt ( string text ) : string

Encrypts data with the System.Security.Cryptography.RSA algorithm.

RsaNewKeys ( int keySize ) : Keys
RsaNewKeysSave ( ) : void
RsaNewKeysSave ( int keySize ) : void
UpsertKey ( Configuration config, string name, object value ) : void

Protected Methods

Method Description
Dispose ( bool disposing ) : void

Method Details

ComputeHash() public method

Computes the HMAC MD5 hash value for the specified byte array.
One instance of the MD5 Crypto Service Provider can't operate properly with multiple simultaneous threads. Use lock to solve this problem.
public ComputeHash ( Array bytes, Array hashKeyBytes = null ) : Guid
bytes Array The input to compute the hash code for.
hashKeyBytes Array
return Guid

ComputeHash() public method

Computes the HMAC MD5 hash value for the specified text.
public ComputeHash ( string text, string hashKey = null ) : Guid
text string The input to compute the hash code for.
hashKey string
return Guid

ComputeMd5Hash() public method

Computes the MD5 hash value for the specified byte array.
One instance of the MD5 Crypto Service Provider can't operate properly with multiple simultaneous threads. Use lock to solve this problem.
public ComputeMd5Hash ( Array bytes ) : Guid
bytes Array The input to compute the hash code for.
return Guid

ComputeMd5Hash() public method

Computes the MD5 hash value for the specified text. Use UTF-8 encoding to get bytes.
public ComputeMd5Hash ( string text ) : Guid
text string The input to compute the hash code for.
return Guid

ComputeMd5Hash() public method

Computes the MD5 hash value for the specified text.
public ComputeMd5Hash ( string text, Encoding encoding ) : Guid
text string The input to compute the hash code for.
encoding Encoding Encoding to get bytes.
return Guid

Dispose() public method

public Dispose ( ) : void
return void

Dispose() protected method

protected Dispose ( bool disposing ) : void
disposing bool
return void

Encryption() public method

public Encryption ( string prefix = null ) : System
prefix string
return System

GetNewRsaKeys() public method

Get new public and private RSA key pair.
public GetNewRsaKeys ( ) : string
return string

GetNewRsaKeys() public method

Get new public and private RSA key pair for app.config file.
public GetNewRsaKeys ( int keySize ) : string
keySize int Key size.
return string

RsaDecrypt() public method

Decrypts data with the System.Security.Cryptography.RSA algorithm.
public RsaDecrypt ( string base64Text ) : string
base64Text string The data to be decrypted.
return string

RsaEncrypt() public method

Encrypts data with the System.Security.Cryptography.RSA algorithm.
public RsaEncrypt ( Array bytes ) : string
bytes Array The data to be encrypted.
return string

RsaEncrypt() public method

Encrypts data with the System.Security.Cryptography.RSA algorithm.
public RsaEncrypt ( string text ) : string
text string The data to be encrypted.
return string

RsaNewKeys() public method

public RsaNewKeys ( int keySize ) : Keys
keySize int
return Keys

RsaNewKeysSave() public method

public RsaNewKeysSave ( ) : void
return void

RsaNewKeysSave() public method

public RsaNewKeysSave ( int keySize ) : void
keySize int
return void

UpsertKey() public method

public UpsertKey ( Configuration config, string name, object value ) : void
config System.Configuration.Configuration
name string
value object
return void