C# Класс SebWindowsClient.CryptographyUtils.SEBProtectionController

Показать файл Открыть проект Примеры использования класса

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

Метод Описание
ComputeBrowserExamKey ( ) : string

Compute a Browser Exam Key SHA256 hash base16 string.

ComputeHashForFiles ( IEnumerable fileNames ) : string
ComputePasswordHash ( string input ) : string

Compute a SHA256 hash base16 string.

DecryptDataWithCertificate ( byte encryptedData, X509Certificate2 sebCertificate ) : byte[]

Decrypt with X509 certificate/private key and RSA algorithm

DecryptDataWithPassword ( byte encryptedBytesWithSalt, string passphrase ) : byte[]

Decrypt with password, key, salt using AES (Open SSL Decrypt)..

EncryptDataWithCertificate ( byte plainInputData, X509Certificate2 sebCertificate ) : byte[]

Encrypt with certificate/public key and RSA algorithm

EncryptDataWithPassword ( byte plainData, string password ) : byte[]

Encrypt with password, key, salt using AES (Open SSL Encrypt).

GenerateBrowserExamKeySalt ( ) : byte[]

Generate a Browser Exam Key Salt as byte data.

GetCertificateFromPassedStore ( byte publicKeyHash, X509Store store ) : X509Certificate2

Helper method: Search passed store for certificate with passed public key hash.

GetCertificateFromStore ( byte publicKeyHash ) : X509Certificate2

Get certificate from both stores.

GetCertificatesAndNames ( ArrayList &certificateNames ) : ArrayList

Get array of certificate references and the according names from both certificate stores.

GetCertificatesAndNamesFromStore ( ArrayList &certificateNames, X509Store store ) : ArrayList

Helper method: Get array of certificate references and the according names from the passed certificate store.

GetPublicKeyHashFromCertificate ( X509Certificate2 certificateRef ) : byte[]

Get the public key hash for the certificate from the store.

GetSSLCertificatesAndNames ( ArrayList &certificateNames ) : ArrayList

Get array of CA certificate references and the according names from the certificate store.

Parse ( string data, string delimiter ) : List

Recursively searches the supplied AD string for all groups.

StoreCertificateIntoStore ( byte certificateData ) : void

Store certificate into the store.

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

Метод Описание
ComputeFileHash ( string file ) : string
ComputeSEBComponentsHash ( ) : string

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

ComputeBrowserExamKey() публичный статический Метод

Compute a Browser Exam Key SHA256 hash base16 string.
public static ComputeBrowserExamKey ( ) : string
Результат string

ComputeHashForFiles() публичный статический Метод

public static ComputeHashForFiles ( IEnumerable fileNames ) : string
fileNames IEnumerable
Результат string

ComputePasswordHash() публичный статический Метод

Compute a SHA256 hash base16 string.
public static ComputePasswordHash ( string input ) : string
input string
Результат string

DecryptDataWithCertificate() публичный статический Метод

Decrypt with X509 certificate/private key and RSA algorithm
public static DecryptDataWithCertificate ( byte encryptedData, X509Certificate2 sebCertificate ) : byte[]
encryptedData byte
sebCertificate System.Security.Cryptography.X509Certificates.X509Certificate2
Результат byte[]

DecryptDataWithPassword() публичный статический Метод

Decrypt with password, key, salt using AES (Open SSL Decrypt)..
public static DecryptDataWithPassword ( byte encryptedBytesWithSalt, string passphrase ) : byte[]
encryptedBytesWithSalt byte
passphrase string
Результат byte[]

EncryptDataWithCertificate() публичный статический Метод

Encrypt with certificate/public key and RSA algorithm
public static EncryptDataWithCertificate ( byte plainInputData, X509Certificate2 sebCertificate ) : byte[]
plainInputData byte
sebCertificate System.Security.Cryptography.X509Certificates.X509Certificate2
Результат byte[]

EncryptDataWithPassword() публичный статический Метод

Encrypt with password, key, salt using AES (Open SSL Encrypt).
public static EncryptDataWithPassword ( byte plainData, string password ) : byte[]
plainData byte
password string
Результат byte[]

GenerateBrowserExamKeySalt() публичный статический Метод

Generate a Browser Exam Key Salt as byte data.
public static GenerateBrowserExamKeySalt ( ) : byte[]
Результат byte[]

GetCertificateFromPassedStore() публичный статический Метод

Helper method: Search passed store for certificate with passed public key hash.
public static GetCertificateFromPassedStore ( byte publicKeyHash, X509Store store ) : X509Certificate2
publicKeyHash byte
store System.Security.Cryptography.X509Certificates.X509Store
Результат System.Security.Cryptography.X509Certificates.X509Certificate2

GetCertificateFromStore() публичный статический Метод

Get certificate from both stores.
public static GetCertificateFromStore ( byte publicKeyHash ) : X509Certificate2
publicKeyHash byte
Результат System.Security.Cryptography.X509Certificates.X509Certificate2

GetCertificatesAndNames() публичный статический Метод

Get array of certificate references and the according names from both certificate stores.
public static GetCertificatesAndNames ( ArrayList &certificateNames ) : ArrayList
certificateNames System.Collections.ArrayList
Результат System.Collections.ArrayList

GetCertificatesAndNamesFromStore() публичный статический Метод

Helper method: Get array of certificate references and the according names from the passed certificate store.
public static GetCertificatesAndNamesFromStore ( ArrayList &certificateNames, X509Store store ) : ArrayList
certificateNames System.Collections.ArrayList
store System.Security.Cryptography.X509Certificates.X509Store
Результат System.Collections.ArrayList

GetPublicKeyHashFromCertificate() публичный статический Метод

Get the public key hash for the certificate from the store.
public static GetPublicKeyHashFromCertificate ( X509Certificate2 certificateRef ) : byte[]
certificateRef System.Security.Cryptography.X509Certificates.X509Certificate2
Результат byte[]

GetSSLCertificatesAndNames() публичный статический Метод

Get array of CA certificate references and the according names from the certificate store.
public static GetSSLCertificatesAndNames ( ArrayList &certificateNames ) : ArrayList
certificateNames System.Collections.ArrayList
Результат System.Collections.ArrayList

Parse() публичный статический Метод

Recursively searches the supplied AD string for all groups.
public static Parse ( string data, string delimiter ) : List
data string The string returned from AD to parse for a group.
delimiter string The string to use as the seperator for the data. ex. ","
Результат List

StoreCertificateIntoStore() публичный статический Метод

Store certificate into the store.
public static StoreCertificateIntoStore ( byte certificateData ) : void
certificateData byte
Результат void