mirror of
https://github.com/QuasarApp/qca.git
synced 2025-04-28 12:34:31 +00:00
Add isAvailable()
svn path=/trunk/kdesupport/qca/; revision=677871
This commit is contained in:
parent
ff56bcb291
commit
d83bb6e0e7
@ -986,6 +986,32 @@ public:
|
||||
return _pubkey;
|
||||
}
|
||||
|
||||
bool
|
||||
_isTokenAvailable() const {
|
||||
bool ret;
|
||||
|
||||
QCA_logTextMessage (
|
||||
"pkcs11RSAContext::_ensureTokenAvailable - entry",
|
||||
Logger::Debug
|
||||
);
|
||||
|
||||
ret = pkcs11h_token_ensureAccess (
|
||||
_pkcs11h_certificate_id->token_id,
|
||||
NULL,
|
||||
0
|
||||
) == CKR_OK;
|
||||
|
||||
QCA_logTextMessage (
|
||||
QString ().sprintf (
|
||||
"pkcs11RSAContext::_ensureTokenAvailable - return ret=%d",
|
||||
ret ? 1 : 0
|
||||
),
|
||||
Logger::Debug
|
||||
);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
bool
|
||||
_ensureTokenAccess () {
|
||||
bool ret;
|
||||
@ -998,7 +1024,7 @@ public:
|
||||
ret = pkcs11h_token_ensureAccess (
|
||||
_pkcs11h_certificate_id->token_id,
|
||||
NULL,
|
||||
0
|
||||
PKCS11H_PROMPT_MASK_ALLOW_ALL
|
||||
) == CKR_OK;
|
||||
|
||||
QCA_logTextMessage (
|
||||
@ -1331,6 +1357,12 @@ public:
|
||||
return _storeName;
|
||||
}
|
||||
|
||||
virtual
|
||||
bool
|
||||
isAvailable() const {
|
||||
return static_cast<pkcs11RSAContext *>(static_cast<PKeyContext *>(_key.privateKey ().context ())->key ())->_isTokenAvailable ();
|
||||
}
|
||||
|
||||
virtual
|
||||
bool
|
||||
ensureAccess () {
|
||||
|
Loading…
x
Reference in New Issue
Block a user