8#include <QSharedPointer>
10#include <openssl/bn.h>
11#include <openssl/ec.h>
12#include <openssl/ecdsa.h>
13#include <openssl/evp.h>
25 static QByteArray
point2oct(
const QSharedPointer<const EC_GROUP>& pCurve,
const EC_POINT* pPoint,
bool pCompressed =
false);
26 static QSharedPointer<EC_POINT>
oct2point(
const QSharedPointer<const EC_GROUP>& pCurve,
const QByteArray& pCompressedData);
28 static QSharedPointer<EC_GROUP>
create(EC_GROUP* pEcGroup);
29 static QSharedPointer<EC_KEY>
create(EC_KEY* pEcKey);
30 static QSharedPointer<EC_POINT>
create(EC_POINT* pEcPoint);
31 static QSharedPointer<BIGNUM>
create(BIGNUM* pBigNum);
32 static QSharedPointer<EVP_PKEY>
create(EVP_PKEY* pEcGroup);
33 static QSharedPointer<EVP_PKEY_CTX>
create(EVP_PKEY_CTX* pEcGroup);
35 static QByteArray
getEncodedPublicKey(
const QSharedPointer<EC_KEY>& pKey,
bool pCompressed =
false);
36 static QSharedPointer<BIGNUM>
getPrivateKey(
const QSharedPointer<const EC_KEY>& pKey);
37 static QSharedPointer<EC_KEY>
generateKey(
const QSharedPointer<const EC_GROUP>& pCurve);
39 static QSharedPointer<EC_GROUP>
createCurve(
int pNid);
45 static auto deleter = [](EC_GROUP* ecCurve)
47 EC_GROUP_free(ecCurve);
50 return QSharedPointer<EC_GROUP>(pEcGroup, deleter);
56 static auto deleter = [](EC_KEY* ecKey)
61 return QSharedPointer<EC_KEY>(pEcKey, deleter);
67 static auto deleter = [](EC_POINT* ecPoint)
69 EC_POINT_clear_free(ecPoint);
72 return QSharedPointer<EC_POINT>(pEcPoint, deleter);
78 static auto deleter = [](BIGNUM* bigNum)
80 BN_clear_free(bigNum);
83 return QSharedPointer<BIGNUM>(pBigNum, deleter);
89 static auto deleter = [](EVP_PKEY* key)
94 return QSharedPointer<EVP_PKEY>(pKey, deleter);
100 static auto deleter = [](EVP_PKEY_CTX* ctx)
102 EVP_PKEY_CTX_free(ctx);
105 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:46
static QByteArray compressPoint(const QByteArray &pPoint)
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:131
static QSharedPointer< EC_POINT > oct2point(const QSharedPointer< const EC_GROUP > &pCurve, const QByteArray &pCompressedData)
Definition EcUtil.cpp:82
static QByteArray getEncodedPublicKey(const QSharedPointer< EC_KEY > &pKey, bool pCompressed=false)
Definition EcUtil.cpp:106
static QSharedPointer< EC_GROUP > create(EC_GROUP *pEcGroup)
Definition EcUtil.h:43
static QSharedPointer< BIGNUM > getPrivateKey(const QSharedPointer< const EC_KEY > &pKey)
Definition EcUtil.cpp:119
Defines the AccessRight and AccessRole enum.
Definition CommandApdu.h:17