C# Класс Argentini.Halide.H3Secure

The H3Secure class contains methods and properties for performing or evaluating security and authentication related operations. Make sure that you customize the halideEncryptionBaseKey and halideEncryptionInitVector values in the Halide.config file. This should be done for each site in which Halide is used. The halideEncryptionBaseKey attribute is an array of 24 8-bit numeric values (0-255), and the halideEncryptionInitVector attribute is an array of 18 8-bit numeric values (0-255). These values are used to seed and generate encrypted data when using any of the encryption methods within the H3Secure class.
Показать файл Открыть проект

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

Метод Описание
Base64PlusStringDecode ( string input ) : String

Base64+ decodes a string (valid in REST URL). Handles missing padding characters.

Base64PlusStringDecodeToBytes ( string input ) : byte[]

Base64+ decodes a string (valid in REST URL). Handles missing padding characters.

Base64PlusStringEncode ( byte input ) : String

Base64+ encodes a string (valid in REST URL).

Base64PlusStringEncode ( string input ) : String

Base64+ encodes a string (valid in REST URL).

Base64StringDecode ( string input ) : String

Base64 decodes a string.

Base64StringEncode ( string input ) : String

Base64 encodes a string.

CreateBaseKey ( String key ) : Byte[]

Converts a comma-separated string of 24 8-bit values and converts it into a Byte array.

CreateInitVector ( String key ) : Byte[]

Converts a comma-separated string of 18 8-bit values and converts it into a Byte array.

Decrypt ( String data ) : String

Triple DES 256 bit string decryption.

Decrypt ( String data, Byte key ) : String

Triple DES 256 bit string decryption.

Decrypt ( String data, Byte key, Byte ivec ) : String

Triple DES 256 bit string decryption.

Decrypt ( String data, String key, String ivec ) : String

Triple DES 256 bit string decryption.

DecryptInt32 ( String data ) : Int32?

Triple DES 256 bit integer decryption.

DecryptInt32 ( String data, Byte key ) : Int32?

Triple DES 256 bit integer decryption.

DecryptInt32 ( String data, Byte key, Byte ivec ) : Int32?

Triple DES 256 bit integer decryption.

DecryptInt32 ( String data, String key, String ivec ) : Int32?

Triple DES 256 bit integer decryption.

DecryptInt64 ( String data ) : Int64?

Triple DES 256 bit long integer (Int64) decryption.

DecryptInt64 ( String data, Byte key ) : Int64?

Triple DES 256 bit long integer (Int64) decryption.

DecryptInt64 ( String data, Byte key, Byte ivec ) : Int64?

Triple DES 256 bit long integer (Int64) decryption.

DecryptInt64 ( String data, String key, String ivec ) : Int64?

Triple DES 256 bit long integer (Int64) decryption.

Encrypt ( String data ) : String

Triple DES 256 bit string encryption.

Encrypt ( String data, Byte key ) : String

Triple DES 256 bit string encryption.

Encrypt ( String data, Byte key, Byte ivec ) : String

Triple DES 256 bit string encryption.

Encrypt ( String data, String key, String ivec ) : String

Triple DES 256 bit string encryption.

EncryptInt32 ( Int32 data ) : String

Triple DES 256 bit encryption of 32-bit integers.

EncryptInt32 ( Int32 data, Byte key ) : String

Triple DES 256 bit encryption of 32-bit integers.

EncryptInt32 ( Int32 data, Byte key, Byte ivec ) : String

Triple DES 256 bit encryption of 32-bit integers.

EncryptInt32 ( Int32 data, String key, String ivec ) : String

Triple DES 256 bit encryption of 32-bit integers.

EncryptInt64 ( System.Int64 data ) : String

Triple DES 256 bit encryption of 64-bit integers.

EncryptInt64 ( System.Int64 data, Byte key ) : String

Triple DES 256 bit encryption of 64-bit integers.

EncryptInt64 ( System.Int64 data, Byte key, Byte ivec ) : String

Triple DES 256 bit encryption of 64-bit integers.

EncryptInt64 ( System.Int64 data, String key, String ivec ) : String

Triple DES 256 bit encryption of 64-bit integers.

GenerateKey ( Int32 count ) : String

Generate a comma-separated string of 8-bit values for an encryption base key. The value is not guaranteed to be unique.

GetCurrentUser ( ) : String

Get the currently logged-in user name (with domain) from the client.

GetIdentity ( ) : String

Get the currently logged-in user name (with domain) for the running web page.

Impersonate ( ) : System.Boolean

Begins impersonation of an authenticated user on the server, so your page will have non-anonymous permissions (e.g. to write files, etc.).

Impersonate ( String domain, String userName, String password ) : System.Boolean

Begins impersonation of an authenticated user on the server, so your page will have non-anonymous permissions (e.g. to write files, etc.).

MD5String ( string input ) : String

MD5 encodes the passed string.

MD5VerifyString ( string input, string hash ) : System.Boolean

Verified a string against the passed MD5 hash.

TinyDecrypt ( string input ) : String

