PemReader.GetPrivateKey
Contents
[
Hide
]GetPrivateKey(Stream)
Reads an RSA private key from a PEM-encoded stream.
public static RSACryptoServiceProvider GetPrivateKey(Stream pem)
| Parameter | Type | Description |
|---|---|---|
| pem | Stream | Stream with the PEM-encoded private key, in PKCS#1 or PKCS#8 format. |
Return Value
An RSA provider initialized with the private key.
Exceptions
| exception | condition |
|---|---|
| FormatException | The stream does not contain a supported PEM private key. |
See Also
- class PemReader
- namespace Aspose.Email.DKIM
- assembly Aspose.Email
GetPrivateKey(string)
Reads an RSA private key from a PEM file.
public static RSACryptoServiceProvider GetPrivateKey(string path)
| Parameter | Type | Description |
|---|---|---|
| path | String | Path to the PEM file with the private key. |
Return Value
An RSA provider initialized with the private key.
Exceptions
| exception | condition |
|---|---|
| FormatException | The file does not contain a supported PEM private key. |
See Also
- class PemReader
- namespace Aspose.Email.DKIM
- assembly Aspose.Email