[prev in list] [next in list] [prev in thread] [next in thread]
List: ms-cryptoapi
Subject: How can I revocked a certificate ?
From: Richard Louapre <Richard.Louapre () DOCFLOW ! IT>
Date: 2000-12-21 8:59:41
[Download RAW message or body]
Hello,
I want to revocke certificates using a CRL.
I join my code, but I've an error on CertVerifyRevocation :
Is it the good way to revocke a certificate ?
if (fp = fopen (filename, "rb"))
cbCertEncoded = fread (pbCertEncoded, 1, 500, fp);
PCCRL_CONTEXT pcCRLContext = CertCreateCRLContext(
MY_ENCODING_TYPE,
pbCertEncoded,
cbCertEncoded
);
BYTE *pvData;
DWORD pcbData;
int i = 0;
hCertStore = CertOpenSystemStore( NULL, MyStoreName);
if (!hCertStore)
// If the store was not opened, exit to an error routine.
goto Exit;
while (pTmpCertContext = CertFindCertificateInStore(
hCertStore,
MY_ENCODING_TYPE, // Use
X509_ASN_ENCODING.
0, //
No dwFlags needed.
FIND_IN_FIELD,
//CERT_FIND_SUBJECT_STR,
//Find a certificate with a
// subject that matches the string
// in the next parameter.
CA_VALUE,
//L"Suzanna CA",
// in a certificate's subject.
pTmpCertContext))
// NULL for the first call to
{
pCertContext = &pTmpCertContext;
*pCertContext++;
i++;
continue;
bRet = TRUE;
break;
} //while
if(!CertVerifyRevocation(MY_ENCODING_TYPE,
CERT_CONTEXT_REVOCATION_TYPE,
i,
(PVOID*) pCertContext,
CERT_VERIFY_REV_CHAIN_FLAG,
NULL, //PCERT_REVOCATION_PARA pRevPara,
&pCertRevocationStatus))
::MessageBox(NULL, "Error", "", MB_OK);
----------------------------------------------------------------
Users Guide http://msdn.microsoft.com/workshop/essentials/mail.asp
contains important info. Save time, search the archives at
http://discuss.microsoft.com/archives/index.html .
To unsubscribe, mailto:CryptoAPI-signoff-request@DISCUSS.MICROSOFT.COM
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic