VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Common/Token.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/Common/Token.h')
-rw-r--r--src/Common/Token.h38
1 files changed, 21 insertions, 17 deletions
diff --git a/src/Common/Token.h b/src/Common/Token.h
index 28c6a489..c1dd8ac4 100644
--- a/src/Common/Token.h
+++ b/src/Common/Token.h
@@ -15,42 +15,46 @@
#define UNAVAILABLE_SLOT ~0UL
-namespace VeraCrypt {
-
- struct TokenKeyfilePath {
+namespace VeraCrypt
+{
+ struct TokenKeyfilePath
+ {
+ virtual ~TokenKeyfilePath() {};
TokenKeyfilePath(const wstring& path): Path(path) { }
operator wstring () const { return Path; }
- wstring Path; //Complete path
-
+ wstring Path; // Complete path
};
- struct TokenInfo {
- TokenInfo() {}
+
+ struct TokenInfo
+ {
+ TokenInfo(): SlotId(0), Label(L"") {}
virtual ~TokenInfo() {}
- virtual BOOL isEditable() const=0;
+ virtual BOOL isEditable() const = 0;
unsigned long int SlotId;
- wstring Label; //Card name
+ wstring Label; // Card name
};
- struct TokenKeyfile {
+ struct TokenKeyfile
+ {
+ virtual ~TokenKeyfile() {}
virtual operator TokenKeyfilePath () const = 0;
virtual void GetKeyfileData(vector <byte>& keyfileData) const = 0;
- string IdUtf8; // Was used in SecurityToken to compare with the file name from a PKCS11 card, remove from token ?
shared_ptr<TokenInfo> Token;
wstring Id;
};
- class Token {
+ class Token
+ {
public:
- static vector<shared_ptr<TokenKeyfile>> GetAvailableKeyfiles(bool EMVOption);
- static bool IsKeyfilePathValid(const wstring& tokenKeyfilePath, bool EMVOption);
- static list <shared_ptr<TokenInfo>> GetAvailableTokens(); // List available token to write
- static shared_ptr<TokenKeyfile> getTokenKeyfile(const TokenKeyfilePath path);
+ static vector<shared_ptr<TokenKeyfile>> GetAvailableKeyfiles(bool isEMVSupportEnabled);
+ static bool IsKeyfilePathValid(const wstring& tokenKeyfilePath, bool isEMVSupportEnabled);
+ static list <shared_ptr<TokenInfo>> GetAvailableTokens();
+ static shared_ptr<TokenKeyfile> getTokenKeyfile(const TokenKeyfilePath& path);
};
-
};