C# Class SebWindowsClient.CryptographyUtils.SEBProtectionController

Datei anzeigen Open project: SafeExamBrowser/seb-win Class Usage Examples

Public Methods

Method Description
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.

Private Methods

Method Description
ComputeFileHash ( string file ) : string
ComputeSEBComponentsHash ( ) : string

Method Details

ComputeBrowserExamKey() public static method

Compute a Browser Exam Key SHA256 hash base16 string.
public static ComputeBrowserExamKey ( ) : string
return string

ComputeHashForFiles() public static method

public static ComputeHashForFiles ( IEnumerable fileNames ) : string
fileNames IEnumerable
return string

ComputePasswordHash() public static method

Compute a SHA256 hash base16 string.
public static ComputePasswordHash ( string input ) : string
input string
return string

DecryptDataWithCertificate() public static method

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
return byte[]

DecryptDataWithPassword() public static method

Decrypt with password, key, salt using AES (Open SSL Decrypt)..
public static DecryptDataWithPassword ( byte encryptedBytesWithSalt, string passphrase ) : byte[]
encryptedBytesWithSalt byte
passphrase string
return byte[]

EncryptDataWithCertificate() public static method

Encrypt with certificate/public key and RSA algorithm
public static EncryptDataWithCertificate ( byte plainInputData, X509Certificate2 sebCertificate ) : byte[]
plainInputData byte
sebCertificate System.Security.Cryptography.X509Certificates.X509Certificate2
return byte[]

EncryptDataWithPassword() public static method

Encrypt with password, key, salt using AES (Open SSL Encrypt).
public static EncryptDataWithPassword ( byte plainData, string password ) : byte[]
plainData byte
password string
return byte[]

GenerateBrowserExamKeySalt() public static method

Generate a Browser Exam Key Salt as byte data.
public static GenerateBrowserExamKeySalt ( ) : byte[]
return byte[]

GetCertificateFromPassedStore() public static method

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
return System.Security.Cryptography.X509Certificates.X509Certificate2

GetCertificateFromStore() public static method

Get certificate from both stores.
public static GetCertificateFromStore ( byte publicKeyHash ) : X509Certificate2
publicKeyHash byte
return System.Security.Cryptography.X509Certificates.X509Certificate2

GetCertificatesAndNames() public static method

Get array of certificate references and the according names from both certificate stores.
public static GetCertificatesAndNames ( ArrayList &certificateNames ) : ArrayList
certificateNames System.Collections.ArrayList
return System.Collections.ArrayList

GetCertificatesAndNamesFromStore() public static method

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
return System.Collections.ArrayList

GetPublicKeyHashFromCertificate() public static method

Get the public key hash for the certificate from the store.
public static GetPublicKeyHashFromCertificate ( X509Certificate2 certificateRef ) : byte[]
certificateRef System.Security.Cryptography.X509Certificates.X509Certificate2
return byte[]

GetSSLCertificatesAndNames() public static method

Get array of CA certificate references and the according names from the certificate store.
public static GetSSLCertificatesAndNames ( ArrayList &certificateNames ) : ArrayList
certificateNames System.Collections.ArrayList
return System.Collections.ArrayList

Parse() public static method

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. ","
return List

StoreCertificateIntoStore() public static method

Store certificate into the store.
public static StoreCertificateIntoStore ( byte certificateData ) : void
certificateData byte
return void