Certificat.cpp
资源名称:pkcs11.rar [点击查看]
上传用户:filter2008
上传日期:2013-02-01
资源大小:101k
文件大小:2k
源码类别:
CA认证
开发平台:
C/C++
- // Certificat.cpp: implementation of the CCertificat class.
- //
- //////////////////////////////////////////////////////////////////////
- #include "stdafx.h"
- #include "CertInstall.h"
- #include "Certificat.h"
- #ifdef _DEBUG
- #undef THIS_FILE
- static char THIS_FILE[]=__FILE__;
- #define new DEBUG_NEW
- #endif
- //////////////////////////////////////////////////////////////////////
- // Construction/Destruction
- //////////////////////////////////////////////////////////////////////
- CCertificat::CCertificat()
- {
- m_strContainerName = NULL;
- m_ucValueCert = NULL;
- m_ulValueCertLen = 0;
- }
- CCertificat::~CCertificat()
- {
- /*if (m_strContainerName){ free((char*)m_strContainerName); m_strContainerName = NULL;}
- if (m_ucValueCert) { free((unsigned char*)m_ucValueCert); m_ucValueCert = NULL;}
- if (m_strLabel) { free((char*)m_strLabel); m_strLabel = NULL;}
- m_ulValueCertLen = 0;*/
- }
- void CCertificat::setContName(char * strContainerName)
- {
- m_strContainerName = (char*)malloc (sizeof(char)*strlen(strContainerName)+1);
- strcpy(m_strContainerName, strContainerName);
- }
- void CCertificat::setValueCert(unsigned char * ucValueCert, int ulValueCertLen)
- {
- m_ulValueCertLen = ulValueCertLen;
- m_ucValueCert = (unsigned char*)malloc(sizeof(unsigned char*)*m_ulValueCertLen);
- memcpy(m_ucValueCert, ucValueCert, m_ulValueCertLen);
- }
- void CCertificat::setLabel(char * strLabel)
- {
- m_strLabel = (char*)malloc (sizeof(char)*strlen(strLabel)+1);
- strcpy(m_strLabel, strLabel);
- }
- char * CCertificat::getContName()
- {
- return m_strContainerName;
- }
- unsigned char * CCertificat::getValueCert()
- {
- return m_ucValueCert;
- }
- unsigned long CCertificat::getValueCertLen()
- {
- return m_ulValueCertLen;
- }
- char * CCertificat::getLabel()
- {
- return m_strLabel;
- }