Lines Matching refs:pkey
176 EVP_PKEY_Ptr pkey(EVP_PKEY_new()); in generateP256Key() local
179 if (ec_key.get() == nullptr || pkey.get() == nullptr) { in generateP256Key()
190 if (EVP_PKEY_set1_EC_KEY(pkey.get(), ec_key.get()) != 1) { in generateP256Key()
195 return pkey; in generateP256Key()
198 optional<vector<uint8_t>> derEncodeKeyPair(const EVP_PKEY& pkey) { in derEncodeKeyPair() argument
199 int size = i2d_PrivateKey(&pkey, nullptr); in derEncodeKeyPair()
207 i2d_PrivateKey(&pkey, &p); in derEncodeKeyPair()
380 optional<vector<vector<uint8_t>>> createAttestation(EVP_PKEY* pkey, in createAttestation() argument
412 return signAttestationCertificate(context, pkey, applicationId, challenge, in createAttestation()
661 auto pkey = EVP_PKEY_Ptr(EVP_PKEY_new()); in certificateSignedByPublicKey() local
662 if (ecKey.get() == nullptr || pkey.get() == nullptr) { in certificateSignedByPublicKey()
674 if (EVP_PKEY_set1_EC_KEY(pkey.get(), ecKey.get()) != 1) { in certificateSignedByPublicKey()
679 if (X509_verify(x509.get(), pkey.get()) != 1) { in certificateSignedByPublicKey()
735 auto pkey = EVP_PKEY_Ptr(EVP_PKEY_new()); in checkEcDsaSignature() local
736 if (ecKey.get() == nullptr || pkey.get() == nullptr) { in checkEcDsaSignature()
748 if (EVP_PKEY_set1_EC_KEY(pkey.get(), ecKey.get()) != 1) { in checkEcDsaSignature()
832 EVP_PKEY_Ptr pkey = generateP256Key(); in createEcKeyPairAndAttestation() local
835 createAttestation(pkey.get(), challenge, applicationId, isTestCredential); in createEcKeyPairAndAttestation()
841 optional<vector<uint8_t>> keyPair = derEncodeKeyPair(*pkey); in createEcKeyPairAndAttestation()
860 EVP_PKEY_Ptr pkey = generateP256Key(); in createEcKeyPairWithAttestationKey() local
878 context, pkey.get(), applicationId, challenge, attestationKeyBlob, *derIssuerSubject, in createEcKeyPairWithAttestationKey()
893 optional<vector<uint8_t>> keyPair = derEncodeKeyPair(*pkey); in createEcKeyPairWithAttestationKey()
912 auto pkey = EVP_PKEY_Ptr(EVP_PKEY_new()); in createAttestationForEcPublicKey() local
913 if (ecKey.get() == nullptr || pkey.get() == nullptr) { in createAttestationForEcPublicKey()
925 if (EVP_PKEY_set1_EC_KEY(pkey.get(), ecKey.get()) != 1) { in createAttestationForEcPublicKey()
931 createAttestation(pkey.get(), applicationId, challenge, false /* isTestCredential */); in createAttestationForEcPublicKey()
942 auto pkey = EVP_PKEY_Ptr(EVP_PKEY_new()); in createEcKeyPair() local
943 if (ec_key.get() == nullptr || pkey.get() == nullptr) { in createEcKeyPair()
960 if (EVP_PKEY_set1_EC_KEY(pkey.get(), ec_key.get()) != 1) { in createEcKeyPair()
965 int size = i2d_PrivateKey(pkey.get(), nullptr); in createEcKeyPair()
973 i2d_PrivateKey(pkey.get(), &p); in createEcKeyPair()
979 auto pkey = EVP_PKEY_Ptr(d2i_PrivateKey(EVP_PKEY_EC, nullptr, &p, keyPair.size())); in ecKeyPairGetPublicKey() local
980 if (pkey.get() == nullptr) { in ecKeyPairGetPublicKey()
985 auto ecKey = EC_KEY_Ptr(EVP_PKEY_get1_EC_KEY(pkey.get())); in ecKeyPairGetPublicKey()
1009 auto pkey = EVP_PKEY_Ptr(d2i_PrivateKey(EVP_PKEY_EC, nullptr, &p, keyPair.size())); in ecKeyPairGetPrivateKey() local
1010 if (pkey.get() == nullptr) { in ecKeyPairGetPrivateKey()
1015 auto ecKey = EC_KEY_Ptr(EVP_PKEY_get1_EC_KEY(pkey.get())); in ecKeyPairGetPrivateKey()
1056 auto pkey = EVP_PKEY_Ptr(EVP_PKEY_new()); in ecPrivateKeyToKeyPair() local
1057 if (pkey.get() == nullptr) { in ecPrivateKeyToKeyPair()
1062 if (EVP_PKEY_set1_EC_KEY(pkey.get(), ecKey.get()) != 1) { in ecPrivateKeyToKeyPair()
1067 int size = i2d_PrivateKey(pkey.get(), nullptr); in ecPrivateKeyToKeyPair()
1075 i2d_PrivateKey(pkey.get(), &p); in ecPrivateKeyToKeyPair()
1084 auto pkey = EVP_PKEY_Ptr(d2i_PrivateKey(EVP_PKEY_EC, nullptr, &p, keyPair.size())); in ecKeyPairGetPkcs12() local
1085 if (pkey.get() == nullptr) { in ecKeyPairGetPkcs12()
1101 if (X509_set_pubkey(x509.get(), pkey.get()) != 1) { in ecKeyPairGetPkcs12()
1150 if (X509_sign(x509.get(), pkey.get(), EVP_sha256()) == 0) { in ecKeyPairGetPkcs12()
1164 auto pkcs12 = PKCS12_Ptr(PKCS12_create(nullptr, name.c_str(), pkey.get(), x509.get(), in ecKeyPairGetPkcs12()
1206 auto pkey = EVP_PKEY_Ptr(EVP_PKEY_new()); in ecPublicKeyGenerateCertificate() local
1207 if (ecKey.get() == nullptr || pkey.get() == nullptr) { in ecPublicKeyGenerateCertificate()
1219 if (EVP_PKEY_set1_EC_KEY(pkey.get(), ecKey.get()) != 1) { in ecPublicKeyGenerateCertificate()
1240 return ecPublicKeyGenerateCertificate(pkey.get(), privPkey.get(), serialDecimal, issuer, in ecPublicKeyGenerateCertificate()
1363 auto pkey = EVP_PKEY_Ptr(EVP_PKEY_new()); in ecdh() local
1364 if (ecKey.get() == nullptr || pkey.get() == nullptr) { in ecdh()
1376 if (EVP_PKEY_set1_EC_KEY(pkey.get(), ecKey.get()) != 1) { in ecdh()
1408 if (EVP_PKEY_derive_set_peer(ctx.get(), pkey.get()) != 1) { in ecdh()
1475 auto pkey = EVP_PKEY_Ptr(X509_get_pubkey(certs[0].get())); in certificateChainGetTopMostKey() local
1476 if (pkey.get() == nullptr) { in certificateChainGetTopMostKey()
1481 auto ecKey = EC_KEY_Ptr(EVP_PKEY_get1_EC_KEY(pkey.get())); in certificateChainGetTopMostKey()
1550 auto pkey = EVP_PKEY_Ptr(X509_get_pubkey(certs[0].get())); in certificateFindPublicKey() local
1551 if (pkey.get() == nullptr) { in certificateFindPublicKey()
1556 auto ecKey = EC_KEY_Ptr(EVP_PKEY_get1_EC_KEY(pkey.get())); in certificateFindPublicKey()