IPKIFCryptoRawOperations.h
Go to the documentation of this file.00001
00009 #ifndef __IPKIFCRYPTORAWOPERATIONS_H__
00010 #define __IPKIFCRYPTORAWOPERATIONS_H__
00011
00012 #include "PKIFdll.h"
00013 #include "PKIFCryptoConstants.h"
00014 #include "IPKIFCryptoAlgSupport.h"
00015
00016 class CPKIFKeyMaterial;
00017 class IPKIFRawCryptContext;
00018 class CPKIFCertificate;
00019
00027 class CAC_API CAC_NO_VTABLE IPKIFCryptoRawOperations : public IPKIFCryptoAlgSupport
00028 {
00029 public:
00030 IPKIFCryptoRawOperations();
00031 virtual void Sign(const CPKIFKeyMaterial& key, unsigned char* pHashData, int nHashDataLen, unsigned char* pSig, int* pnSigLen, PKIFCRYPTO::HASH_ALG hashAlg) = 0;
00032 virtual void Encrypt(const CPKIFKeyMaterial& key, unsigned char* pData, int nDataLen, unsigned char* pResult, int* pnResultLen, bool pad = true) = 0;
00033 virtual void Decrypt(const CPKIFKeyMaterial& key, unsigned char* pData, int nDataLen, unsigned char* pResult, int* pnResultLen, bool pad = true) = 0;
00034 virtual bool Verify(const CPKIFKeyMaterial& key, unsigned char* pHashData, int nHashDataLen, unsigned char* pSig, int nSigLen, PKIFCRYPTO::HASH_ALG hashAlg) = 0;
00035
00036 virtual IPKIFRawCryptContext* CryptInit(const CPKIFKeyMaterial& key, bool pad = true) = 0;
00037 virtual IPKIFRawCryptContext* CryptInit(const CPKIFKeyMaterial * key, bool pad = true);
00038 virtual void Decrypt(IPKIFRawCryptContext* cryptContext, unsigned char* pData, int nDataLen, unsigned char* pResult, int* pnResultLen, bool final) = 0;
00039 virtual void Encrypt(IPKIFRawCryptContext* cryptContext, unsigned char* pData, int nDataLen, unsigned char* pResult, int* pnResultLen, bool final) = 0;
00040
00041 virtual IPKIFRawCryptContext* HMACInit(const CPKIFKeyMaterial &key, PKIFCRYPTO::HASH_ALG ha) = 0;
00042 virtual void HMACUpdate(IPKIFRawCryptContext* ctx, unsigned char* pData, int nDataLen) = 0;
00043 virtual void HMACFinal(IPKIFRawCryptContext* ctx, unsigned char* pResult, int* pnResultLen) = 0;
00044
00045 virtual bool VerifyCertificate(const CPKIFCertificate& issCert, const CPKIFCertificate& subCert) = 0;
00046 private:
00047
00049 IPKIFCryptoRawOperations(const IPKIFCryptoRawOperations& copy);
00051 IPKIFCryptoRawOperations& operator=(const IPKIFCryptoRawOperations& rhs);
00052 };
00053 DECLARE_SMART_POINTERS(IPKIFCryptoRawOperations);
00054
00055 #endif //__IPKIFCRYPTORAWOPERATIONS_H__
00056