public X509Certificate IssueCertificate( string pkcs10Request, ExtensionBuilder extensionBuilder, string customDN = null ) { Pkcs10CertificationRequest request; using (var _sr = new StringReader(pkcs10Request)) { var pRd = new PemReader(_sr); request = (Pkcs10CertificationRequest)pRd.ReadObject(); pRd.Reader.Close(); } var isGost = request.SignatureAlgorithm.Algorithm.Id.Contains("1.2.643"); PkiService service; if (isGost) { service = new GOSTPkiService(); } else { service = new RSAPkiService(); } return(service.IssueCertificate(request, extensionBuilder, customDN)); }
public byte[] VerifySignature(CmsSignedData cms) { var isGost = false; var signer = cms.GetSignerInfos().GetSigners(); foreach (var s in signer) { var sig = (SignerInformation)s; isGost = sig.DigestAlgOid.Contains("1.2.643"); } PkiService service; if (isGost) { service = new GOSTPkiService(); } else { service = new RSAPkiService(); } return(service.VerifySignature(cms)); }
public X509Crl CreateCrl(bool isGost = false) { PkiService service; if (isGost) { service = new GOSTPkiService(); } else { service = new RSAPkiService(); } return(service.CreateCRL()); }