Decrypt a string encrypted with TinyEncrypt. Ideal for passing parameters on a URL. If you need strong encryption, do not use this method.

TinyEncrypt ( string input ) : String

Encrypt a string using a simple XOR and Base64 Encode. Ideal for passing parameters on a URL. If you need strong encryption, do not use this method.

UnImpersonate ( ) : void

Ends impersonation of an authenticated user on the server, reverting back to an anonymous, default, network service account.

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

Метод Описание
CloseHandle ( IntPtr handle ) : bool
EncryptDecrypt ( string textToEncrypt ) : String
H3Secure ( ) : System
LogonUser ( string principal, string authority, string password, LogonSessionType logonType, LogonProvider logonProvider, IntPtr &token ) : bool

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

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

Base64+ decodes a string (valid in REST URL). Handles missing padding characters.
public static Base64PlusStringDecode ( string input ) : String
input string A base64+ encoded string.
Результат String

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

Base64+ decodes a string (valid in REST URL). Handles missing padding characters.
public static Base64PlusStringDecodeToBytes ( string input ) : byte[]
input string A base64+ encoded string.
Результат byte[]

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

Base64+ encodes a string (valid in REST URL).
public static Base64PlusStringEncode ( byte input ) : String
input byte A byte array to encode.
Результат String

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

Base64+ encodes a string (valid in REST URL).
public static Base64PlusStringEncode ( string input ) : String
input string A string to encode.
Результат String

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

Base64 decodes a string.
public static Base64StringDecode ( string input ) : String
input string A base64 encoded string.
Результат String

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

Base64 encodes a string.
public static Base64StringEncode ( string input ) : String
input string A string to encode.
Результат String

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

Converts a comma-separated string of 24 8-bit values and converts it into a Byte array.
public static CreateBaseKey ( String key ) : Byte[]
key String 32 8-bit values in a comma-separated list.
Результат Byte[]

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

Converts a comma-separated string of 18 8-bit values and converts it into a Byte array.
public static CreateInitVector ( String key ) : Byte[]
key String 18 8-bit values in a comma-separated list.
Результат Byte[]

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

Triple DES 256 bit string decryption.
public static Decrypt ( String data ) : String
data String String to decrypt.
Результат String

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

Triple DES 256 bit string decryption.
public static Decrypt ( String data, Byte key ) : String
data String String to decrypt.
key Byte 24 byte array key for decrypting the data. This must match the key used to encrypt the data.
Результат String

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

Triple DES 256 bit string decryption.
public static Decrypt ( String data, Byte key, Byte ivec ) : String
data String String to decrypt.
key Byte 24 byte array key for decrypting the data. This must match the key used to encrypt the data.
ivec Byte 18 byte array init vector for decrypting the data. This must match the init vector used to encrypt the data.
Результат String

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

Triple DES 256 bit string decryption.
public static Decrypt ( String data, String key, String ivec ) : String
data String String to decrypt.
key String 24 byte key string for decrypting the data. This must match the key used to encrypt the data.
ivec String 18 byte initialization vector string for the decryption routine. This must match the init vector used to encrypt the data.
Результат String

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

Triple DES 256 bit integer decryption.
public static DecryptInt32 ( String data ) : Int32?
data String String to decrypt.
Результат Int32?

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

Triple DES 256 bit integer decryption.
public static DecryptInt32 ( String data, Byte key ) : Int32?
data String String to decrypt.
key Byte 24 byte array key for decrypting the data. This must match the key used to encrypt the data.
Результат Int32?

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

Triple DES 256 bit integer decryption.
public static DecryptInt32 ( String data, Byte key, Byte ivec ) : Int32?
data String String to decrypt.
key Byte 24 byte array key for decrypting the data. This must match the key used to encrypt the data.
ivec Byte 18 byte array init vector for decrypting the data. This must match the init vector used to encrypt the data.
Результат Int32?

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

Triple DES 256 bit integer decryption.
public static DecryptInt32 ( String data, String key, String ivec ) : Int32?
data String String to decrypt.
key String 24 byte key string for decrypting the data. This must match the key used to encrypt the data.
ivec String 18 byte initialization vector string for the decryption routine. This must match the init vector used to encrypt the data.
Результат Int32?

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

Triple DES 256 bit long integer (Int64) decryption.
public static DecryptInt64 ( String data ) : Int64?
data String String to decrypt.
Результат Int64?

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

Triple DES 256 bit long integer (Int64) decryption.
public static DecryptInt64 ( String data, Byte key ) : Int64?
data String String to decrypt.
key Byte 24 byte array key for decrypting the data. This must match the key used to encrypt the data.
Результат Int64?

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

Triple DES 256 bit long integer (Int64) decryption.
public static DecryptInt64 ( String data, Byte key, Byte ivec ) : Int64?
data String String to decrypt.
key Byte 24 byte array key for decrypting the data. This must match the key used to encrypt the data.
ivec Byte 18 byte array init vector for decrypting the data. This must match the init vector used to encrypt the data.
Результат Int64?

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

