Certificate.h

Go to the documentation of this file.
00001 
00009 #ifndef __Certificate_H__
00010 #define __Certificate_H__
00011 
00012 #if _MSC_VER > 1000
00013 #pragma once
00014 #endif 
00015 
00016 #include "PKIFdll.h"
00017 #define CAC_API_FACTORY 
00018 
00019 #include "IPKIFHasExtensions.h"
00020 #include "IPKIFNameAndKey.h"
00021 
00022 struct CPKIFCertificateImpl;
00023 FD_SMART_PTR(CPKIFAlgorithmIdentifier);
00024 FD_SMART_PTR(CPKIFName);
00025 FD_SMART_PTR(CPKIFValidity);
00026 FD_SMART_PTR(CPKIFSubjectPublicKeyInfo);
00027 
00060 class CAC_API CPKIFCertificate : public IPKIFHasExtensions, public IPKIFNameAndKey
00061 {
00062 public:
00063     CPKIFCertificate(void);
00064     virtual ~CPKIFCertificate(void);
00065 
00066     void Decode(const unsigned char* cert, int certLen);
00067     CPKIFBufferPtr Encoded() const;
00068  
00069     // V1 fields
00070     int Version() const;
00071     const char* SerialNumber() const; 
00072     CPKIFAlgorithmIdentifierPtr TBSSignatureAlgorithm( ) const;
00073     CPKIFNamePtr Issuer( ) const;
00074     CPKIFValidityPtr Validity( ) const;
00075     CPKIFNamePtr Subject( ) const;
00076     CPKIFSubjectPublicKeyInfoPtr SubjectPublicKeyInfo( ) const;
00077 
00078     CPKIFAlgorithmIdentifierPtr SignatureAlgorithm( ) const;
00079     CPKIFBufferPtr Signature() const;
00080 
00081     bool operator==(const CPKIFCertificate& rhs) const;
00082     
00083     // added these 8/27/2004
00084     bool IsSelfIssued() const;
00085     bool IsSelfSigned() const;
00086 
00087     // V3 extensions
00088     void GetExtensionByOID(const CPKIFOID& oid, CPKIFX509ExtensionPtr& ref);
00089     void GetEncodedExtensions (CPKIFBufferPtr& buf);
00090     bool AreThereAnyUnprocessedCriticalExtensions(std::vector<CPKIFX509ExtensionPtr>& processedExts);
00091 
00092     CPKIFNamePtr GetSubjectName() const;
00093     CPKIFNamePtr GetIssuerName() const;
00094     CPKIFBufferPtr GetKey() const;
00095     CPKIFSubjectPublicKeyInfoPtr GetSubjectPublicKeyInfo() const;
00096 
00097 private:
00099     CPKIFCertificate(const CPKIFCertificate& ext);
00101     CPKIFCertificate& operator=(const CPKIFCertificate& rhs); //added 4/6/2004
00102     
00103     struct CPKIFCertificateImpl *m_impl;
00104 };
00105 DECLARE_SMART_POINTERS(CPKIFCertificate);
00106 typedef std::vector<CPKIFCertificatePtr, PKIFAlloc<CPKIFCertificatePtr> > CPKIFCertificateList;
00107 DECLARE_SMART_POINTERS(CPKIFCertificateList);
00108 
00109 //function that can be called by delay load applications to determine if a certificate is a CA cert
00110 bool CAC_API IsCaCertificate(CPKIFCertificatePtr& cert);
00111 
00112 #endif
00113 
00114 

Generated on Mon Nov 15 11:15:47 2010 for PublicKeyInfrastructureFramework(PKIF) by  doxygen 1.5.6