Public Member Functions | |
ecdh_pubkey_as_octets (EVP_PKEY *pkey) | |
~ecdh_pubkey_as_octets () | |
int | operator() (DDS::OctetSeq &dst) |
Private Attributes | |
EVP_PKEY * | keypair |
Definition at line 308 of file DiffieHellman.cpp.
OpenDDS::Security::SSL::ecdh_pubkey_as_octets::ecdh_pubkey_as_octets | ( | EVP_PKEY * | pkey | ) | [inline] |
Definition at line 311 of file DiffieHellman.cpp.
00312 : keypair(pkey) 00313 { 00314 }
OpenDDS::Security::SSL::ecdh_pubkey_as_octets::~ecdh_pubkey_as_octets | ( | ) | [inline] |
Definition at line 316 of file DiffieHellman.cpp.
int OpenDDS::Security::SSL::ecdh_pubkey_as_octets::operator() | ( | DDS::OctetSeq & | dst | ) | [inline] |
Definition at line 318 of file DiffieHellman.cpp.
References keypair, len, and OPENDDS_SSL_LOG_ERR.
00319 { 00320 if (!keypair) return 1; 00321 00322 EC_Handle keypair_ecdh(keypair); 00323 if (!keypair_ecdh) { 00324 OPENDDS_SSL_LOG_ERR("EVP_PKEY_get0_EC_KEY failed"); 00325 return 1; 00326 } 00327 00328 const EC_POINT* pubkey = EC_KEY_get0_public_key(keypair_ecdh); 00329 if (!pubkey) { 00330 OPENDDS_SSL_LOG_ERR("EC_KEY_get0_public_key failed"); 00331 return 1; 00332 } 00333 00334 size_t len = 0u; 00335 if (0 == (len = EC_POINT_point2oct( 00336 EC_KEY_get0_group(keypair_ecdh), pubkey, 00337 EC_KEY_get_conv_form(keypair_ecdh), NULL, 0u, NULL))) { 00338 OPENDDS_SSL_LOG_ERR("EC_POINT_point2oct failed"); 00339 return 1; 00340 } 00341 00342 dst.length(len); 00343 00344 if (0 == 00345 (len = EC_POINT_point2oct(EC_KEY_get0_group(keypair_ecdh), pubkey, 00346 EC_KEY_get_conv_form(keypair_ecdh), 00347 dst.get_buffer(), len, NULL))) { 00348 OPENDDS_SSL_LOG_ERR("EC_POINT_point2oct failed"); 00349 return 1; 00350 } 00351 00352 return 0; 00353 }
Definition at line 356 of file DiffieHellman.cpp.
Referenced by operator()().