Exemplo n.º 1
0
        private unsafe DateTime?GetRevocationTime(CERT_REVOCATION_INFO *pRevocationInfo)
        {
            if (pRevocationInfo->dwRevocationResult == CertTrustErrorStatus.CERT_TRUST_NO_ERROR ||
                pRevocationInfo->pCrlInfo == null ||
                pRevocationInfo->pCrlInfo->pCrlEntry == null)
            {
                return(null);
            }

            FILETIME revocationDate = pRevocationInfo->pCrlInfo->pCrlEntry->RevocationDate;

            return(revocationDate.ToDateTime().ToUniversalTime());
        }
        private unsafe DateTime?GetStatusUpdateTime(CERT_REVOCATION_INFO *pRevocationInfo)
        {
            CERT_REVOCATION_CRL_INFO *pCrlInfo = pRevocationInfo->pCrlInfo;

            if (pCrlInfo->pDeltaCRLContext != null)
            {
                FILETIME statusUpdate = pCrlInfo->pDeltaCRLContext->pCrlInfo->ThisUpdate;

                return(statusUpdate.ToDateTime().ToUniversalTime());
            }
            else if (pCrlInfo->pBaseCRLContext != null)
            {
                FILETIME statusUpdate = pCrlInfo->pBaseCRLContext->pCrlInfo->ThisUpdate;

                return(statusUpdate.ToDateTime().ToUniversalTime());
            }

            return(null);
        }