C# Класс EfficientlyLazy.Crypto.Engines.DPAPIEngine

Encryption/Decryption using the windows crypto API.
Наследование: ICryptoEngine
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
DPAPIEngine ( DPAPIKeyType keyType ) : System

Initializes a new instance of the DPAPIEngine object.

Decrypt ( byte cipherText ) : byte[]

Decrypts the specified cipher text.

Decrypt ( string cipherText ) : string

Decrypts the specified cipher text.

Dispose ( ) : void

Encrypt ( byte plaintext ) : byte[]

Encrypts the specified plain text to a byte array.

Encrypt ( string plaintext ) : string

Encrypts the specified plain text to a string.

GetSetting ( string key ) : string

GetSqlConnectionString ( string key ) : System.Data.SqlClient.SqlConnectionStringBuilder

SetEncoding ( Encoding encoding ) : DPAPIEngine

Sets character encoding to use during encryption/decryption.

SetEntropy ( SecureString entropy ) : DPAPIEngine

Sets additional entropy used for encryption/decryption

SetEntropy ( string entropy ) : DPAPIEngine

Sets additional entropy used for encryption/decryption

Приватные методы

Метод Описание
CryptProtectData ( DPAPINativeDataBlob &plainText, string description, DPAPINativeDataBlob &entropy, IntPtr reserved, DPAPINativeCryptPotectPromptStruct &prompt, int flags, DPAPINativeDataBlob &cipherText ) : bool
CryptUnprotectData ( DPAPINativeDataBlob &cipherText, string &description, DPAPINativeDataBlob &entropy, IntPtr reserved, DPAPINativeCryptPotectPromptStruct &prompt, int flags, DPAPINativeDataBlob &plainText ) : bool
DPAPIDecrypt ( byte cipherText, byte entropy ) : byte[]
DPAPIEncrypt ( DPAPIKeyType keyType, byte plainTextBytes, byte entropyBytes ) : byte[]
Dispose ( bool disposing ) : void
GetSecureConfigSection ( ) : SecureSection
ToSecureString ( IEnumerable text ) : SecureString
ToString ( SecureString secureString ) : string

Описание методов

DPAPIEngine() публичный Метод

Initializes a new instance of the DPAPIEngine object.
public DPAPIEngine ( DPAPIKeyType keyType ) : System
keyType DPAPIKeyType Defines the method () to use for encryption/decryption.
Результат System

Decrypt() публичный Метод

Decrypts the specified cipher text.
public Decrypt ( byte cipherText ) : byte[]
cipherText byte The cipher text.
Результат byte[]

Decrypt() публичный Метод

Decrypts the specified cipher text.
public Decrypt ( string cipherText ) : string
cipherText string The cipher text.
Результат string

Dispose() публичный Метод

public Dispose ( ) : void
Результат void

Encrypt() публичный Метод

Encrypts the specified plain text to a byte array.
public Encrypt ( byte plaintext ) : byte[]
plaintext byte The plain text to encrypt.
Результат byte[]

Encrypt() публичный Метод

Encrypts the specified plain text to a string.
public Encrypt ( string plaintext ) : string
plaintext string The plain text to encrypt.
Результат string

GetSetting() публичный Метод

public GetSetting ( string key ) : string
key string
Результат string

GetSqlConnectionString() публичный Метод

public GetSqlConnectionString ( string key ) : System.Data.SqlClient.SqlConnectionStringBuilder
key string
Результат System.Data.SqlClient.SqlConnectionStringBuilder

SetEncoding() публичный Метод

Sets character encoding to use during encryption/decryption.
encoding is null
public SetEncoding ( Encoding encoding ) : DPAPIEngine
encoding System.Text.Encoding Character encoding to use during encryption/decryption.
Результат DPAPIEngine

SetEntropy() публичный Метод

Sets additional entropy used for encryption/decryption
public SetEntropy ( SecureString entropy ) : DPAPIEngine
entropy System.Security.SecureString Additional entropy used for encryption/decryption
Результат DPAPIEngine

SetEntropy() публичный Метод

Sets additional entropy used for encryption/decryption
public SetEntropy ( string entropy ) : DPAPIEngine
entropy string Additional entropy used for encryption/decryption
Результат DPAPIEngine