Created
April 28, 2016 14:01
-
-
Save Polaringu/a9c801e67b3fc1c9665a2f7e07cbdc12 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PCCERT_CONTEXT hCertCntxt = CertFindCertificateInStore(hStore, X509_ASN_ENCODING | PKCS_7_ASN_ENCODING, CERT_FIND_ANY, CERT_FIND_SUBJECT_STR, L"AlexII", NULL); | |
//Now two pieces of code: | |
//This one will work fine: | |
DWORD MyFlags = PXC::Sign_GR_Name | PXC::Sign_TX_Name | PXC::Sign_TX_Date | PXC::Sign_TX_Location | PXC::Sign_TX_Reason | PXC::Sign_TX_DName; | |
hr = pDoc->DeferedDigitalSign((PXC::_CERT_CONTEXT*)hCertCntxt, MyFlags, 0, &rc, L"Signed by", L"", L"Support@...", L""); | |
//And this one will give the error: | |
PXC::_CERT_CONTEXT st = *(PXC::_CERT_CONTEXT*)hCertCntxt; | |
DWORD MyFlags = PXC::Sign_GR_Name | PXC::Sign_TX_Name | PXC::Sign_TX_Date | PXC::Sign_TX_Location | PXC::Sign_TX_Reason | PXC::Sign_TX_DName; | |
hr = pDoc->DeferedDigitalSign(&st, MyFlags, 0, &rc, L"Signed by", L"", L"Support@...", L""); | |
//The problem is that the _CERT_CONTEXT structure copy is made |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment