Class Asymmetric.PrivateKey
- Namespace
- SunamoShared.Crypting
- Assembly
- SunamoShared.dll
Represents a private encryption key. Not intended to be shared, as it contains all the elements that make up the key.
public class Asymmetric.PrivateKey
- Inheritance
-
Asymmetric.PrivateKey
- Inherited Members
- Extension Methods
Constructors
PrivateKey()
Initializes a new instance of the Asymmetric.PrivateKey class.
public PrivateKey()
PrivateKey(string)
Initializes a new instance of the Asymmetric.PrivateKey class from an XML string containing all key elements.
public PrivateKey(string keyXml)
Parameters
keyXmlstringThe XML string containing the private key data.
Fields
Coefficient
The coefficient (InverseQ = Q^-1 mod P).
public string Coefficient
Field Value
Exponent
The exponent component of the key.
public string Exponent
Field Value
Modulus
The modulus component of the key.
public string Modulus
Field Value
PrimeExponentP
The first prime exponent (DP = D mod P-1).
public string PrimeExponentP
Field Value
PrimeExponentQ
The second prime exponent (DQ = D mod Q-1).
public string PrimeExponentQ
Field Value
PrimeP
The first prime factor (P) of the key.
public string PrimeP
Field Value
PrimeQ
The second prime factor (Q) of the key.
public string PrimeQ
Field Value
PrivateExponent
The private exponent (D) of the key.
public string PrivateExponent
Field Value
Methods
ExportToConfigFile(string)
Writes the *.config file representation of this private key to a file.
public void ExportToConfigFile(string filePath)
Parameters
filePathstringThe file path to write the config section to.
ExportToXmlFile(string)
Writes the XML representation of this private key to a file.
public void ExportToXmlFile(string filePath)
Parameters
filePathstringThe file path to write the XML to.
LoadFromConfig()
Loads the private key from App.config or Web.config file.
public void LoadFromConfig()
LoadFromXml(string)
Loads the private key from its XML string.
public void LoadFromXml(string keyXml)
Parameters
keyXmlstringThe XML string containing the private key data.
ToConfigSection()
Returns *.config file XML section representing this private key.
public string ToConfigSection()
Returns
ToParameters()
Converts this private key to an RSAParameters object.
public RSAParameters ToParameters()
Returns
ToXml()
Converts this private key to its XML string representation.
public string ToXml()