PrivateKeyInfo.Generate Method
Namespace: Rebex.Security.Cryptography.Pkcs
Assembly: Rebex.Common.dll (version 7.0.9448)
Generate(KeyAlgorithm)
Generates a private key using the specified algorithm and default key size.
Declaration
public static PrivateKeyInfo Generate(KeyAlgorithm algorithm)
Parameters
| Type | Name | Description |
|---|---|---|
| KeyAlgorithm | algorithm | Key algorithm. |
Returns
| Type | Description |
|---|---|
| PrivateKeyInfo | An instance of PrivateKeyInfo. |
Generate(KeyAlgorithm, Int32)
Generates a private key using the specified algorithm and key size.
Declaration
public static PrivateKeyInfo Generate(KeyAlgorithm algorithm, int keySize)
Parameters
| Type | Name | Description |
|---|---|---|
| KeyAlgorithm | algorithm | Key algorithm. |
| Int32 | keySize | Key size. Specify 0 to use default key size. |
Returns
| Type | Description |
|---|---|
| PrivateKeyInfo | An instance of PrivateKeyInfo. |