IGLib  1.7.2
The IGLib base library EXTENDED - with other lilbraries and applications.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros
IG.Crypt.Asym Class Reference

Static Public Member Functions

static X509Certificate2 LoadCertificate (string certificateName, StoreName storeName, StoreLocation storeLocation, bool validOnly)
 Loads a certificate from a certificate store. More...
 
static X509Certificate2 LoadCertificate (string certificateName)
 
static void CertSetDefault ()
 
static void CertCreate ()
 
static void CreateTestCertificate (string CertificateName, string StorageName, bool UserStore, string ContainerName, string CommandPath, bool ReportConsole, bool ReportForm, string OutputFile, string ValidFrom, string ValidTo)
 
static void CreateTestCertificate (string CertificateName, string StorageName, bool UserStore, string ContainerName, string CommandPath, bool ReportConsole, bool ReportForm, string OutputFile)
 
static void CreateTestCertificate (string CertificateName, string StorageName, bool UserStore, string ContainerName, string CommandPath)
 
static void CreateTestCertificate (string CertificateName, string StorageName, bool UserStore, string ContainerName)
 
static void CreateTestCertificate (string CertificateName)
 
static void CreateTestCertificate ()
 
static void LoadKeys (string containername)
 
static void DeleteKeys (string containername)
 
static void AssignParameter (string ContainerName)
 
static void AssignNewKey (string ContainterName, string PrivateKeyFileName, string PublicKeyFileName)
 
static string EncryptData (string ContainterName, string data2Encrypt, string XMLPublicKeyFileName)
 
static string DecryptData (string ContainterName, string data2Decrypt, string PrivateKeyFilename)
 
static void SignXml (XmlDocument Doc, RSA Key)
 
static Boolean VerifyXml (XmlDocument Doc, RSA Key)
 
static void TestXML (String[] args)
 
static void TestEncrypt (string message)
 

Static Public Attributes

static string TestContainerName = "Test_RSA_container"
 
static string CertName = "Test_Certificate"
 
static bool CertUserStore = true
 

Private Member Functions

RSACryptoServiceProvider CertPrivateKey (X509Certificate2 cert)
 
RSACryptoServiceProvider CertPublicKey (X509Certificate2 cert)
 

Static Private Member Functions

static byte[] EncryptMessage (byte[] plaintext, RSAParameters rsaParams)
 
static byte[] DecryptMessage (byte[] ciphertext, CspParameters cspParams)
 

Static Private Attributes

static string TestCertificateName = "Test_Certificate"
 
static string CertStorage = "my"
 certificate name in the storage More...
 
static string CertContainer = "Test_RSA_container"
 storage name More...
 
static string CertCommand = "makecert.exe"
 key container name More...
 
static string CertFile = null
 system command to call the certificate maker More...
 
static string CertValidFrom = null
 output file (should be .cert) to which certificate is exported More...
 
static string CertValidTo = null
 
static bool CertRepConsole = true
 
static bool CertRepForm = false
 
static RSACryptoServiceProvider rsaProvider
 

Member Function Documentation

static X509Certificate2 IG.Crypt.Asym.LoadCertificate ( string  certificateName,
StoreName  storeName,
StoreLocation  storeLocation,
bool  validOnly 
)
inlinestatic

Loads a certificate from a certificate store.

static X509Certificate2 IG.Crypt.Asym.LoadCertificate ( string  certificateName)
inlinestatic
RSACryptoServiceProvider IG.Crypt.Asym.CertPrivateKey ( X509Certificate2  cert)
inlineprivate
RSACryptoServiceProvider IG.Crypt.Asym.CertPublicKey ( X509Certificate2  cert)
inlineprivate
static void IG.Crypt.Asym.CertSetDefault ( )
inlinestatic
static void IG.Crypt.Asym.CertCreate ( )
inlinestatic
static void IG.Crypt.Asym.CreateTestCertificate ( string  CertificateName,
string  StorageName,
bool  UserStore,
string  ContainerName,
string  CommandPath,
bool  ReportConsole,
bool  ReportForm,
string  OutputFile,
string  ValidFrom,
string  ValidTo 
)
inlinestatic

