Class PemEncoding
Reads and writes PEM-encoded blocks (RFC 7468). Reading is tolerant of leading text and whitespace; writing always produces spec-compliant output with base64 wrapped at 64 characters per line.
Inherited Members
Namespace: DRIT.Mail.Rfc.Crypto
Assembly: DRIT.Mail.dll
Syntax
public static class PemEncoding
Methods
View SourceReadAll(string)
Reads all PEM blocks from the given text.
Declaration
public static IReadOnlyList<PemBlock> ReadAll(string pemText)
Parameters
| Type | Name | Description |
|---|---|---|
| string | pemText | The pem text used by the operation. |
Returns
| Type | Description |
|---|---|
| IReadOnlyList<PemBlock> |
ReadFirst(string)
Reads the first PEM block from the given text. Returns null if no block is found.
Declaration
public static PemBlock? ReadFirst(string pemText)
Parameters
| Type | Name | Description |
|---|---|---|
| string | pemText | The pem text used by the operation. |
Returns
| Type | Description |
|---|---|
| PemBlock |
Write(string, byte[])
Writes a PEM block with the given label and DER data. The base64 content is wrapped at 64 characters per line.
Declaration
public static string Write(string label, byte[] derData)
Parameters
| Type | Name | Description |
|---|---|---|
| string | label | Specifies the label value. |
| byte[] | derData | The der data used by the operation. |
Returns
| Type | Description |
|---|---|
| string |