NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.3: NDN, CCN, CCNx, content centric networks
API Documentation
openssl-helper.cpp
Go to the documentation of this file.
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
22
#include "
openssl-helper.hpp
"
23
24
namespace
ndn
{
25
namespace
security
{
26
namespace
detail {
27
28
const
EVP_MD*
29
toDigestEvpMd
(
DigestAlgorithm
algo)
30
{
31
switch
(algo) {
32
case
DigestAlgorithm::SHA256
:
33
return
EVP_sha256();
34
default
:
35
return
nullptr
;
36
}
37
}
38
39
EvpPkey::EvpPkey
()
40
: m_key(nullptr)
41
{
42
}
43
44
EvpPkey::~EvpPkey
()
45
{
46
EVP_PKEY_free(m_key);
47
}
48
49
EvpPkeyCtx::EvpPkeyCtx
(EVP_PKEY* key)
50
: m_ctx(EVP_PKEY_CTX_new(key, nullptr))
51
{
52
BOOST_ASSERT(m_ctx !=
nullptr
);
53
}
54
55
EvpPkeyCtx::EvpPkeyCtx
(
int
id
)
56
: m_ctx(EVP_PKEY_CTX_new_id(id, nullptr))
57
{
58
BOOST_ASSERT(m_ctx !=
nullptr
);
59
}
60
61
EvpPkeyCtx::~EvpPkeyCtx
()
62
{
63
EVP_PKEY_CTX_free(m_ctx);
64
}
65
66
#if OPENSSL_VERSION_NUMBER < 0x1010000fL
67
Bio::Bio
(BIO_METHOD* method)
68
#else
69
Bio::Bio
(
const
BIO_METHOD* method)
70
#endif // OPENSSL_VERSION_NUMBER < 0x1010000fL
71
: m_bio(BIO_new(method))
72
{
73
BOOST_ASSERT(m_bio !=
nullptr
);
74
}
75
76
Bio::~Bio
()
77
{
78
BIO_free_all(m_bio);
79
}
80
81
}
// namespace detail
82
}
// namespace security
83
}
// namespace ndn
ndn
Copyright (c) 2011-2015 Regents of the University of California.
Definition:
ndn-strategy-choice-helper.hpp:34
ndn::security::detail::Bio::~Bio
~Bio()
Definition:
openssl-helper.cpp:76
ndn::security::detail::EvpPkeyCtx::~EvpPkeyCtx
~EvpPkeyCtx()
Definition:
openssl-helper.cpp:61
ndn::security::detail::EvpPkey::~EvpPkey
~EvpPkey()
Definition:
openssl-helper.cpp:44
ndn::security::detail::EvpPkeyCtx::EvpPkeyCtx
EvpPkeyCtx(EVP_PKEY *key)
Definition:
openssl-helper.cpp:49
ndn::security::detail::Bio::Bio
Bio(BIO_METHOD *method)
Definition:
openssl-helper.cpp:67
openssl-helper.hpp
ndn::DigestAlgorithm::SHA256
ndn::security::detail::EvpPkey::EvpPkey
EvpPkey()
Definition:
openssl-helper.cpp:39
ndn::DigestAlgorithm
DigestAlgorithm
Definition:
security-common.hpp:70
security
ndn::security::detail::toDigestEvpMd
const EVP_MD * toDigestEvpMd(DigestAlgorithm algo)
Definition:
openssl-helper.cpp:29
ndnSIM
ndn-cxx
src
security
detail
openssl-helper.cpp
Generated on Wed Jan 11 2017 18:17:14 for ndnSIM by
1.8.13