IPKIFCryptoKeyIDOperations.h
Go to the documentation of this file.00001
00009 #ifndef __IPKIFCRYPTOKEYIDOPERATIONS_H__
00010 #define __IPKIFCRYPTOKEYIDOPERATIONS_H__
00011
00012 #if _MSC_VER > 1000
00013 #pragma once
00014 #endif // _MSC_VER > 1000
00015
00016 #include <vector>
00017 #include <bitset>
00018 #include "PKIFCredential.h"
00019 #include "PKIFMediators.h"
00020 #include "PKIFCryptoConstants.h"
00021
00022
00023 class IPKIFCryptContext;
00024
00025
00026 FD_SMART_PTR(CPKIFKeyUsage);
00027 FD_LIST_PTR(CPKIFCredential);
00028
00029
00037 class CAC_API CAC_NO_VTABLE IPKIFCryptoKeyIDOperations
00038 {
00039 public:
00040 IPKIFCryptoKeyIDOperations();
00041 virtual void GetKeyList(CPKIFCredentialList& v, std::bitset<9>* ku=NULL) = 0;
00042 virtual void GetKeyList(CPKIFCredentialList& v, CPKIFKeyUsagePtr& ku) = 0;
00043 virtual void Sign(const CPKIFCredential& key, unsigned char* pHashData, int nHashDataLen, unsigned char* pSig, int* nSigLen, PKIFCRYPTO::HASH_ALG hashAlg) = 0;
00044 virtual void Decrypt(const CPKIFCredential& key, unsigned char* pData, int nDataLen, unsigned char* pResult, int* pnResultLen) = 0;
00045 virtual void Encrypt(const CPKIFCredential& key, unsigned char* pData, int nDataLen, unsigned char* pResult, int* pnResultLen) = 0;
00046 virtual bool Verify(const CPKIFCredential& key, unsigned char* pHashData, int nHashDataLen, unsigned char* pSig, int nSigLen, PKIFCRYPTO::HASH_ALG hashAlg) = 0;
00047
00048 virtual IPKIFCryptContext* CryptInit(CPKIFCredentialPtr& key, bool pad = true) = 0;
00049 virtual void Decrypt(IPKIFCryptContext* cryptContext, unsigned char* pData, int nDataLen, unsigned char* pResult, int* pnResultLen, bool final) = 0;
00050 virtual void Encrypt(IPKIFCryptContext* cryptContext, unsigned char* pData, int nDataLen, unsigned char* pResult, int* pnResultLen, bool final) = 0;
00051 private:
00052
00054 IPKIFCryptoKeyIDOperations(const IPKIFCryptoKeyIDOperations& copy);
00056 IPKIFCryptoKeyIDOperations& operator=(const IPKIFCryptoKeyIDOperations& rhs);
00057 };
00058 DECLARE_SMART_POINTERS(IPKIFCryptoKeyIDOperations);
00059
00060 #endif //__IPKIFCRYPTOKEYIDOPERATIONS_H__
00061