Skip to content

GenerateRsaKeyPair Method ​

Definition ​

  • Namespace: JASE.Crypto
  • Assembly: JASE.Crypto.dll

Overloads ​

NameDescription
bool GenerateRsaKeyPair(out byte[] publicKey, out byte[] privateKey, int keySize)Generates a new RSA key pair and returns the keys as raw byte arrays.
bool GenerateRsaKeyPair(out string publicKey, out string privateKey, int keySize)Generates a new RSA key pair and returns the keys as XML-formatted strings.

bool GenerateRsaKeyPair(out byte[] publicKey, out byte[] privateKey, int keySize) ​

csharp
bool GenerateRsaKeyPair(out byte[] publicKey, out byte[] privateKey, int keySize)

Generates a new RSA key pair and returns the keys as raw byte arrays.

Parameters ​

NameDescription
keySizeThe size of the RSA key to generate (in bits). Common sizes are 2048, 3072, or 4096.
privateKeyThe output parameter that will contain the private key in raw binary format.
publicKeyThe output parameter that will contain the public key in raw binary format.

Returns ​

True if the keys were successfully generated; otherwise, false.

bool GenerateRsaKeyPair(out string publicKey, out string privateKey, int keySize) ​

csharp
bool GenerateRsaKeyPair(out string publicKey, out string privateKey, int keySize)

Generates a new RSA key pair and returns the keys as XML-formatted strings.

Parameters ​

NameDescription
keySizeThe size of the RSA key to generate (in bits). Common sizes are 2048, 3072, or 4096.
privateKeyThe output parameter that will contain the private key in XML format.
publicKeyThe output parameter that will contain the public key in XML format.

Returns ​

True if the keys were successfully generated; otherwise, false.