A simple Qt based browser with no bullshit that supports PKCS#11 tokens (such as the SuisseID).
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

132 lines
3.4 KiB

// ---------------------------------------------------------------------------
// Name: actITokenInitializer.h
// Product: cv act library
// Purpose: ITokenInitializer interface declares common token profile initialization functionality.
//
// Copyright: (c) 2009 cv cryptovision GmbH
// all rights reserved
// Licence: The conditions for the use of this software are regulated
// in the cv act library licence agreement.
//
// Autor: Markus Tesche
// Date: 04/20/2009
// ---------------------------------------------------------------------------
#ifndef ACT_ITokenInitializer_h
#define ACT_ITokenInitializer_h
#include "actBlob.h"
#include "actTokenBase.h"
#include "actIRefCounted.h"
namespace act
{
extern const byte PIN_PAD_CHAR;
struct TIData
{
private:
TIData(const TIData&) throw();
TIData& operator=(const TIData&) throw();
public:
TIData(const char* _profile_name = 0)
: profile_name(_profile_name)
, profile_type(PROFILE_UNKNOWN)
, retry_counter(3)
, pin_pad_byte(PIN_PAD_CHAR)
, enable_pin_padding(false)
, enable_pin_pce_so(false)
, enable_pin_pce_user(false)
, enable_minidriver(false)
, enable_minidriver_pnp(false)
, enable_biometric(false)
, enable_biometric_pins(false)
, load_only(false)
, load_package_MoC(false)
, load_package_2048(false)
, load_package_ecc(false)
{ }
Blob atr_historical_bytes;
Blob atr_historical_bytes_suffix;
Blob card_pin;
Blob so_pin;
Blob user_pin;
Blob serial_number;
Blob last_update_pin_utc;
Blob challenge_response_key;
Blob binary_data;
const char* profile_name;
ProfileType profile_type;
short retry_counter;
byte pin_pad_byte;
bool enable_pin_padding;
bool enable_pin_pce_so;
bool enable_pin_pce_user;
bool enable_minidriver;
bool enable_minidriver_pnp;
bool enable_biometric;
bool enable_biometric_pins;
bool load_only;
bool load_package_MoC;
bool load_package_2048;
bool load_package_ecc;
};
struct TITokenInfo
{
TITokenInfo(size_t pin_len_max, size_t pin_len_min, size_t _key_len_cr)
: serial_number_len(16)
, key_len_cr(_key_len_cr)
{
pin_len_max_admin = pin_len_max_so = pin_len_max_user = pin_len_max;
pin_len_min_admin = pin_len_min_so = pin_len_min_user = pin_len_min;
}
size_t serial_number_len;
size_t key_len_cr;
size_t pin_len_max_admin;
size_t pin_len_max_so;
size_t pin_len_max_user;
size_t pin_len_min_admin;
size_t pin_len_min_so;
size_t pin_len_min_user;
};
class ISCardOS;
class IProfileGenerator;
class ISCardCmdObserver;
//
// ITokenInitializer
class ITokenInitializer : public IRefCounted
{
public:
virtual ISCardOS* GetOS() const= 0;
virtual const TITokenInfo& GetTokenInfo() const = 0;
virtual const ProfileType* GetSupportedProfileList() const = 0;
virtual bool SupportsProfile(ProfileType profile_type) const = 0;
virtual void SetGenerator(IProfileGenerator* generator) = 0;
virtual void SetObserver(ISCardCmdObserver* observer) = 0;
virtual bool EraseProfile(const Blob& card_pin) = 0;
virtual bool ExistProfile(bool& is_pkcs15, bool& requires_adminpin) = 0;
virtual void CreateProfile(TIData& data, ProfileType profile_type) = 0;
virtual void FinalizeProfile(TIData& data) = 0;
virtual void PinChangeReminder(TIData& data, bool enable) = 0;
};
} // namespace act
#endif // ACT_ITokenInitializer_h