Craig's Utility Library  4.0 Beta
Utilities.IO.Encryption.BaseClasses.AsymmetricBase Class Referenceabstract

Asymmetric base class More...

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

Public Member Functions

string CreateKey (bool PrivatePublic)
 Creates a new set of keys More...
 
abstract byte[] Decrypt (byte[] Input, string Key)
 Decrypts a byte array using RSA More...
 
abstract byte[] Encrypt (byte[] Input, string Key)
 Encrypts a string using RSA More...
 
abstract string SignHash (string Input, string Key, out string Hash, Encoding EncodingUsing=null)
 Takes a string and creates a signed hash of it More...
 
abstract bool VerifyHash (string Hash, string SignedHash, string Key)
 Verifies a signed hash against the unsigned version More...
 

Protected Member Functions

 AsymmetricBase ()
 Constructor More...
 
abstract AsymmetricAlgorithm GetProvider ()
 Gets the provider used More...
 

Properties

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

Asymmetric base class

Definition at line 31 of file AsymmetricBase.cs.

Constructor & Destructor Documentation

Utilities.IO.Encryption.BaseClasses.AsymmetricBase.AsymmetricBase ( )
protected

Constructor

Definition at line 36 of file AsymmetricBase.cs.

Member Function Documentation

string Utilities.IO.Encryption.BaseClasses.AsymmetricBase.CreateKey ( bool  PrivatePublic)

Creates a new set of keys

Parameters
PrivatePublicTrue if private key should be included, false otherwise
Returns
XML representation of the key information

Implements Utilities.IO.Encryption.Interfaces.IAsymmetric.

Definition at line 50 of file AsymmetricBase.cs.

abstract byte [] Utilities.IO.Encryption.BaseClasses.AsymmetricBase.Decrypt ( byte[]  Input,
string  Key 
)
pure 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.Interfaces.IAsymmetric.

Implemented in Utilities.IO.Encryption.Default.RSA.

abstract byte [] Utilities.IO.Encryption.BaseClasses.AsymmetricBase.Encrypt ( byte[]  Input,
string  Key 
)
pure 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.Interfaces.IAsymmetric.

Implemented in Utilities.IO.Encryption.Default.RSA.

abstract AsymmetricAlgorithm Utilities.IO.Encryption.BaseClasses.AsymmetricBase.GetProvider ( )
protectedpure virtual

Gets the provider used

Returns
Asymmetric algorithm

Implemented in Utilities.IO.Encryption.Default.RSA.

abstract string Utilities.IO.Encryption.BaseClasses.AsymmetricBase.SignHash ( string  Input,
string  Key,
out string  Hash,
Encoding  EncodingUsing = null 
)
pure 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.Interfaces.IAsymmetric.

Implemented in Utilities.IO.Encryption.Default.RSA.

abstract bool Utilities.IO.Encryption.BaseClasses.AsymmetricBase.VerifyHash ( string  Hash,
string  SignedHash,
string  Key 
)
pure 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.Interfaces.IAsymmetric.

Implemented in Utilities.IO.Encryption.Default.RSA.

Property Documentation

abstract string Utilities.IO.Encryption.BaseClasses.AsymmetricBase.Name
get

Name of the encryptor

Definition at line 43 of file AsymmetricBase.cs.


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