Space Engineers
Public Member Functions | Properties | List of all members
VRage.Common.Utils.MyRSA Class Reference

Public Member Functions

 MyRSA ()
 
void GenerateKeys (string publicKeyFileName, string privateKeyFileName)
 
void GenerateKeys (out byte[] publicKey, out byte[] privateKey)
 Generate keys into specified files. More...
 
string SignData (string data, string privateKey)
 Signs given data with provided key. More...
 
string SignHash (byte[] hash, byte[] privateKey)
 Signs given hash with provided key. More...
 
string SignHash (string hash, string privateKey)
 Signs given hash with provided key. More...
 
bool VerifyHash (byte[] hash, byte[] signedHash, byte[] publicKey)
 Verifies that a digital signature is valid by determining the hash value in the signature using the provided public key and comparing it to the provided hash value. More...
 
bool VerifyHash (string hash, string signedHash, string publicKey)
 Verifies that a digital signature is valid by determining the hash value in the signature using the provided public key and comparing it to the provided hash value. More...
 
bool VerifyData (string originalMessage, string signedMessage, string publicKey)
 Verifies that a digital signature is valid by determining the hash value in the signature using the provided public key and comparing it to the hash value of the provided data. More...
 

Properties

HashAlgorithm HashObject [get]
 

Detailed Description

Definition at line 14 of file MyRSA.cs.

Constructor & Destructor Documentation

VRage.Common.Utils.MyRSA.MyRSA ( )
inline

Definition at line 22 of file MyRSA.cs.

Member Function Documentation

void VRage.Common.Utils.MyRSA.GenerateKeys ( string  publicKeyFileName,
string  privateKeyFileName 
)
inline

Definition at line 28 of file MyRSA.cs.

void VRage.Common.Utils.MyRSA.GenerateKeys ( out byte[]  publicKey,
out byte[]  privateKey 
)
inline

Generate keys into specified files.

Parameters
publicKeyFileNameName of the file that will contain public key
privateKeyFileNameName of the file that will contain private key

Definition at line 49 of file MyRSA.cs.

string VRage.Common.Utils.MyRSA.SignData ( string  data,
string  privateKey 
)
inline

Signs given data with provided key.

Parameters
datadata to sign (in base64 form)
privateKeyprivate key (in base64 form)
Returns
Signed data (string in base64 form)

Definition at line 90 of file MyRSA.cs.

string VRage.Common.Utils.MyRSA.SignHash ( byte[]  hash,
byte[]  privateKey 
)
inline

Signs given hash with provided key.

Parameters
hashhash to sign
privateKeyprivate key
Returns
Signed hash (string in base64 form)

Definition at line 126 of file MyRSA.cs.

string VRage.Common.Utils.MyRSA.SignHash ( string  hash,
string  privateKey 
)
inline

Signs given hash with provided key.

Parameters
hashhash to sign (in base64 form)
privateKeyprivate key (in base64 form)
Returns
Signed hash (string in base64 form)

Definition at line 159 of file MyRSA.cs.

bool VRage.Common.Utils.MyRSA.VerifyData ( string  originalMessage,
string  signedMessage,
string  publicKey 
)
inline

Verifies that a digital signature is valid by determining the hash value in the signature using the provided public key and comparing it to the hash value of the provided data.

Parameters
originalMessageoriginal data
signedMessagesigned message (in base64 form)
publicKeysignature (in base64 form)
Returns
true if the signature is valid; otherwise, false.

Definition at line 259 of file MyRSA.cs.

bool VRage.Common.Utils.MyRSA.VerifyHash ( byte[]  hash,
byte[]  signedHash,
byte[]  publicKey 
)
inline

Verifies that a digital signature is valid by determining the hash value in the signature using the provided public key and comparing it to the provided hash value.

Parameters
hashhash to test
signedHashalready signed hash
publicKeysignature
Returns
true if the signature is valid; otherwise, false.

Definition at line 197 of file MyRSA.cs.

bool VRage.Common.Utils.MyRSA.VerifyHash ( string  hash,
string  signedHash,
string  publicKey 
)
inline

Verifies that a digital signature is valid by determining the hash value in the signature using the provided public key and comparing it to the provided hash value.

Parameters
hashhash to test
signedHashalready signed hash (in base64 form)
publicKeysignature (in base64 form)
Returns
true if the signature is valid; otherwise, false.

Definition at line 226 of file MyRSA.cs.

Property Documentation

HashAlgorithm VRage.Common.Utils.MyRSA.HashObject
get

Definition at line 20 of file MyRSA.cs.


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