C# 클래스 Yea.Encryption.RSAEncryption

Utility class for doing RSA Encryption
파일 보기 프로젝트 열기: OxPatient/Rule-Engine

공개 메소드들

메소드 설명
CreateKey ( bool privatePublic ) : string

Creates a new set of keys

Decrypt ( string input, string key, Encoding encodingUsing = null ) : string

Decrypts a string using RSA

Encrypt ( string input, string key, Encoding encodingUsing = null ) : string

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

메소드 상세

CreateKey() 공개 정적인 메소드

Creates a new set of keys
public static CreateKey ( bool privatePublic ) : string
privatePublic bool True if private key should be included, false otherwise
리턴 string

Decrypt() 공개 정적인 메소드

Decrypts a string using RSA
public static Decrypt ( string input, string key, Encoding encodingUsing = null ) : string
input string Input string (should be small as anything over 128 bytes can not be decrypted)
key string Key to use for decryption
encodingUsing System.Text.Encoding Encoding that the result should use (defaults to UTF8)
리턴 string

Encrypt() 공개 정적인 메소드

Encrypts a string using RSA
public static Encrypt ( string input, string key, Encoding encodingUsing = null ) : string
input string Input string (should be small as anything over 128 bytes can not be decrypted)
key string Key to use for encryption
encodingUsing System.Text.Encoding Encoding that the input string uses (defaults to UTF8)
리턴 string

SignHash() 공개 정적인 메소드

Takes a string and creates a signed hash of it
public static 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 static 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