Class AsymmetricKeygenRSA
Asymmetric RSA key generator. RSAKeySize
Inheritance
System.Object
AsymmetricKeygenRSA
Implements
Namespace: GlitchedPolygons.Services.Cryptography.Asymmetric
Assembly: GlitchedPolygons.Services.Cryptography.Asymmetric.dll
Syntax
public class AsymmetricKeygenRSA : object, IAsymmetricKeygenRSA
Constructors
| Improve this Doc View SourceAsymmetricKeygenRSA(Action<String>)
Creates a new asymmetric RSA key generator.
Optional callback for when an exception is thrown during key generation (could be fed back to your own personal error logging provider for example). The passedstring
parameter is the error message, including the full exception's content...
Declaration
public AsymmetricKeygenRSA(Action<string> errorCallback = null)
Parameters
Type | Name | Description |
---|---|---|
Action<System.String> | errorCallback |
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
is returned.
Declaration
public 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 |