PKIFCMSUtils.h
Go to the documentation of this file.00001
00010 #ifndef __PKIFCMSUTILS_H__
00011 #define __PKIFCMSUTILS_H__
00012
00013 #include "PKIFCMSDLL.h"
00014 #include "PKIFEnums.h"
00015 #include "PKIFCryptoConstants.h"
00016 #include <vector>
00017
00018 FD_SMART_PTR(CPKIFCertificateNodeEntry);
00019 FD_SMART_PTR(CPKIFAlgorithmIdentifier);
00020 typedef std::vector<CPKIFAlgorithmIdentifierPtr, PKIFAlloc<CPKIFAlgorithmIdentifierPtr> > CCACDigestAlgorithmIdentifiers;
00021 DECLARE_SMART_POINTERS(CCACDigestAlgorithmIdentifiers);
00022 FD_LIST_PTR(CPKIFSignerInfo);
00023 FD_SMART_PTR(CPKIFSignedData);
00024 FD_SMART_PTR(CPKIFPathSettings);
00025 FD_SMART_PTR(CPKIFBuffer);
00026 FD_LIST_PTR(CPKIFCertificate);
00027 FD_SMART_PTR(CPKIFCertificatePath);
00028
00029 FD_MC_PTR();
00030 class CPKIFPathValidationResults;
00031
00032
00033
00047 enum CMSVerificationStatus
00048 {
00049 REV_STATUS_INVALID =-3,
00050 CERT_PATH_INVALID =-2,
00051 CMS_SIGNATURE_INVALID =-1,
00052 NOT_VERIFIED =0,
00053 CMS_SIGNATURE_VERIFIED =1,
00054 CERT_PATH_VERIFIED =2,
00055 REV_STATUS_VERIFIED =3,
00056 };
00057
00058
00061 enum CMSPathValidationStatus
00062 {
00063 PVS_NOT_VALIDATED = 0,
00064 PVS_CERT_PATH_VERIFIED = 1,
00065 PVS_REV_STATUS_VERIFIED = 2,
00066 };
00067
00068
00069 extern unsigned char nullParams[];
00070 void PKIFCMS_API keyUsageChecker_Signature(const CPKIFCertificateNodeEntryPtr& certNode, CPKIFPathValidationResults& results, CertificateType type);
00071 void PKIFCMS_API keyUsageChecker_Encryption(const CPKIFCertificateNodeEntryPtr& certNode, CPKIFPathValidationResults& results, CertificateType type);
00072 void PKIFCMS_API keyUsageChecker_KeyAgreement(const CPKIFCertificateNodeEntryPtr& certNode, CPKIFPathValidationResults& results, CertificateType type);
00073 CPKIFBufferPtr PKIFCMS_API Countersign(CPKIFSignerInfoPtr& siToCounterSign, CPKIFSignerInfoPtr& countersignerSI, IPKIFMediatorPtr& mediator);
00074 void PKIFCMS_API VerifyCounterSignatures(CPKIFSignedDataPtr& sd, CPKIFSignerInfoPtr& si, IPKIFMediatorPtr& mediator, CPKIFPathSettingsPtr& settings, CPKIFSignerInfoList& sis, std::vector<CMSVerificationStatus>& status, CPKIFCertificateList& certVector, std::vector<CPKIFCertificatePathPtr>& pathVector);
00075
00076 #define RAISE_MESSAGE_EXCEPTION(__errorMsg__, __component__, __errorCode__, __object__)\
00077 {\
00078 LOG_STRING_ERROR(__errorMsg__, __component__, __errorCode__, __object__);\
00079 throw CPKIFMessageException(__component__, __errorCode__, __errorMsg__);\
00080 }
00081
00082 #define CMS_ATTR_CAST(item) *((boost::shared_ptr<CPKIFAttribute>*)&(item))
00083
00084 #endif