NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.5: NDN, CCN, CCNx, content centric networks
API Documentation
public-key.hpp
Go to the documentation of this file.
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2
/*
3
* Copyright (c) 2013-2022 Regents of the University of California.
4
*
5
* This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
6
*
7
* ndn-cxx library is free software: you can redistribute it and/or modify it under the
8
* terms of the GNU Lesser General Public License as published by the Free Software
9
* Foundation, either version 3 of the License, or (at your option) any later version.
10
*
11
* ndn-cxx library is distributed in the hope that it will be useful, but WITHOUT ANY
12
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
13
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
14
*
15
* You should have received copies of the GNU General Public License and GNU Lesser
16
* General Public License along with ndn-cxx, e.g., in COPYING.md file. If not, see
17
* <http://www.gnu.org/licenses/>.
18
*
19
* See AUTHORS.md for complete list of ndn-cxx authors and contributors.
20
*/
21
22
#ifndef NDN_CXX_SECURITY_TRANSFORM_PUBLIC_KEY_HPP
23
#define NDN_CXX_SECURITY_TRANSFORM_PUBLIC_KEY_HPP
24
25
#include "
ndn-cxx/security/security-common.hpp
"
26
#include "
ndn-cxx/encoding/buffer.hpp
"
27
28
namespace
ndn
{
29
namespace
security
{
30
namespace
transform
{
31
35
class
PublicKey
: noncopyable
36
{
37
public
:
38
class
Error
:
public
std::runtime_error
39
{
40
public
:
41
using
std::runtime_error::runtime_error;
42
};
43
44
public
:
50
PublicKey
();
51
52
~PublicKey
();
53
57
KeyType
58
getKeyType
()
const
;
59
63
size_t
64
getKeySize
()
const
;
65
69
void
70
loadPkcs8
(span<const uint8_t> buf);
71
75
void
76
loadPkcs8
(std::istream& is);
77
81
void
82
loadPkcs8Base64
(span<const uint8_t> buf);
83
87
void
88
loadPkcs8Base64
(std::istream& is);
89
93
void
94
savePkcs8
(std::ostream& os)
const
;
95
99
void
100
savePkcs8Base64
(std::ostream& os)
const
;
101
107
ConstBufferPtr
108
encrypt
(span<const uint8_t> plainText)
const
;
109
110
private
:
111
friend
class
VerifierFilter
;
112
118
void
*
119
getEvpPkey()
const
;
120
121
ConstBufferPtr
122
toPkcs8()
const
;
123
124
ConstBufferPtr
125
rsaEncrypt(span<const uint8_t> plainText)
const
;
126
127
private
:
128
class
Impl
;
129
const
unique_ptr<Impl> m_impl;
130
};
131
132
}
// namespace transform
133
}
// namespace security
134
}
// namespace ndn
135
136
#endif // NDN_CXX_SECURITY_TRANSFORM_PUBLIC_KEY_HPP
ndn::security::transform::PublicKey::getKeyType
KeyType getKeyType() const
Return the type of the public key.
Definition:
public-key.cpp:72
ndn
Copyright (c) 2011-2015 Regents of the University of California.
Definition:
ndn-strategy-choice-helper.hpp:34
ndn::security::transform::VerifierFilter
The module to verify signatures.
Definition:
verifier-filter.hpp:40
ndn::security::transform::PublicKey::loadPkcs8Base64
void loadPkcs8Base64(span< const uint8_t > buf)
Load the public key in base64-encoded PKCS#8 format from a buffer buf.
Definition:
public-key.cpp:118
ndn::security::transform::PublicKey
Abstraction of public key in crypto transformation.
Definition:
public-key.hpp:35
ndn::security::transform::PublicKey::encrypt
ConstBufferPtr encrypt(span< const uint8_t > plainText) const
Definition:
public-key.cpp:146
ndn::security::transform::PublicKey::loadPkcs8
void loadPkcs8(span< const uint8_t > buf)
Load the public key in PKCS#8 format from a buffer buf.
Definition:
public-key.cpp:100
ndn::KeyType
KeyType
The type of a cryptographic key.
Definition:
security-common.hpp:95
ndn::security::transform::PublicKey::Error
Definition:
public-key.hpp:38
ndn::security::transform::PublicKey::~PublicKey
~PublicKey()
transform
ndn::security::transform::PublicKey::getKeySize
size_t getKeySize() const
Return the size of the public key in bits.
Definition:
public-key.cpp:88
ndn::security::transform::PublicKey::PublicKey
PublicKey()
Create an empty public key instance.
Definition:
public-key.cpp:64
ndn::security
Definition:
dummy-keychain.cpp:28
ndn::security::transform::PublicKey::savePkcs8Base64
void savePkcs8Base64(std::ostream &os) const
Save the public key in base64-encoded PKCS#8 format into a stream os.
Definition:
public-key.cpp:140
buffer.hpp
ndn::security::transform::PublicKey::savePkcs8
void savePkcs8(std::ostream &os) const
Save the public key in PKCS#8 format into a stream os.
Definition:
public-key.cpp:134
ndn::security::transform::PublicKey::Impl
Definition:
public-key.cpp:47
security-common.hpp
ndn::ConstBufferPtr
shared_ptr< const Buffer > ConstBufferPtr
Definition:
buffer.hpp:139
ndnSIM
ndn-cxx
ndn-cxx
security
transform
public-key.hpp
Generated on Fri May 6 2022 12:34:13 for ndnSIM by
1.8.13