mirror of
https://github.com/veracrypt/VeraCrypt.git
synced 2025-11-11 19:08:26 -06:00
EMV keyfile support: Overall code improvements and bug fixes
This commit is contained in:
@@ -6,44 +6,36 @@
|
||||
|
||||
#define EMV_CARDS_LABEL L"EMV Certificates"
|
||||
|
||||
#include "Platform/PlatformBase.h"
|
||||
#if defined (TC_WINDOWS) && !defined (TC_PROTOTYPE)
|
||||
# include "Exception.h"
|
||||
#else
|
||||
# include "Platform/Exception.h"
|
||||
#endif
|
||||
|
||||
#include "Token.h"
|
||||
#include "IccDataExtractor.h"
|
||||
|
||||
namespace VeraCrypt {
|
||||
#include "EMVCard.h"
|
||||
|
||||
namespace VeraCrypt
|
||||
{
|
||||
struct EMVTokenInfo: TokenInfo
|
||||
{
|
||||
virtual ~EMVTokenInfo();
|
||||
virtual BOOL isEditable() const {return false;}
|
||||
virtual BOOL isEditable() const { return false; }
|
||||
};
|
||||
|
||||
struct EMVTokenKeyfile: TokenKeyfile
|
||||
{
|
||||
EMVTokenKeyfile(){Id = EMV_CARDS_LABEL; Token = shared_ptr<EMVTokenInfo>(new EMVTokenInfo());};
|
||||
EMVTokenKeyfile();
|
||||
EMVTokenKeyfile(const TokenKeyfilePath& path);
|
||||
virtual ~EMVTokenKeyfile() {};
|
||||
|
||||
virtual operator TokenKeyfilePath () const;
|
||||
virtual void GetKeyfileData(vector <byte>& keyfileData) const;
|
||||
|
||||
};
|
||||
|
||||
class EMVToken {
|
||||
private:
|
||||
static IccDataExtractor extractor;
|
||||
class EMVToken
|
||||
{
|
||||
public:
|
||||
static bool IsKeyfilePathValid(const wstring& emvTokenKeyfilePath);
|
||||
static vector<EMVTokenKeyfile> GetAvailableKeyfiles(unsigned long int* slotIdFilter = nullptr, const wstring keyfileIdFilter = wstring());
|
||||
static vector<EMVTokenKeyfile> GetAvailableKeyfiles(unsigned long int* slotIdFilter = nullptr, const wstring& keyfileIdFilter = wstring());
|
||||
static EMVTokenInfo GetTokenInfo(unsigned long int slotId);
|
||||
|
||||
friend void EMVTokenKeyfile::GetKeyfileData(vector <byte>& keyfileData) const;
|
||||
|
||||
static map <unsigned long int, shared_ptr<EMVCard>> EMVCards;
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user