I am trying to create certificate request programmatically from existing public key. But I get an "The requested property value is empty. (Exception from HRESULT: 0x80094004)" exception. Here is my code: private static string CreateCertRequestMessage(string encodedPublicKeyInfo) { CObjectId objAlg = new CObjectId(); objAlg.InitializeFromAlgorithmName( ObjectIdGroupId.XCN_CRYPT_PUBKEY_ALG_OID_GROUP_ID, ObjectIdPublicKeyFlags.XCN_CRYPT_OID_INFO_PUBKEY_ANY, AlgorithmFlags.AlgorithmFlagsNone, "RSA"); CX509PublicKey objPublicKey = [...] read more
I want to create CX509CertificateRequestPkcs with initializefromcertificate And i want to use X509RequestInheritOptions.InheritNewSimilarkey to generate new keypair where original certificate'key pair exsit But i get error CertEnroll::CX509CertificateRequestPkcs7::InitializeFromCertificate: The requested property value is empty. 0x80094004 (-2146877436 CERTSRV_E_PROPERTY_EMPTY)" This is my code X509Store store = new X509Store(StoreLocation.CurrentUser); store.Open(OpenFlags.ReadOnly); foreach (X509Certificate2 c in [...] read more