summaryrefslogtreecommitdiff
path: root/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_EVP_PKEY.h
blob: cfd1384aebf47642e5e7e64f7d9e0a2669ab0593 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
// -*- C++ -*-

//=============================================================================
/**
 *  @file   SSLIOP_EVP_PKEY.h
 *
 *  $Id$
 *
 *  @author Ossama Othman <ossama@dre,vanderbilt.edu>
 */
//=============================================================================

#ifndef TAO_SSLIOP_EVP_PKEY_H
#define TAO_SSLIOP_EVP_PKEY_H

#include /**/ "ace/pre.h"

#include "ace/config-all.h"

#if !defined (ACE_LACKS_PRAGMA_ONCE)
#pragma once
#endif /* ACE_LACKS_PRAGMA_ONCE */

#include "SSLIOP_OpenSSL_st_T.h"

#include <openssl/crypto.h>
#include <openssl/evp.h>


namespace TAO
{
  namespace SSLIOP
  {
    // OpenSSL @c EVP_PKEY structure traits specialization.
    template <>
    struct OpenSSL_traits< ::EVP_PKEY >
    {
      /// OpenSSL lock ID for use in OpenSSL CRYPTO_add() reference
      /// count manipulation function.
      static const long LOCK_ID = CRYPTO_LOCK_EVP_PKEY;

      /// Perform deep copy of the given OpenSSL structure.
      static ::EVP_PKEY * copy (::EVP_PKEY const & key);

      /// Decrease the reference count on the given OpenSSL
      /// structure.
      static void release (::EVP_PKEY * st)
      {
        ::EVP_PKEY_free (st);
      }
    };

    typedef OpenSSL_st_var< ::EVP_PKEY > EVP_PKEY_var;

  }  // End SSLIOP namespace.
}  // End TAO namespace.


#include /**/ "ace/post.h"

#endif  /* TAO_SSLIOP_EVP_PKEY_H */