Interface IAsymmetricKeygenRSA
Asymmetric RSA key generator. RSAKeySize
Namespace: GlitchedPolygons.Services.Cryptography.Asymmetric
Assembly: GlitchedPolygons.Services.Cryptography.Asymmetric.dll
Syntax
public interface IAsymmetricKeygenRSA
Methods
| Improve this Doc View SourceGenerateKeyPair(RSAKeySize)
Generates a new RSA key pair keySize
.
Returns the RSA key pair
If generation failed for some reason,
(null,null)
is returned.
Declaration
Task<ValueTuple<string, string>> GenerateKeyPair(RSAKeySize keySize)
Parameters
Type | Name | Description |
---|---|---|
RSAKeySize | keySize | The desired RSA key size. Can be 512-bit, 1024-bit, 2048-bit or 4096-bit. |
Returns
Type | Description |
---|---|
Task<ValueTuple<System.String, System.String>> | The key pair tuple where the first item is the public RSA key and the second one is the private key (both PEM-formatted strings). If key generation failed, both tuple items are |