C# Класс Utilities.IO.Encryption.Default.RSA

RSA Encryptor
Наследование: Utilities.IO.Encryption.BaseClasses.AsymmetricBase
Показать файл Открыть проект

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

Метод Описание
Decrypt ( byte Input, string Key ) : byte[]

Decrypts a byte array using RSA

Encrypt ( byte Input, string Key ) : byte[]

Encrypts a string using RSA

SignHash ( string Input, string Key, string &Hash, Encoding EncodingUsing = null ) : string

Takes a string and creates a signed hash of it

VerifyHash ( string Hash, string SignedHash, string Key ) : bool

Verifies a signed hash against the unsigned version

Защищенные методы

Метод Описание
GetProvider ( ) : AsymmetricAlgorithm

Gets the provider used

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

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

Decrypts a byte array using RSA
public Decrypt ( byte Input, string Key ) : byte[]
Input byte /// Input byte array (should be small as anything over 128 bytes can not be decrypted) ///
Key string Key to use for decryption
Результат byte[]

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

Encrypts a string using RSA
public Encrypt ( byte Input, string Key ) : byte[]
Input byte /// Input byte array (should be small as anything over 128 bytes can not be decrypted) ///
Key string Key to use for encryption
Результат byte[]

GetProvider() защищенный Метод

Gets the provider used
protected GetProvider ( ) : AsymmetricAlgorithm
Результат System.Security.Cryptography.AsymmetricAlgorithm

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

Takes a string and creates a signed hash of it
public SignHash ( string Input, string Key, string &Hash, Encoding EncodingUsing = null ) : string
Input string Input string
Key string Key to encrypt/sign with
Hash string This will be filled with the unsigned hash
EncodingUsing System.Text.Encoding Encoding that the input is using (defaults to UTF8)
Результат string

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

Verifies a signed hash against the unsigned version
public VerifyHash ( string Hash, string SignedHash, string Key ) : bool
Hash string The unsigned hash (should be 64bit string)
SignedHash string The signed hash (should be 64bit string)
Key string The key to use in decryption
Результат bool