Portuguese eID Middleware SDK  Version: 3.12.0
eIDMW::PTEID_Certificate Class Reference

#include <eidlib.h>

Public Member Functions

virtual PTEIDSDK_API ~PTEID_Certificate ()
 
PTEIDSDK_API const char * getLabel ()
 
PTEIDSDK_API unsigned long getID ()
 
PTEIDSDK_API PTEID_CertifType getType ()
 
PTEIDSDK_API const PTEID_ByteArraygetCertData ()
 
PTEIDSDK_API void getFormattedData (PTEID_ByteArray &data)
 
PTEIDSDK_API const char * getSerialNumber ()
 
PTEIDSDK_API const char * getOwnerName ()
 
PTEIDSDK_API const char * getSubjectSerialNumber ()
 
PTEIDSDK_API const char * getIssuerName ()
 
PTEIDSDK_API const char * getValidityBegin ()
 
PTEIDSDK_API const char * getValidityEnd ()
 
PTEIDSDK_API unsigned long getKeyLength ()
 
PTEIDSDK_API PTEID_CertifStatus getStatus ()
 
PTEIDSDK_API PTEID_CertifStatus getStatus (bool useCache, bool validateChain)
 
PTEIDSDK_API bool isRoot ()
 
PTEIDSDK_API bool isTest ()
 
PTEIDSDK_API bool isFromPteidValidChain ()
 
PTEIDSDK_API bool isFromCard ()
 
PTEIDSDK_API bool verifyDateValidity ()
 
PTEIDSDK_API PTEID_CertificategetIssuer ()
 
PTEIDSDK_API unsigned long countChildren ()
 
PTEIDSDK_API PTEID_CertificategetChildren (unsigned long ulIndex)
 
- Public Member Functions inherited from eIDMW::PTEID_Object
virtual PTEIDSDK_API ~PTEID_Object ()=0
 
NOEXPORT_PTEIDSDK void Init (const SDK_Context *context, void *impl)
 
NOEXPORT_PTEIDSDK void Release ()
 

Friends

PTEID_CertificatePTEID_Certificates::getCert (unsigned long ulIndex)
 
PTEID_CertificatePTEID_Certificates::getCertFromCard (unsigned long ulIndex)
 
PTEID_CertificatePTEID_Certificates::getCert (PTEID_CertifType type)
 
PTEID_CertificatePTEID_Certificates::addCertificate (PTEID_ByteArray &cert)
 

Additional Inherited Members

- Protected Member Functions inherited from eIDMW::PTEID_Object
 PTEID_Object (const SDK_Context *context, void *impl)
 
void addObject (PTEID_Object *impl)
 
void backupObject (unsigned long idx)
 
PTEID_ObjectgetObject (unsigned long idx)
 
PTEID_ObjectgetObject (void *impl)
 
void delObject (unsigned long idx)
 
void delObject (void *impl)
 
void checkContextStillOk () const
 
 PTEID_Object (const PTEID_Object &obj)
 
PTEID_Objectoperator= (const PTEID_Object &obj)
 
- Protected Attributes inherited from eIDMW::PTEID_Object
bool m_delimpl
 
void * m_impl
 
unsigned long m_ulIndexExtAdd
 
std::map< unsigned long, PTEID_Object * > m_objects
 
SDK_Context * m_context
 

Detailed Description

Class that represents one certificate.

Constructor & Destructor Documentation

◆ ~PTEID_Certificate()

virtual PTEIDSDK_API eIDMW::PTEID_Certificate::~PTEID_Certificate ( )
virtual

Destructor

Member Function Documentation

◆ countChildren()

PTEIDSDK_API unsigned long eIDMW::PTEID_Certificate::countChildren ( )

Return the number of children for this certificate.

◆ getCertData()

PTEIDSDK_API const PTEID_ByteArray& eIDMW::PTEID_Certificate::getCertData ( )

Return the content of the certificate

◆ getChildren()

PTEIDSDK_API PTEID_Certificate& eIDMW::PTEID_Certificate::getChildren ( unsigned long  ulIndex)

Return the children certificate (certificate that has been issued by this one).

Parameters
ulIndexis the children index (the index for the first child is 0) Throw PTEID_ExParamRange exception if the index is out of range

