Cypher for .net

PGPKeyGenerator..::..GenerateKeys Method (X509Certificate2, Boolean)

Generates the keys based on a certificate compatible with the method.

Namespace:  Walter.Cypher.PGP
Assembly:  Walter.Cypher (in Walter.Cypher.dll)

Syntax


public KeyRing GenerateKeys(
	X509Certificate2 cert,
	bool publicOnly
)

Parameters

cert
Type: X509Certificate2
The certificate.
publicOnly
Type: Boolean
if set to true only the public key will be used.

Return Value

KeyRing.

Exceptions


ExceptionCondition
[ArgumentNullException]cert
[Exception]Key should be multiple of two and greater than 512.
[NotSupportedException]the certificate does not have a private key
[NotSupportedException]the certificate does not allow exporting public key parameters

Remarks


The Certificate must support RSA and XML key exporting