I now have resolved the key point of my issue in the certificate management and thought I would post my solution.
The certificate management requirements were limited to only attaching to the SOAP message, I was able to achieve the solution by using the wcrypt2 library. My original code using CAPICOM (with the help of many internet searches) was
Certificate1.Load(CertFile, certpword, CAPICOM_KEY_STORAGE_DEFAULT,
CAPICOM_CURRENT_USER_KEY);
Cert2 := Certificate1.DefaultInterface;
CertContext := Cert2 as ICertContext;
CertContext.Get_CertContext(Integer(PCertContext));
if internetsetOption(Data, INTERNET_OPTION_CLIENT_CERT_CONTEXT,
PCertContext, SizeOf(CERT_CONTEXT)) = False then
begin
'Error Handling'
end;
By using wcrypt2 I was able to read from the certificate store and attach to the soap message by a simple change to my BeforePost function with
hMyStore:=CertOpenSystemStore(0,'MY');
pCertContext:=CertFindCertificateInStore(
hMyStore,
X509_ASN_ENCODING,
0,
CERT_FIND_SUBJECT_STR,
PCHAR('KeyName'),Nil
);
if internetsetOption(Data, INTERNET_OPTION_CLIENT_CERT_CONTEXT,
PCertContext, SizeOf(CERT_CONTEXT)) = False then
begin
'error handling'
end;
And now I am compatible with Windows 8.1, as wininet is still compatible with 8.1 this is not on my critical path and have further time to deploy a solution.
Any further advice on my solution would be greatly appreciated.