◆ getFormattedData()

PTEIDSDK_API void eIDMW::PTEID_Certificate::getFormattedData ( PTEID_ByteArray data)

Return the content of the certificate without ending zero

◆ getID()

PTEIDSDK_API unsigned long eIDMW::PTEID_Certificate::getID ( )

Return the id of the certificate

◆ getIssuer()

PTEIDSDK_API PTEID_Certificate& eIDMW::PTEID_Certificate::getIssuer ( )

Return the issuer certificate.

if there is no issuer (root), PTEID_ExCertNoIssuer exception is thrown

◆ getIssuerName()

PTEIDSDK_API const char* eIDMW::PTEID_Certificate::getIssuerName ( )

Return the name of the issuer of the certificate

◆ getKeyLength()

PTEIDSDK_API unsigned long eIDMW::PTEID_Certificate::getKeyLength ( )

Return the length of public/private key on the certificate

◆ getLabel()

PTEIDSDK_API const char* eIDMW::PTEID_Certificate::getLabel ( )

Return the label of the certificate

◆ getOwnerName()

PTEIDSDK_API const char* eIDMW::PTEID_Certificate::getOwnerName ( )

Return the name of the owner of the certificate

◆ getSerialNumber()

PTEIDSDK_API const char* eIDMW::PTEID_Certificate::getSerialNumber ( )

Return the serial number of the certificate

◆ getStatus() [1/2]

PTEIDSDK_API PTEID_CertifStatus eIDMW::PTEID_Certificate::getStatus ( )

Return OCSP/CRL validation status

◆ getStatus() [2/2]

PTEIDSDK_API PTEID_CertifStatus eIDMW::PTEID_Certificate::getStatus ( bool  useCache,
bool  validateChain 
)

OCSP/CRL validation status

Parameters
useCacheboolean that specifies if cached certificates can be utilized for the validation (default true)
validateChainboolean that specifies if the entire certificate chain is to be validated or not (default true)

◆ getSubjectSerialNumber()

PTEIDSDK_API const char* eIDMW::PTEID_Certificate::getSubjectSerialNumber ( )

Return the serial number of the subject of the certificate

◆ getType()

PTEIDSDK_API PTEID_CertifType eIDMW::PTEID_Certificate::getType ( )

Return the type of the certificate

◆ getValidityBegin()

PTEIDSDK_API const char* eIDMW::PTEID_Certificate::getValidityBegin ( )

Return the validity begin date of the certificate

◆ getValidityEnd()

PTEIDSDK_API const char* eIDMW::PTEID_Certificate::getValidityEnd ( )

Return the validity end date of the certificate

◆ isFromCard()

PTEIDSDK_API bool eIDMW::PTEID_Certificate::isFromCard ( )

This certificate comes from the card.

◆ isFromPteidValidChain()

PTEIDSDK_API bool eIDMW::PTEID_Certificate::isFromPteidValidChain ( )

Return true if the certificate chain end by the one of pteid root.

◆ isRoot()

PTEIDSDK_API bool eIDMW::PTEID_Certificate::isRoot ( )

Return true if this is a root certificate.

◆ isTest()

PTEIDSDK_API bool eIDMW::PTEID_Certificate::isTest ( )

Return the test status.

Returns
true if test certificate
false if good one

◆ verifyDateValidity()

PTEIDSDK_API bool eIDMW::PTEID_Certificate::verifyDateValidity ( )

Return true if the current time is between the certificate's notBefore and notAfter

Friends And Related Function Documentation

◆ PTEID_Certificates::addCertificate

For internal use : This method must access protected constructor

◆ PTEID_Certificates::getCert [1/2]

PTEID_Certificate& PTEID_Certificates::getCert ( unsigned long  ulIndex)
friend

For internal use : This method must access protected constructor

◆ PTEID_Certificates::getCert [2/2]

PTEID_Certificate& PTEID_Certificates::getCert ( PTEID_CertifType  type)
friend

For internal use : This method must access protected constructor

◆ PTEID_Certificates::getCertFromCard

PTEID_Certificate& PTEID_Certificates::getCertFromCard ( unsigned long  ulIndex)
friend

For internal use : This method must access protected constructor