Commit 3947c793 authored by Ingo Klöcker's avatar Ingo Klöcker
Browse files

Add authenticationKeyRef to Card

For now only set to hard-coded value for OpenPGP cards because gpg
does not publish this.

GnuPG-bug-id: 4876
parent 4e96ade3
......@@ -165,6 +165,21 @@ bool Card::hasEncryptionKey() const
return !keyInfo(mEncryptionKeyRef).grip.empty();
}
void Card::setAuthenticationKeyRef(const std::string &keyRef)
{
mAuthenticationKeyRef = keyRef;
}
std::string Card::authenticationKeyRef() const
{
return mAuthenticationKeyRef;
}
bool Card::hasAuthenticationKey() const
{
return !keyInfo(mAuthenticationKeyRef).grip.empty();
}
std::vector<Card::PinState> Card::pinStates() const
{
return mPinStates;
......@@ -208,6 +223,7 @@ bool Card::operator == (const Card &other) const
&& mCardHolder == other.mCardHolder
&& mSigningKeyRef == other.mSigningKeyRef
&& mEncryptionKeyRef == other.mEncryptionKeyRef
&& mAuthenticationKeyRef == other.mAuthenticationKeyRef
&& mPinStates == other.mPinStates
&& mErrMsg == other.mErrMsg
&& mKeyInfos == other.mKeyInfos
......
......@@ -89,6 +89,10 @@ public:
std::string encryptionKeyRef() const;
bool hasEncryptionKey() const;
void setAuthenticationKeyRef(const std::string &keyRef);
std::string authenticationKeyRef() const;
bool hasAuthenticationKey() const;
std::vector<PinState> pinStates() const;
void setPinStates(const std::vector<PinState> &pinStates);
......@@ -133,6 +137,7 @@ private:
QString mCardHolder;
std::string mSigningKeyRef;
std::string mEncryptionKeyRef;
std::string mAuthenticationKeyRef;
std::vector<PinState> mPinStates;
QString mErrMsg;
std::vector<KeyPairInfo> mKeyInfos;
......
......@@ -627,6 +627,7 @@ static std::shared_ptr<Card> get_card_status(const std::string &serialNumber, co
return ci;
} else if (appName == OpenPGPCard::AppName) {
qCDebug(KLEOPATRA_LOG) << "get_card_status: found OpenPGP card" << ci->serialNumber().c_str() << "end";
ci->setAuthenticationKeyRef(OpenPGPCard::pgpAuthKeyRef());
handle_openpgp_card(ci, gpg_agent);
return ci;
} else if (appName == PIVCard::AppName) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment