13 #include <QSharedPointer>
33 QByteArray
mData = QByteArray();
37 const QSharedPointer<CardConnectionWorker> mCardConnectionWorker;
38 QByteArray mEncryptionKey;
42 const QSharedPointer<const PaceInfo> mPaceInfo;
46 CardResult createTransmitResult(CardReturnCode pReturnCode,
47 const ResponseApdu& pResponseApdu,
48 const QByteArray& pResultData,
49 const char* pLogMessage)
const;
57 CardResult determineNonce(
const QByteArray& pPin);
65 virtual CardResult determineSharedSecret(
const QByteArray& pNonce) = 0;
72 virtual QByteArray getUncompressedTerminalPublicKey() = 0;
88 KeyAgreement(
const QSharedPointer<const PaceInfo>& pPaceInfo,
const QSharedPointer<CardConnectionWorker>& pCardConnectionWorker);
111 [[nodiscard]]
const QSharedPointer<const PaceInfo>&
getPaceInfo()
const;
120 static QSharedPointer<KeyAgreement>
create(
const QSharedPointer<const PaceInfo>& pPaceInfo,
121 QSharedPointer<CardConnectionWorker> pCardConnectionWorker);
158 [[nodiscard]]
const QByteArray&
getMacKey()
const;
164 [[nodiscard]]
const QByteArray&
getCarCurr()
const;
170 [[nodiscard]]
const QByteArray&
getCarPrev()
const;
Definition: GeneralAuthenticateResponse.h:130
Definition: KeyAgreement.h:28
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
KeyAgreement(const QSharedPointer< const PaceInfo > &pPaceInfo, const QSharedPointer< CardConnectionWorker > &pCardConnectionWorker)
Definition: KeyAgreement.cpp:72
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:18
Implementation of GeneralAuthenticate response APDUs.
Definition: CommandApdu.h:16
KeyAgreementStatus
Definition: KeyAgreement.h:19
Definition: KeyAgreement.h:31
QByteArray mData
Definition: KeyAgreement.h:33
CardReturnCode mReturnCode
Definition: KeyAgreement.h:32