15#include <QSharedPointer>
35 QByteArray
mData = QByteArray();
39 const QSharedPointer<CardConnectionWorker> mCardConnectionWorker;
40 QByteArray mEncryptionKey;
44 const QSharedPointer<const PaceInfo> mPaceInfo;
48 CardResult createTransmitResult(CardReturnCode pReturnCode,
49 const ResponseApdu& pResponseApdu,
50 const QByteArray& pResultData,
51 const char* pLogMessage)
const;
59 CardResult determineNonce(
const QByteArray& pPin);
67 virtual CardResult determineSharedSecret(
const QByteArray& pNonce) = 0;
74 virtual QByteArray getUncompressedTerminalPublicKey() = 0;
90 KeyAgreement(
const QSharedPointer<const PaceInfo>& pPaceInfo,
const QSharedPointer<CardConnectionWorker>& pCardConnectionWorker);
113 [[nodiscard]]
const QSharedPointer<const PaceInfo>&
getPaceInfo()
const;
122 static QSharedPointer<KeyAgreement>
create(
const QSharedPointer<const PaceInfo>& pPaceInfo,
123 QSharedPointer<CardConnectionWorker> pCardConnectionWorker);
160 [[nodiscard]]
const QByteArray&
getMacKey()
const;
166 [[nodiscard]]
const QByteArray&
getCarCurr()
const;
172 [[nodiscard]]
const QByteArray&
getCarPrev()
const;
Definition: GeneralAuthenticateResponse.h:132
Definition: KeyAgreement.h:30
const QByteArray & getEncryptionKey() const
Subsequent to the key agreement an encryption key is determined.
Definition: KeyAgreement.cpp:242
CardResult transmitGAMappingData(const QByteArray &pMappingData) const
Transmit the General Authenticate (Mapping Data) command to the card.
Definition: KeyAgreement.cpp:207
const QByteArray & getCarPrev() const
Subsequent to the key agreement a certificate authority reference (CAR) may be determined.
Definition: KeyAgreement.cpp:254
GAMutualAuthenticationResponse transmitGAMutualAuthentication(const QByteArray &pMutualAuthenticationData)
Transmit the General Authenticate (Mutual Authentication) command to the card.
Definition: KeyAgreement.cpp:221
KeyAgreementStatus perform(const QByteArray &pPin)
Perform the key agreement.
Definition: KeyAgreement.cpp:87
virtual QByteArray getUncompressedCardPublicKey()=0
Returns the uncompressed card's ephemeral public key calculated during key agreement.
const QByteArray & getCarCurr() const
Subsequent to the key agreement a certificate authority reference (CAR) may be determined.
Definition: KeyAgreement.cpp:248
const QByteArray & getMacKey() const
Subsequent to the key agreement a MAC key is determined.
Definition: KeyAgreement.cpp:260
const QSharedPointer< const PaceInfo > & getPaceInfo() const
Definition: KeyAgreement.cpp:236
virtual QByteArray getCompressedCardPublicKey()=0
Returns the compressed card's ephemeral public key calculated during key agreement.
CardResult transmitGAEphemeralPublicKey(const QByteArray &pEphemeralPublicKey)
Transmit the General Authenticate (Ephemeral Public Key) command to the card.
Definition: KeyAgreement.cpp:194
static QSharedPointer< KeyAgreement > create(const QSharedPointer< const PaceInfo > &pPaceInfo, QSharedPointer< CardConnectionWorker > pCardConnectionWorker)
Factory method to create an instance of KeyAgreement.
Definition: KeyAgreement.cpp:57
Definition: KeyDerivationFunction.h:20
Implementation of GeneralAuthenticate response APDUs.
Definition: CommandApdu.h:16
KeyAgreementStatus
Definition: KeyAgreement.h:21
SUCCESS
Definition: ResponseApdu.h:79
Definition: KeyAgreement.h:33
QByteArray mData
Definition: KeyAgreement.h:35
CardReturnCode mReturnCode
Definition: KeyAgreement.h:34