Craig's Utility Library  4.0 Beta
Utilities.IO.Encryption.Interfaces.IAsymmetric Interface Reference

Asymmetric encryptor More...

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

Public Member Functions

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

Properties

string Name [get]
 Name of the encryptor More...
 

Detailed Description

Asymmetric encryptor

Definition at line 29 of file IAsymmetric.cs.

Member Function Documentation

string Utilities.IO.Encryption.Interfaces.IAsymmetric.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

Implemented in Utilities.IO.Encryption.BaseClasses.AsymmetricBase.

byte [] Utilities.IO.Encryption.Interfaces.IAsymmetric.Decrypt ( byte[]  Input,
string  Key 
)

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

Implemented in Utilities.IO.Encryption.BaseClasses.AsymmetricBase, and Utilities.IO.Encryption.Default.RSA.

byte [] Utilities.IO.Encryption.Interfaces.IAsymmetric.Encrypt ( byte[]  Input,
string  Key 
)

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)

Implemented in Utilities.IO.Encryption.BaseClasses.AsymmetricBase, and Utilities.IO.Encryption.Default.RSA.

string Utilities.IO.Encryption.Interfaces.IAsymmetric.SignHash ( string  Input,
string  Key,
out string  Hash,
Encoding  EncodingUsing = null 
)

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)

Implemented in Utilities.IO.Encryption.Default.RSA, and Utilities.IO.Encryption.BaseClasses.AsymmetricBase.

bool Utilities.IO.Encryption.Interfaces.IAsymmetric.VerifyHash ( string  Hash,
string  SignedHash,
string  Key 
)

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

Implemented in Utilities.IO.Encryption.Default.RSA, and Utilities.IO.Encryption.BaseClasses.AsymmetricBase.

Property Documentation

string Utilities.IO.Encryption.Interfaces.IAsymmetric.Name
get

Name of the encryptor

Definition at line 34 of file IAsymmetric.cs.


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