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.

47 lines
825 B

14 years ago
#ifndef __CARDKEY_H__
#define __CARDKEY_H__
#include <actBlob.h>
//#include <openssl/crypto.h>
//#include <openssl/objects.h>
#include <openssl/engine.h>
#include <memory>
namespace act
{
class ITokenKey;
}
/*
* Retains a single RSA key pair and (maybe) the provided PIN which is used to authenticate for usage of
* this key
*/
class SecOpGuard;
class CardKey
{
public:
CardKey(act::ITokenKey* token_key);
~CardKey();
inline act::ITokenKey* getKey() const { return m_token_key.get(); }
// NOTE: Contents of source string will be overwritten for security reasons
void setPin(char *pin);
void setPin(const act::Blob& pin);
void setPin(UI_METHOD *ui_method, void *callback_data);
bool Authenticate(SecOpGuard& where);
private:
std::auto_ptr<act::ITokenKey> m_token_key;
act::Blob m_pin;
};
#endif