Triple DES 256 bit long integer (Int64) decryption.
public static DecryptInt64 ( String data, String key, String ivec ) : Int64?
data String String to decrypt.
key String 24 byte key string for decrypting the data. This must match the key used to encrypt the data.
ivec String 18 byte initialization vector string for the decryption routine. This must match the init vector used to encrypt the data.
Результат Int64?

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

Triple DES 256 bit string encryption.
public static Encrypt ( String data ) : String
data String String to encrypt.
Результат String

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

Triple DES 256 bit string encryption.
public static Encrypt ( String data, Byte key ) : String
data String String to encrypt.
key Byte 24 byte array key for encrypting the data.
Результат String

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

Triple DES 256 bit string encryption.
public static Encrypt ( String data, Byte key, Byte ivec ) : String
data String String to encrypt.
key Byte 24 byte array key for encrypting the data.
ivec Byte 18 byte array initialization vector for the encryption routine.
Результат String

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

Triple DES 256 bit string encryption.
public static Encrypt ( String data, String key, String ivec ) : String
data String String to encrypt.
key String 32 byte key string for encrypting the data.
ivec String 16 byte initialization vector string for the encryption routine.
Результат String

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

Triple DES 256 bit encryption of 32-bit integers.
public static EncryptInt32 ( Int32 data ) : String
data System.Int32 Integer to encrypt.
Результат String

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

Triple DES 256 bit encryption of 32-bit integers.
public static EncryptInt32 ( Int32 data, Byte key ) : String
data System.Int32 Integer to encrypt.
key Byte 24 byte array key for encrypting the data.
Результат String

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

Triple DES 256 bit encryption of 32-bit integers.
public static EncryptInt32 ( Int32 data, Byte key, Byte ivec ) : String
data System.Int32 Integer to encrypt.
key Byte 24 byte array key for encrypting the data.
ivec Byte 18 byte array initialization vector for the encryption routine.
Результат String

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

Triple DES 256 bit encryption of 32-bit integers.
public static EncryptInt32 ( Int32 data, String key, String ivec ) : String
data System.Int32 Integer to encrypt.
key String 24 byte key string for encrypting the data.
ivec String 18 byte initialization vector string for the encryption routine.
Результат String

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

Triple DES 256 bit encryption of 64-bit integers.
public static EncryptInt64 ( System.Int64 data ) : String
data System.Int64 Long integer to encrypt.
Результат String

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

Triple DES 256 bit encryption of 64-bit integers.
public static EncryptInt64 ( System.Int64 data, Byte key ) : String
data System.Int64 Long integer to encrypt.
key Byte 24 byte array key for encrypting the data.
Результат String

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

Triple DES 256 bit encryption of 64-bit integers.
public static EncryptInt64 ( System.Int64 data, Byte key, Byte ivec ) : String
data System.Int64 Long integer to encrypt.
key Byte 24 byte array key for encrypting the data.
ivec Byte 18 byte array initialization vector for the encryption routine.
Результат String

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

Triple DES 256 bit encryption of 64-bit integers.
public static EncryptInt64 ( System.Int64 data, String key, String ivec ) : String
data System.Int64 Long integer to encrypt.
key String 24 byte key string for encrypting the data.
ivec String 18 byte initialization vector string for the encryption routine.
Результат String

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

Generate a comma-separated string of 8-bit values for an encryption base key. The value is not guaranteed to be unique.
public static GenerateKey ( Int32 count ) : String
count System.Int32 Number of 8-bit numbers to generate
Результат String

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

Get the currently logged-in user name (with domain) from the client.
public static GetCurrentUser ( ) : String
Результат String

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

Get the currently logged-in user name (with domain) for the running web page.
public static GetIdentity ( ) : String
Результат String

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

Begins impersonation of an authenticated user on the server, so your page will have non-anonymous permissions (e.g. to write files, etc.).
public static Impersonate ( ) : System.Boolean
Результат System.Boolean

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

Begins impersonation of an authenticated user on the server, so your page will have non-anonymous permissions (e.g. to write files, etc.).
public static Impersonate ( String domain, String userName, String password ) : System.Boolean
domain String Domain name.
userName String User name.
password String password.
Результат System.Boolean

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

MD5 encodes the passed string.
public static MD5String ( string input ) : String
input string The string to encode.
Результат String

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

Verified a string against the passed MD5 hash.
public static MD5VerifyString ( string input, string hash ) : System.Boolean
input string The string to compare.
hash string The hash to compare against.
Результат System.Boolean

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

Decrypt a string encrypted with TinyEncrypt. Ideal for passing parameters on a URL. If you need strong encryption, do not use this method.
public static TinyDecrypt ( string input ) : String
input string Encrypted string value to decrypt.
Результат String

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

Encrypt a string using a simple XOR and Base64 Encode. Ideal for passing parameters on a URL. If you need strong encryption, do not use this method.
public static TinyEncrypt ( string input ) : String
input string String value to encrypt.
Результат String

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

Ends impersonation of an authenticated user on the server, reverting back to an anonymous, default, network service account.
public static UnImpersonate ( ) : void
Результат void