Craig's Utility Library  4.0 Beta
Utilities.IO.Encryption.Default.RSA Class Reference

RSA Encryptor More...

Inheritance diagram for Utilities.IO.Encryption.Default.RSA:
Utilities.IO.Encryption.BaseClasses.AsymmetricBase Utilities.IO.Encryption.Interfaces.IAsymmetric

Public Member Functions

override byte[] Decrypt (byte[] Input, string Key)
 Decrypts a byte array using RSA More...
 
override byte[] Encrypt (byte[] Input, string Key)
 Encrypts a string using RSA More...
 
override string SignHash (string Input, string Key, out string Hash, Encoding EncodingUsing=null)
 Takes a string and creates a signed hash of it More...
 
override bool VerifyHash (string Hash, string SignedHash, string Key)
 Verifies a signed hash against the unsigned version More...
 
- Public Member Functions inherited from Utilities.IO.Encryption.BaseClasses.AsymmetricBase
string CreateKey (bool PrivatePublic)
 Creates a new set of keys More...
 

Protected Member Functions

override System.Security.Cryptography.AsymmetricAlgorithm GetProvider ()
 Gets the provider used More...
 
- Protected Member Functions inherited from Utilities.IO.Encryption.BaseClasses.AsymmetricBase
 AsymmetricBase ()
 Constructor More...
 

Properties

override string Name [get]
 Name More...
 
- Properties inherited from Utilities.IO.Encryption.BaseClasses.AsymmetricBase
abstract string Name [get]
 Name of the encryptor More...
 
- Properties inherited from Utilities.IO.Encryption.Interfaces.IAsymmetric
string Name [get]
 Name of the encryptor More...
 

Detailed Description

RSA Encryptor

Definition at line 34 of file RSA.cs.

Member Function Documentation

override byte [] Utilities.IO.Encryption.Default.RSA.Decrypt ( byte[]  Input,
string  Key 
)
virtual

Decrypts a byte array using RSA

Parameters
InputInput byte array (should be small as anything over 128 bytes can not be decrypted)
KeyKey to use for decryption
Returns
A decrypted byte array

Implements Utilities.IO.Encryption.BaseClasses.AsymmetricBase.

Definition at line 49 of file RSA.cs.

override byte [] Utilities.IO.Encryption.Default.RSA.Encrypt ( byte[]  Input,
string  Key 
)
virtual

Encrypts a string using RSA

Parameters
InputInput byte array (should be small as anything over 128 bytes can not be decrypted)
KeyKey to use for encryption
Returns
An encrypted byte array (64bit string)

Implements Utilities.IO.Encryption.BaseClasses.AsymmetricBase.

Definition at line 70 of file RSA.cs.

override System.Security.Cryptography.AsymmetricAlgorithm Utilities.IO.Encryption.Default.RSA.GetProvider ( )
protectedvirtual

Gets the provider used

Returns
Asymmetric algorithm

Implements Utilities.IO.Encryption.BaseClasses.AsymmetricBase.

Definition at line 133 of file RSA.cs.

override string Utilities.IO.Encryption.Default.RSA.SignHash ( string  Input,
string  Key,
out string  Hash,
Encoding  EncodingUsing = null 
)
virtual

Takes a string and creates a signed hash of it

Parameters
InputInput string
KeyKey to encrypt/sign with
HashThis will be filled with the unsigned hash
EncodingUsingEncoding that the input is using (defaults to UTF8)
Returns
A signed hash of the input (64bit string)

Implements Utilities.IO.Encryption.BaseClasses.AsymmetricBase.

Definition at line 91 of file RSA.cs.

override bool Utilities.IO.Encryption.Default.RSA.VerifyHash ( string  Hash,
string  SignedHash,
string  Key 
)
virtual

Verifies a signed hash against the unsigned version

Parameters
HashThe unsigned hash (should be 64bit string)
SignedHashThe signed hash (should be 64bit string)
KeyThe key to use in decryption
Returns
True if it is verified, false otherwise

Implements Utilities.IO.Encryption.BaseClasses.AsymmetricBase.

Definition at line 113 of file RSA.cs.

Property Documentation

override string Utilities.IO.Encryption.Default.RSA.Name
get

Name

Definition at line 39 of file RSA.cs.


The documentation for this class was generated from the following file: