logo

This class can be used to verify a file or string with the NoteFly public key to check if the file or data is really coming from the developer who owns the NoteFly private key. More...

Public Member Functions

 RSAVerify ()
 Initializes a new instance of the RSAVerify class. More...
 
bool CheckFileSignatureAndDisplayErrors (string filepath, string signature)
 Check a signature for a file and display a error if signature is invalid. More...
 
bool CheckSignatureFilehash (string filepath, string signature)
 Check a signature for a hash of a file. More...
 

Private Member Functions

bool IsValidSignature (string data, object hashinsignatureused, string signature)
 Check data and with the signature. More...
 
string Sha256file (string file)
 Generate a SHA 256 hash for a file. More...
 

Private Attributes

const int RSAKETSIZE = 3072
 The RSA NoteFly keysize used. More...
 
const string XMLRSAPUBLICKEY = "<RSAKeyValue><Modulus>zxrgHdkENFOlcTI0AxDMhLgNzduTikBd1EX9gwWz+vTxgfR3RM2P3M8ImNL6QYk0Sch78wv3zac3pjWINoqpazFBwb1A0jawJUxgftfbEmfDvBuK58f+FOeE4KxYE9za+jZyxCn6bbj/M7cK2wgo8Mhmq/WP9aFUf8dcVcQH+3cqNt56zLSUXHcIdexZwVRv9SbzlY6MtlmRuzKO++O3ersXWuJPf8DJu98bAP2W0B3puPhNtXb6SnBF/FO9BZUDcCYNrJ0IuwyMA1nBm8aFPfok12ohzSAP1r5Hs0yVtmOXucWBdv7lim9jhL1aqXsh0U2aT0zxBaLWZsU7WwX8Iikb4ZEXkTsmBRHhPGfQ81P8zZAlgmmmCC+jLRK93cPZYcH9t6UFcdGgaDAurck9bmB+Mb6bahkv5eiumRbDXixLN3jVIDtOjI2Bg4KvdgYKJskuXpICadF/rC/ZNq7ZtONJ7wrVUu+Q/dRONE3okoCeZjK7JUdlVdWGVGG7fgZj</Modulus><Exponent>AQAB</Exponent></RSAKeyValue>"
 The RSA NoteFly public key. More...
 
RSACryptoServiceProvider rsaCryptoServiceProvider = null
 RSACryptoServiceProvider More...
 

Detailed Description

No RSA encryption is being used, only RSA signature checking is used. Patent on RSA is waived after 6, 2000. source: http://www.rsa.com/rsalabs/node.asp?id=2322

Constructor & Destructor Documentation

NoteFly.RSAVerify.RSAVerify ( )

Member Function Documentation

bool NoteFly.RSAVerify.CheckFileSignatureAndDisplayErrors ( string  filepath,
string  signature 
)
Parameters
filepathThe full file path to the file to check the signature from.
Returns
True if RSA signature of hash of file is valid for a file.
bool NoteFly.RSAVerify.CheckSignatureFilehash ( string  filepath,
string  signature 
)
Parameters
filepathThe full file path to the file to check the signature from the hash of the file.
Returns
True if the hash of the file is valid by the signature
bool NoteFly.RSAVerify.IsValidSignature ( string  data,
object  hashinsignatureused,
string  signature 
)
private
Parameters
dataThe data to check the signature from.
hashinsignatureusedThe signature of the hash.
Returns
True if the signature is valid for the data.
string NoteFly.RSAVerify.Sha256file ( string  file)
private
Parameters
fileThe full file path to create the hash from.
Returns
The SHA256 hash as string

Member Data Documentation

RSACryptoServiceProvider NoteFly.RSAVerify.rsaCryptoServiceProvider = null
private
const int NoteFly.RSAVerify.RSAKETSIZE = 3072
private
const string NoteFly.RSAVerify.XMLRSAPUBLICKEY = "<RSAKeyValue><Modulus>zxrgHdkENFOlcTI0AxDMhLgNzduTikBd1EX9gwWz+vTxgfR3RM2P3M8ImNL6QYk0Sch78wv3zac3pjWINoqpazFBwb1A0jawJUxgftfbEmfDvBuK58f+FOeE4KxYE9za+jZyxCn6bbj/M7cK2wgo8Mhmq/WP9aFUf8dcVcQH+3cqNt56zLSUXHcIdexZwVRv9SbzlY6MtlmRuzKO++O3ersXWuJPf8DJu98bAP2W0B3puPhNtXb6SnBF/FO9BZUDcCYNrJ0IuwyMA1nBm8aFPfok12ohzSAP1r5Hs0yVtmOXucWBdv7lim9jhL1aqXsh0U2aT0zxBaLWZsU7WwX8Iikb4ZEXkTsmBRHhPGfQ81P8zZAlgmmmCC+jLRK93cPZYcH9t6UFcdGgaDAurck9bmB+Mb6bahkv5eiumRbDXixLN3jVIDtOjI2Bg4KvdgYKJskuXpICadF/rC/ZNq7ZtONJ7wrVUu+Q/dRONE3okoCeZjK7JUdlVdWGVGG7fgZj</Modulus><Exponent>AQAB</Exponent></RSAKeyValue>"
private