C# Класс Keen.Core.ScopedKey

ScopedKey provides encryption and decryption functions which can be used to create and read scoped keys, such as the API Read and Write keys.
Показать файл Открыть проект

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

Метод Описание
Decrypt ( string apiKey, string scopedKey ) : string

Decrypt an existing scoped key.

Encrypt ( string apiKey, object secOptions, string IV = "" ) : string

Encrypt an object containing security options to create a scoped key.

EncryptString ( string apiKey, string secOptions, string IV = "" ) : string

Encrypt a string containing JSON formatted Security Options to create a scoped key.

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

Метод Описание
ByteToHex ( byte a ) : string
ConvertKey ( string apiKey ) : byte[]

Convert an apiKey string to a byte array.

GetAes ( byte Key, string IV ) : Aes

Set up an Aes instance with the correct mode, key and IV

HexToByte ( string hex ) : byte[]
RemovePadding ( string text ) : string

Remove PKCS5/7 padding

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

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

Decrypt an existing scoped key.
public static Decrypt ( string apiKey, string scopedKey ) : string
apiKey string Master API key
scopedKey string Scoped key to be decrypted
Результат string

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

Encrypt an object containing security options to create a scoped key.
public static Encrypt ( string apiKey, object secOptions, string IV = "" ) : string
apiKey string Master API key
secOptions object An object that can be serialized to produce JSON formatted Security Options
IV string Optional IV, normally not required
Результат string

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

Encrypt a string containing JSON formatted Security Options to create a scoped key.
public static EncryptString ( string apiKey, string secOptions, string IV = "" ) : string
apiKey string Master API key
secOptions string Security Options in JSON format
IV string Optional IV, normally not required
Результат string