PrivateKeyInfo Class
Namespace: Rebex.Security.Cryptography.Pkcs
Assembly: Rebex.Common.dll (version 7.0.9083)
Represents a private key.
Syntax
public class PrivateKeyInfo : PkcsBase
Inherited Members
Constructors
Name | Description |
---|---|
PrivateKeyInfo() | Creates a new instance of PrivateKeyInfo. Use the Load(Stream, String) method to load a private key. |
PrivateKeyInfo(PrivateKeyInfo) | Creates a new instance of PrivateKeyInfo that clones the supplied instance. |
PrivateKeyInfo(DSAParameters) | Creates a new instance of PrivateKeyInfo based on the specified DSA parameters. |
PrivateKeyInfo(RSAParameters) | Creates a new instance of PrivateKeyInfo based on the specified RSA parameters. |
Properties
Name | Description |
---|---|
Comment | Gets or ets the key comment. The comment is used while saving in some formats. |
KeyAlgorithm | Gets the key algorithm identifier. |
Methods
Name | Description |
---|---|
Encode() | Gets ASN.1 encoded form of this PrivateKeyInfo object. |
Generate(KeyAlgorithm) | Generates a private key using the specified algorithm and default key size. |
Generate(KeyAlgorithm, Int32) | Generates a private key using the specified algorithm and key size. |
GetDSAParameters() | Gets the DSA parameters for a DSA key. May only be used for DSA private keys. |
GetPublicKey() | Gets a public key corresponding to the private key. |
GetRSAParameters() | Gets the RSA parameters for a RSA key. May only be used for RSA private keys. |
Load(Stream, Byte[]) | Loads a PKCS #8, PuTTY or SSLeay (OpenSSL/OpenSSH) format private key from a stream. Upon successful decoding, information can be retrieved using PrivateKeyInfo methods and properties. |
Load(Stream, String) | Loads a PKCS #8, PuTTY or SSLeay (OpenSSL/OpenSSH) format private key from a stream. Upon successful decoding, information can be retrieved using PrivateKeyInfo methods and properties. |
Load(String, String) | Loads a PKCS #8, PuTTY or SSLeay (OpenSSL/OpenSSH) format private key from a stream. Upon successful decoding, information can be retrieved using PrivateKeyInfo methods and properties. |
LoadSignedOrEnvelopedData(Stream, ICertificateFinder, Boolean) | Loads a CMS/PKCS #7 signed or enveloped message from a stream. Returns an instance of SignedData for signed message, EnvelopedData for enveloped message, or null for methods and properties. Inherited from PkcsBase. |
Save(Stream, Byte[], PrivateKeyFormat) | Saves the private key into the supplied stream in the specified format. |
Save(Stream, String, ObjectIdentifier) | Saves the private key into the supplied stream in Base64-encoded PKCS #8 format. |
Save(Stream, String, PrivateKeyFormat) | Saves the private key into the supplied stream in the specified format. |
Save(String, String, PrivateKeyFormat) | Saves the private key into the supplied stream in the specified format. |
ToBytes() | Gets the raw form of the private key. |