Class KeyFactory
Provides helper methods for handling keys.
Inheritance
KeyFactory
Namespace: Certes
Assembly: Certes.dll
Syntax
public static class KeyFactory
Methods
| Edit this page View SourceFromDer(byte[])
Parse the key from DER encoded data.
Declaration
public static IKey FromDer(byte[] der)
Parameters
| Type | Name | Description |
|---|---|---|
| byte[] | der | The DER encoded data. |
Returns
| Type | Description |
|---|---|
| IKey | The key restored. |
FromPem(string)
Parse the key from PEM encoded text.
Declaration
public static IKey FromPem(string pem)
Parameters
| Type | Name | Description |
|---|---|---|
| string | pem | The PEM encoded text. |
Returns
| Type | Description |
|---|---|
| IKey | The key restored. |
NewKey(KeyAlgorithm, int?)
Creates a random key.
Declaration
public static IKey NewKey(KeyAlgorithm algorithm, int? keySize = null)
Parameters
| Type | Name | Description |
|---|---|---|
| KeyAlgorithm | algorithm | The algorithm to use. |
| int? | keySize | Optional key size (used for RSA, defaults to 2048) |
Returns
| Type | Description |
|---|---|
| IKey | The key created. |