using System.Security.Cryptography.X509Certificates;
namespace QRBee.Core.Security
{
///
/// Private key manipulation methods
///
public interface IPrivateKeyHandler
{
///
/// Check if private key exists on this machine
///
///
bool Exists();
///
/// Generate new private key and store it
///
///
/// Certificate request to be sent to CA
byte [] GeneratePrivateKey(string? subjectName = null);
///
/// Re-create certificate request if CA response was not received in time.
///
///
byte[] CreateCertificateRequest();
///
/// Attach CA-generated public key certificate to the private key
/// and store it
///
///
void AttachCertificate(X509Certificate2 cert);
///
/// Load private key. Note that public key certificate part can be
/// self-signed until CA issues a proper certificate
///
///
X509Certificate2 LoadPrivateKey();
}
}