OpenDDS::Security::SSL::ecdh_constructor Class Reference

List of all members.

Public Member Functions

 ecdh_constructor ()
 ~ecdh_constructor ()
EVP_PKEYoperator() ()

Private Attributes

EVP_PKEYparams
EVP_PKEY_CTX * paramgen_ctx
EVP_PKEY_CTX * keygen_ctx

Detailed Description

Definition at line 227 of file DiffieHellman.cpp.


Constructor & Destructor Documentation

OpenDDS::Security::SSL::ecdh_constructor::ecdh_constructor (  )  [inline]

Definition at line 230 of file DiffieHellman.cpp.

00230 : params(NULL), paramgen_ctx(NULL), keygen_ctx(NULL) {}

OpenDDS::Security::SSL::ecdh_constructor::~ecdh_constructor (  )  [inline]

Definition at line 232 of file DiffieHellman.cpp.

References keygen_ctx, paramgen_ctx, and params.

00233     {
00234       EVP_PKEY_free(params);
00235       EVP_PKEY_CTX_free(paramgen_ctx);
00236       EVP_PKEY_CTX_free(keygen_ctx);
00237     }


Member Function Documentation

EVP_PKEY* OpenDDS::Security::SSL::ecdh_constructor::operator() ( void   )  [inline]

Definition at line 239 of file DiffieHellman.cpp.

References keygen_ctx, OPENDDS_SSL_LOG_ERR, paramgen_ctx, and params.

00240     {
00241       EVP_PKEY* result = NULL;
00242 
00243       if (NULL == (paramgen_ctx = EVP_PKEY_CTX_new_id(EVP_PKEY_EC, NULL))) {
00244         OPENDDS_SSL_LOG_ERR("EVP_PKEY_CTX_new_id");
00245         return NULL;
00246       }
00247 
00248       if (NULL == (params = EVP_PKEY_new())) {
00249         OPENDDS_SSL_LOG_ERR("EVP_PKEY_new failed");
00250         return NULL;
00251       }
00252 
00253       if (1 != EVP_PKEY_paramgen_init(paramgen_ctx)) {
00254         OPENDDS_SSL_LOG_ERR("EVP_PKEY_paramgen_init failed");
00255         return NULL;
00256       }
00257 
00258       if (1 != EVP_PKEY_CTX_set_ec_paramgen_curve_nid(paramgen_ctx,
00259                                                       NID_X9_62_prime256v1)) {
00260         OPENDDS_SSL_LOG_ERR("EVP_PKEY_CTX_set_ec_paramgen_curve_nid failed");
00261         return NULL;
00262       }
00263 
00264       if (1 != EVP_PKEY_paramgen(paramgen_ctx, &params)) {
00265         OPENDDS_SSL_LOG_ERR("EVP_PKEY_paramgen failed");
00266         return NULL;
00267       }
00268 
00269       if (NULL == (keygen_ctx = EVP_PKEY_CTX_new(params, NULL))) {
00270         OPENDDS_SSL_LOG_ERR("EVP_PKEY_CTX_new failed");
00271         return NULL;
00272       }
00273 
00274       if (1 != EVP_PKEY_keygen_init(keygen_ctx)) {
00275         OPENDDS_SSL_LOG_ERR("EVP_PKEY_keygen_init failed");
00276         return NULL;
00277       }
00278 
00279       if (1 != EVP_PKEY_keygen(keygen_ctx, &result)) {
00280         OPENDDS_SSL_LOG_ERR("EVP_PKEY_keygen failed");
00281         return NULL;
00282       }
00283 
00284       return result;
00285     }


Member Data Documentation

Definition at line 290 of file DiffieHellman.cpp.

Referenced by operator()(), and ~ecdh_constructor().

Definition at line 289 of file DiffieHellman.cpp.

Referenced by operator()(), and ~ecdh_constructor().

Definition at line 288 of file DiffieHellman.cpp.

Referenced by operator()(), and ~ecdh_constructor().


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on 10 Aug 2018 for OpenDDS by  doxygen 1.6.1