/// <inheritdoc/>
 public override X509Certificate2 CreateForRSA()
 {
     if (m_rsaPublicKey != null)
     {
         return(CreateForRSAWithPublicKey());
     }
     else
     {
         string passcode = X509Utils.GeneratePasscode();
         return(X509PfxUtils.CreateCertificateFromPKCS12(CreatePfxForRSA(passcode), passcode));
     }
 }
        /// <inheritdoc/>
        public override X509Certificate2 CreateForRSA(X509SignatureGenerator generator)
        {
            if (generator == null)
            {
                throw new ArgumentNullException(nameof(generator));
            }
            ISignatureFactory signatureFactory = new X509SignatureFactory(HashAlgorithmName, generator);

            if (m_rsaPublicKey != null)
            {
                return(CreateForRSAWithPublicKey(signatureFactory));
            }
            else
            {
                string passcode = X509Utils.GeneratePasscode();
                return(X509PfxUtils.CreateCertificateFromPKCS12(CreatePfxForRSA(passcode, signatureFactory), passcode));
            }
        }