Creates a new certificate named CertificateName, with keys stored in the container named ContainerName, and stored in the storage denoted by StorageName. If UserStore==true then the certificate is stored in the current user's store, otherwise it is stored in the machine store. If command path is a string of non-zero length then it specified the path of the makecert system command. If ReportConsole==true then reporting is performed on standard console. If ReportForm is true then reporting is performed to IGForm.Console. OutputFile ia the name of the .cer file where the X.509 certificate will be written.

References IG.Forms.UtilForms.AppConsole, IG.Forms.UtilForms.Reporter, IG.Crypt.Asym.TestCertificateName, IG.Crypt.Asym.TestContainerName, and IG.Forms.ConsoleForm.WriteLine().

static void IG.Crypt.Asym.CreateTestCertificate ( string  CertificateName,
string  StorageName,
bool  UserStore,
string  ContainerName,
string  CommandPath,
bool  ReportConsole,
bool  ReportForm,
string  OutputFile 
)
inlinestatic
static void IG.Crypt.Asym.CreateTestCertificate ( string  CertificateName,
string  StorageName,
bool  UserStore,
string  ContainerName,
string  CommandPath 
)
inlinestatic
static void IG.Crypt.Asym.CreateTestCertificate ( string  CertificateName,
string  StorageName,
bool  UserStore,
string  ContainerName 
)
inlinestatic
static void IG.Crypt.Asym.CreateTestCertificate ( string  CertificateName)
inlinestatic
static void IG.Crypt.Asym.CreateTestCertificate ( )
inlinestatic
static void IG.Crypt.Asym.LoadKeys ( string  containername)
inlinestatic
static void IG.Crypt.Asym.DeleteKeys ( string  containername)
inlinestatic
static byte [] IG.Crypt.Asym.EncryptMessage ( byte[]  plaintext,
RSAParameters  rsaParams 
)
inlinestaticprivate
static byte [] IG.Crypt.Asym.DecryptMessage ( byte[]  ciphertext,
CspParameters  cspParams 
)
inlinestaticprivate
static void IG.Crypt.Asym.AssignParameter ( string  ContainerName)
inlinestatic
static void IG.Crypt.Asym.AssignNewKey ( string  ContainterName,
string  PrivateKeyFileName,
string  PublicKeyFileName 
)
inlinestatic
static string IG.Crypt.Asym.EncryptData ( string  ContainterName,
string  data2Encrypt,
string  XMLPublicKeyFileName 
)
inlinestatic
static string IG.Crypt.Asym.DecryptData ( string  ContainterName,
string  data2Decrypt,
string  PrivateKeyFilename 
)
inlinestatic
static void IG.Crypt.Asym.SignXml ( XmlDocument  Doc,
RSA  Key 
)
inlinestatic
static Boolean IG.Crypt.Asym.VerifyXml ( XmlDocument  Doc,
RSA  Key 
)
inlinestatic
static void IG.Crypt.Asym.TestXML ( String[]  args)
inlinestatic
static void IG.Crypt.Asym.TestEncrypt ( string  message)
inlinestatic

Member Data Documentation

string IG.Crypt.Asym.TestContainerName = "Test_RSA_container"
static
string IG.Crypt.Asym.TestCertificateName = "Test_Certificate"
staticprivate
string IG.Crypt.Asym.CertName = "Test_Certificate"
static
string IG.Crypt.Asym.CertStorage = "my"
staticprivate

certificate name in the storage

string IG.Crypt.Asym.CertContainer = "Test_RSA_container"
staticprivate

storage name

string IG.Crypt.Asym.CertCommand = "makecert.exe"
staticprivate

key container name

string IG.Crypt.Asym.CertFile = null
staticprivate

system command to call the certificate maker

Referenced by IG.Crypt.encryption_test.Main().

string IG.Crypt.Asym.CertValidFrom = null
staticprivate

output file (should be .cert) to which certificate is exported

Referenced by IG.Crypt.encryption_test.Main().

string IG.Crypt.Asym.CertValidTo = null
staticprivate
bool IG.Crypt.Asym.CertUserStore = true
static
bool IG.Crypt.Asym.CertRepConsole = true
staticprivate
bool IG.Crypt.Asym.CertRepForm = false
staticprivate
RSACryptoServiceProvider IG.Crypt.Asym.rsaProvider
staticprivate

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