12#include <QSharedPointer>
14#include <openssl/bn.h>
15#include <openssl/ec.h>
16#include <openssl/ecdsa.h>
17#include <openssl/evp.h>
27 static QByteArray
point2oct(
const QSharedPointer<const EC_GROUP>& pCurve,
const EC_POINT* pPoint,
bool pCompressed =
false);
29 static QSharedPointer<EC_POINT>
oct2point(
const QSharedPointer<const EC_GROUP>& pCurve,
const QByteArray& pCompressedData);
31 static QSharedPointer<EC_GROUP>
create(EC_GROUP* pEcGroup);
33 static QSharedPointer<EC_KEY>
create(EC_KEY* pEcKey);
35 static QSharedPointer<EC_POINT>
create(EC_POINT* pEcPoint);
37 static QSharedPointer<BIGNUM>
create(BIGNUM* pBigNum);
39 static QSharedPointer<EVP_PKEY>
create(EVP_PKEY* pEcGroup);
41 static QSharedPointer<EVP_PKEY_CTX>
create(EVP_PKEY_CTX* pEcGroup);
43 static QSharedPointer<EC_KEY>
generateKey(
const QSharedPointer<const EC_GROUP>& pCurve);
45 static QSharedPointer<EC_GROUP>
createCurve(
int pNid);
51 static auto deleter = [](EC_GROUP* ecCurve)
53 EC_GROUP_free(ecCurve);
56 return QSharedPointer<EC_GROUP>(pEcGroup, deleter);
62 static auto deleter = [](EC_KEY* ecKey)
67 return QSharedPointer<EC_KEY>(pEcKey, deleter);
73 static auto deleter = [](EC_POINT* ecPoint)
75 EC_POINT_clear_free(ecPoint);
78 return QSharedPointer<EC_POINT>(pEcPoint, deleter);
84 static auto deleter = [](BIGNUM* bigNum)
86 BN_clear_free(bigNum);
89 return QSharedPointer<BIGNUM>(pBigNum, deleter);
95 static auto deleter = [](EVP_PKEY* key)
100 return QSharedPointer<EVP_PKEY>(pKey, deleter);
106 static auto deleter = [](EVP_PKEY_CTX* ctx)
108 EVP_PKEY_CTX_free(ctx);
111 return QSharedPointer<EVP_PKEY_CTX>(pCtx, deleter);
static QByteArray point2oct(const QSharedPointer< const EC_GROUP > &pCurve, const EC_POINT *pPoint, bool pCompressed=false)
Definition: EcUtil.cpp:31
static QSharedPointer< EC_GROUP > createCurve(int pNid)
Definition: EcUtil.cpp:19
static QSharedPointer< EC_KEY > generateKey(const QSharedPointer< const EC_GROUP > &pCurve)
Definition: EcUtil.cpp:91
static QSharedPointer< EC_POINT > oct2point(const QSharedPointer< const EC_GROUP > &pCurve, const QByteArray &pCompressedData)
Definition: EcUtil.cpp:67
static QSharedPointer< EC_GROUP > create(EC_GROUP *pEcGroup)
Definition: EcUtil.h:49
Implementation of GeneralAuthenticate response APDUs.
Definition: CommandApdu.h:16