Table of Contents

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

keyXml string

The XML string containing the private key data.

Fields

Coefficient

The coefficient (InverseQ = Q^-1 mod P).

public string Coefficient

Field Value

string

Exponent

The exponent component of the key.

public string Exponent

Field Value

string

Modulus

The modulus component of the key.

public string Modulus

Field Value

string

PrimeExponentP

The first prime exponent (DP = D mod P-1).

public string PrimeExponentP

Field Value

string

PrimeExponentQ

The second prime exponent (DQ = D mod Q-1).

public string PrimeExponentQ

Field Value

string

PrimeP

The first prime factor (P) of the key.

public string PrimeP

Field Value

string

PrimeQ

The second prime factor (Q) of the key.

public string PrimeQ

Field Value

string

PrivateExponent

The private exponent (D) of the key.

public string PrivateExponent

Field Value

string

Methods

ExportToConfigFile(string)

Writes the *.config file representation of this private key to a file.

public void ExportToConfigFile(string filePath)

Parameters

filePath string

The 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

filePath string

The 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

keyXml string

The XML string containing the private key data.

ToConfigSection()

Returns *.config file XML section representing this private key.

public string ToConfigSection()

Returns

string

ToParameters()

Converts this private key to an RSAParameters object.

public RSAParameters ToParameters()

Returns

RSAParameters

ToXml()

Converts this private key to its XML string representation.

public string ToXml()

Returns

string