Alexander Afanasyev | 0711380 | 2015-01-15 19:14:36 -0800 | [diff] [blame] | 1 | /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
| 2 | /** |
Alexander Afanasyev | 4c9a3d5 | 2017-01-03 17:45:19 -0800 | [diff] [blame] | 3 | * Copyright (c) 2013-2017 Regents of the University of California. |
Alexander Afanasyev | 0711380 | 2015-01-15 19:14:36 -0800 | [diff] [blame] | 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 | #include "dummy-keychain.hpp" |
Junxiao Shi | 160701a | 2016-08-30 11:35:25 +0000 | [diff] [blame] | 23 | #include "encoding/buffer-stream.hpp" |
Alexander Afanasyev | 0711380 | 2015-01-15 19:14:36 -0800 | [diff] [blame] | 24 | #include "util/io.hpp" |
| 25 | #include <boost/iostreams/device/array.hpp> |
| 26 | |
| 27 | namespace ndn { |
| 28 | namespace security { |
Alexander Afanasyev | 4c9a3d5 | 2017-01-03 17:45:19 -0800 | [diff] [blame] | 29 | namespace v1 { |
Alexander Afanasyev | 0711380 | 2015-01-15 19:14:36 -0800 | [diff] [blame] | 30 | |
| 31 | static const uint8_t DUMMY_CERT[] = |
| 32 | "Bv0C8Ac4CAVkdW1teQgDa2V5CANLRVkIEWtzay0xNDE4NjAwMzkxMDUwCAdJRC1D" |
| 33 | "RVJUCAn9AAABSkssIl4UAxgBAhX9AXMwggFvMCIYDzIwMTQxMjE0MjMzOTUxWhgP" |
| 34 | "MjAzNDEyMDkyMzM5NTFaMCUwIwYDVQQpExwvZHVtbXkva2V5L2tzay0xNDE4NjAw" |
| 35 | "MzkxMDUwMIIBIDANBgkqhkiG9w0BAQEFAAOCAQ0AMIIBCAKCAQEAxUfhv54Jdgeq" |
| 36 | "0wmQ/ru9ew/ByCKcQawaZT9Xm9o/sMahwQ9IbNx2Dz4Jkelaxra7+DI0QP3pYctv" |
| 37 | "Ykn/jwq5y3cO0LJQB+kf/7FtSKG9qBEv8aqq5hDVteBUKiyUXqDmQzbe+mTcJ9Yd" |
| 38 | "D7siF1dhrjnM3KL1xpcXu3QaV5m/I6cKVwYrJxp3JKr6k5pHhxJlPIyUu7oU3kFW" |
| 39 | "7bHq2uq4ec9gBXCKwA64IVYVQm1GVDk+V0wr7pw9qD6QNa7eMzrCME6vfM0deSiU" |
| 40 | "a4TovUJDQFDsM287kYm3tZu7iuJzmOC63tl4YZdyqyOgnqSrUGE1soNHfLokI13H" |
| 41 | "hSwxok7nuQIBERY0GwEBHC8HLQgFZHVtbXkIA2tleQgDS0VZCBFrc2stMTQxODYw" |
| 42 | "MDM5MTA1MAgHSUQtQ0VSVBf9AQBLLJoQt9HE93NI3Mv1JCb3ezBCWMwTDnZA+XQV" |
| 43 | "UgVSvISJfU/lo2sne0SfGp4KsUhj206CDpuh3q0Th5gKSJeysy/bv66V2m2G8aDn" |
| 44 | "OkJ7Ut+2o/QnFpIMJz+oZf2f9Z0Pchocmkv8y4Fj02t8HCuFO1ekEvOcocZvWbKy" |
| 45 | "HX+P0OdefPzSC535/rsNHXTzgPsoV+yb13vrm4wPeqPPBs+scQYneIFKkRkGE5PU" |
| 46 | "pkncAMBN6iWgmSA2RcjcbmT6utCjJTqWviX1XPQtHoF/hBGC0D/TtQDgwVGGibXB" |
| 47 | "zb+klRHvCC/uUIfjU2HrE705kaw8btPhTP5/PMe8YKkk+hjh"; |
| 48 | |
| 49 | static const uint8_t DUMMY_SIGNATURE[] = |
| 50 | {0x17, 0xfd, 0x01, 0x00, 0x93, 0x15, 0x09, 0x49, 0x79, 0x9e, 0xb7, 0x9c, 0xd3, 0xc1, 0xbf, 0x61, |
| 51 | 0x89, 0xd5, 0xd9, 0xca, 0xf2, 0xb0, 0x14, 0xae, 0x72, 0x7c, 0x1f, 0x8f, 0xf5, 0xb1, 0x70, 0xd6, |
| 52 | 0x9b, 0x8f, 0xf8, 0xd7, 0x2d, 0xbc, 0x92, 0x6f, 0x7d, 0x77, 0x96, 0x46, 0xea, 0xd4, 0x7d, 0x90, |
| 53 | 0xbc, 0x7a, 0xeb, 0xe2, 0x03, 0x93, 0xb1, 0xd2, 0x62, 0xec, 0x9d, 0xff, 0x9c, 0x9c, 0x2a, 0x14, |
| 54 | 0x7d, 0x23, 0xca, 0x29, 0x3d, 0x15, 0x1a, 0x40, 0x42, 0x2c, 0x59, 0x33, 0x8a, 0xf7, 0xc0, 0x6b, |
| 55 | 0xc4, 0x9c, 0xf3, 0xc4, 0x99, 0xa4, 0x1a, 0x60, 0xf5, 0x28, 0x7d, 0x4c, 0xef, 0x43, 0x7d, 0xbd, |
| 56 | 0x7d, 0x00, 0x51, 0xee, 0x41, 0xf5, 0x25, 0x80, 0xce, 0xe6, 0x64, 0x4f, 0x75, 0x54, 0xf3, 0xb2, |
| 57 | 0x99, 0x9a, 0x0f, 0x93, 0x9a, 0x28, 0x1d, 0xfe, 0x12, 0x8a, 0xe0, 0xc1, 0x02, 0xeb, 0xa4, 0x35, |
| 58 | 0x52, 0x88, 0xac, 0x44, 0x1a, 0x44, 0x82, 0x97, 0x4f, 0x5f, 0xa8, 0xd8, 0x9f, 0x67, 0x38, 0xa8, |
| 59 | 0x64, 0xb6, 0x62, 0x99, 0xbd, 0x96, 0x3c, 0xf5, 0x86, 0x09, 0x5c, 0x97, 0x6b, 0x8f, 0xae, 0xe0, |
| 60 | 0x60, 0xe7, 0x23, 0x98, 0x6a, 0xee, 0xc1, 0xb0, 0x14, 0xbe, 0x46, 0x2c, 0xfb, 0xa7, 0x27, 0x73, |
| 61 | 0xe4, 0xf3, 0x26, 0x33, 0xba, 0x99, 0xd4, 0x01, 0x38, 0xa8, 0xf2, 0x9e, 0x87, 0xe0, 0x71, 0x0b, |
| 62 | 0x25, 0x44, 0x07, 0x35, 0x88, 0xab, 0x67, 0x27, 0x56, 0x0e, 0xb5, 0xb5, 0xe8, 0x27, 0xb4, 0x49, |
| 63 | 0xdc, 0xb8, 0x48, 0x31, 0xff, 0x99, 0x48, 0xab, 0x11, 0xb4, 0xa0, 0xdf, 0x8a, 0x6d, 0xff, 0x43, |
| 64 | 0x69, 0x32, 0xa7, 0xbc, 0x63, 0x9d, 0x0f, 0xe0, 0x95, 0x34, 0x36, 0x25, 0x4b, 0x3e, 0x36, 0xbd, |
| 65 | 0x81, 0x91, 0x0b, 0x91, 0x9f, 0x3a, 0x04, 0xa2, 0x44, 0x28, 0x19, 0xa1, 0x38, 0x21, 0x4f, 0x25, |
| 66 | 0x59, 0x8a, 0x48, 0xc2}; |
| 67 | |
| 68 | const std::string DummyPublicInfo::SCHEME = "pib-dummy"; |
| 69 | const std::string DummyTpm::SCHEME = "tpm-dummy"; |
| 70 | |
Alexander Afanasyev | 4c9a3d5 | 2017-01-03 17:45:19 -0800 | [diff] [blame] | 71 | NDN_CXX_V1_KEYCHAIN_REGISTER_PIB(DummyPublicInfo, "pib-dummy", "dummy"); |
| 72 | NDN_CXX_V1_KEYCHAIN_REGISTER_TPM(DummyTpm, "tpm-dummy", "dummy"); |
Alexander Afanasyev | 0711380 | 2015-01-15 19:14:36 -0800 | [diff] [blame] | 73 | |
Alexander Afanasyev | 34a3763 | 2015-01-16 17:37:36 -0800 | [diff] [blame] | 74 | typedef DummyPublicInfo DummyPublicInfo2; |
| 75 | typedef DummyTpm DummyTpm2; |
| 76 | |
Alexander Afanasyev | 4c9a3d5 | 2017-01-03 17:45:19 -0800 | [diff] [blame] | 77 | NDN_CXX_V1_KEYCHAIN_REGISTER_PIB(DummyPublicInfo2, "pib-dummy2"); |
| 78 | NDN_CXX_V1_KEYCHAIN_REGISTER_TPM(DummyTpm2, "tpm-dummy2"); |
Alexander Afanasyev | 34a3763 | 2015-01-16 17:37:36 -0800 | [diff] [blame] | 79 | |
Alexander Afanasyev | 0711380 | 2015-01-15 19:14:36 -0800 | [diff] [blame] | 80 | DummyPublicInfo::DummyPublicInfo(const std::string& locator) |
| 81 | : SecPublicInfo(locator) |
| 82 | { |
| 83 | } |
| 84 | |
| 85 | bool |
| 86 | DummyPublicInfo::doesIdentityExist(const Name& identityName) |
| 87 | { |
| 88 | return true; |
| 89 | } |
| 90 | |
| 91 | void |
| 92 | DummyPublicInfo::addIdentity(const Name& identityName) |
| 93 | { |
| 94 | } |
| 95 | |
| 96 | bool |
| 97 | DummyPublicInfo::revokeIdentity() |
| 98 | { |
| 99 | return true; |
| 100 | } |
| 101 | |
| 102 | bool |
| 103 | DummyPublicInfo::doesPublicKeyExist(const Name& keyName) |
| 104 | { |
| 105 | return true; |
| 106 | } |
| 107 | |
| 108 | void |
Alexander Afanasyev | 2fa5939 | 2016-07-29 17:24:23 -0700 | [diff] [blame] | 109 | DummyPublicInfo::addKey(const Name& keyName, const v1::PublicKey& publicKey) |
Alexander Afanasyev | 0711380 | 2015-01-15 19:14:36 -0800 | [diff] [blame] | 110 | { |
| 111 | } |
| 112 | |
Alexander Afanasyev | 2fa5939 | 2016-07-29 17:24:23 -0700 | [diff] [blame] | 113 | shared_ptr<v1::PublicKey> |
Alexander Afanasyev | 0711380 | 2015-01-15 19:14:36 -0800 | [diff] [blame] | 114 | DummyPublicInfo::getPublicKey(const Name& keyName) |
| 115 | { |
Alexander Afanasyev | 2fa5939 | 2016-07-29 17:24:23 -0700 | [diff] [blame] | 116 | static shared_ptr<v1::PublicKey> publicKey = nullptr; |
Alexander Afanasyev | 0711380 | 2015-01-15 19:14:36 -0800 | [diff] [blame] | 117 | if (publicKey == nullptr) { |
Junxiao Shi | 4ce0bcf | 2016-09-03 07:09:03 +0000 | [diff] [blame] | 118 | typedef boost::iostreams::stream<boost::iostreams::array_source> ArrayStream; |
| 119 | ArrayStream is(reinterpret_cast<const char*>(DUMMY_CERT), sizeof(DUMMY_CERT)); |
Alexander Afanasyev | 2fa5939 | 2016-07-29 17:24:23 -0700 | [diff] [blame] | 120 | auto cert = io::load<v1::IdentityCertificate>(is, io::NO_ENCODING); |
| 121 | publicKey = make_shared<v1::PublicKey>(cert->getPublicKeyInfo()); |
Alexander Afanasyev | 0711380 | 2015-01-15 19:14:36 -0800 | [diff] [blame] | 122 | } |
| 123 | |
| 124 | return publicKey; |
| 125 | } |
| 126 | |
| 127 | KeyType |
| 128 | DummyPublicInfo::getPublicKeyType(const Name& keyName) |
| 129 | { |
Yingdi Yu | 99b2a00 | 2015-08-12 12:47:44 -0700 | [diff] [blame] | 130 | return KeyType::RSA; |
Alexander Afanasyev | 0711380 | 2015-01-15 19:14:36 -0800 | [diff] [blame] | 131 | } |
| 132 | |
| 133 | bool |
| 134 | DummyPublicInfo::doesCertificateExist(const Name& certificateName) |
| 135 | { |
| 136 | return true; |
| 137 | } |
| 138 | |
| 139 | void |
Alexander Afanasyev | 2fa5939 | 2016-07-29 17:24:23 -0700 | [diff] [blame] | 140 | DummyPublicInfo::addCertificate(const v1::IdentityCertificate& certificate) |
Alexander Afanasyev | 0711380 | 2015-01-15 19:14:36 -0800 | [diff] [blame] | 141 | { |
| 142 | } |
| 143 | |
Alexander Afanasyev | 2fa5939 | 2016-07-29 17:24:23 -0700 | [diff] [blame] | 144 | shared_ptr<v1::IdentityCertificate> |
Alexander Afanasyev | 0711380 | 2015-01-15 19:14:36 -0800 | [diff] [blame] | 145 | DummyPublicInfo::getCertificate(const Name& certificateName) |
| 146 | { |
Alexander Afanasyev | 2fa5939 | 2016-07-29 17:24:23 -0700 | [diff] [blame] | 147 | static shared_ptr<v1::IdentityCertificate> cert = nullptr; |
Alexander Afanasyev | 0711380 | 2015-01-15 19:14:36 -0800 | [diff] [blame] | 148 | if (cert == nullptr) { |
Junxiao Shi | 4ce0bcf | 2016-09-03 07:09:03 +0000 | [diff] [blame] | 149 | typedef boost::iostreams::stream<boost::iostreams::array_source> ArrayStream; |
| 150 | ArrayStream is(reinterpret_cast<const char*>(DUMMY_CERT), sizeof(DUMMY_CERT)); |
| 151 | cert = io::load<v1::IdentityCertificate>(is); |
Alexander Afanasyev | 0711380 | 2015-01-15 19:14:36 -0800 | [diff] [blame] | 152 | } |
| 153 | |
| 154 | return cert; |
| 155 | } |
| 156 | |
| 157 | Name |
| 158 | DummyPublicInfo::getDefaultIdentity() |
| 159 | { |
| 160 | return "/dummy/key"; |
| 161 | } |
| 162 | |
| 163 | Name |
| 164 | DummyPublicInfo::getDefaultKeyNameForIdentity(const Name& identityName) |
| 165 | { |
| 166 | return "/dummy/key/ksk-1418600391050"; |
| 167 | } |
| 168 | |
| 169 | Name |
| 170 | DummyPublicInfo::getDefaultCertificateNameForKey(const Name& keyName) |
| 171 | { |
| 172 | return "/dummy/key/KEY/ksk-1418600391050/ID-CERT/%FD%00%00%01JK%2C%22%5E"; |
| 173 | } |
| 174 | |
| 175 | void |
| 176 | DummyPublicInfo::getAllIdentities(std::vector<Name>& nameList, bool isDefault) |
| 177 | { |
| 178 | if (isDefault) { |
| 179 | nameList.push_back("/dummy"); |
| 180 | } |
| 181 | } |
| 182 | |
| 183 | void |
| 184 | DummyPublicInfo::getAllKeyNames(std::vector<Name>& nameList, bool isDefault) |
| 185 | { |
| 186 | if (isDefault) { |
| 187 | nameList.push_back("/dummy/key/ksk-1418600391050"); |
| 188 | } |
| 189 | } |
| 190 | |
| 191 | void |
| 192 | DummyPublicInfo::getAllKeyNamesOfIdentity(const Name& identity, std::vector<Name>& nameList, |
| 193 | bool isDefault) |
| 194 | { |
| 195 | if (isDefault) { |
| 196 | nameList.push_back("/dummy/key/ksk-1418600391050"); |
| 197 | } |
| 198 | } |
| 199 | |
| 200 | void |
| 201 | DummyPublicInfo::getAllCertificateNames(std::vector<Name>& nameList, bool isDefault) |
| 202 | { |
| 203 | if (isDefault) { |
| 204 | nameList.push_back("/dummy/key/KEY/ksk-1418600391050/ID-CERT/%FD%00%00%01JK%2C%22%5E"); |
| 205 | } |
| 206 | } |
| 207 | |
| 208 | void |
| 209 | DummyPublicInfo::getAllCertificateNamesOfKey(const Name& keyName, std::vector<Name>& nameList, |
| 210 | bool isDefault) |
| 211 | { |
| 212 | if (isDefault) { |
| 213 | nameList.push_back("/dummy/key/KEY/ksk-1418600391050/ID-CERT/%FD%00%00%01JK%2C%22%5E"); |
| 214 | } |
| 215 | } |
| 216 | |
| 217 | void |
| 218 | DummyPublicInfo::deleteCertificateInfo(const Name& certificateName) |
| 219 | { |
| 220 | } |
| 221 | |
| 222 | void |
| 223 | DummyPublicInfo::deletePublicKeyInfo(const Name& keyName) |
| 224 | { |
| 225 | } |
| 226 | |
| 227 | void |
| 228 | DummyPublicInfo::deleteIdentityInfo(const Name& identity) |
| 229 | { |
| 230 | } |
| 231 | |
| 232 | void |
| 233 | DummyPublicInfo::setDefaultIdentityInternal(const Name& identityName) |
| 234 | { |
| 235 | } |
| 236 | |
| 237 | void |
| 238 | DummyPublicInfo::setDefaultKeyNameForIdentityInternal(const Name& keyName) |
| 239 | { |
| 240 | } |
| 241 | |
| 242 | void |
| 243 | DummyPublicInfo::setDefaultCertificateNameForKeyInternal(const Name& certificateName) |
| 244 | { |
| 245 | } |
| 246 | |
| 247 | void |
| 248 | DummyPublicInfo::setTpmLocator(const std::string& tpmLocator) |
| 249 | { |
| 250 | m_tpmLocator = tpmLocator; |
| 251 | } |
| 252 | |
| 253 | std::string |
| 254 | DummyPublicInfo::getTpmLocator() |
| 255 | { |
| 256 | return m_tpmLocator; |
| 257 | } |
| 258 | |
| 259 | std::string |
| 260 | DummyPublicInfo::getScheme() |
| 261 | { |
| 262 | return DummyPublicInfo::SCHEME; |
| 263 | } |
| 264 | |
| 265 | ////////////////////////////////////////////////////////////////////////////////////////// |
| 266 | ////////////////////////////////////////////////////////////////////////////////////////// |
| 267 | ////////////////////////////////////////////////////////////////////////////////////////// |
| 268 | ////////////////////////////////////////////////////////////////////////////////////////// |
| 269 | |
| 270 | DummyTpm::DummyTpm(const std::string& locator) |
| 271 | : SecTpm(locator) |
| 272 | { |
| 273 | } |
| 274 | |
| 275 | void |
| 276 | DummyTpm::setTpmPassword(const uint8_t* password, size_t passwordLength) |
| 277 | { |
| 278 | } |
| 279 | |
| 280 | void |
| 281 | DummyTpm::resetTpmPassword() |
| 282 | { |
| 283 | } |
| 284 | |
| 285 | void |
| 286 | DummyTpm::setInTerminal(bool inTerminal) |
| 287 | { |
| 288 | } |
| 289 | |
| 290 | bool |
| 291 | DummyTpm::getInTerminal() const |
| 292 | { |
| 293 | return false; |
| 294 | } |
| 295 | |
| 296 | bool |
| 297 | DummyTpm::isLocked() |
| 298 | { |
| 299 | return false; |
| 300 | } |
| 301 | |
| 302 | bool |
| 303 | DummyTpm::unlockTpm(const char* password, size_t passwordLength, bool usePassword) |
| 304 | { |
| 305 | return true; |
| 306 | } |
| 307 | |
| 308 | void |
| 309 | DummyTpm::generateKeyPairInTpm(const Name& keyName, const KeyParams& params) |
| 310 | { |
| 311 | } |
| 312 | |
| 313 | void |
| 314 | DummyTpm::deleteKeyPairInTpm(const Name& keyName) |
| 315 | { |
| 316 | } |
| 317 | |
Alexander Afanasyev | 2fa5939 | 2016-07-29 17:24:23 -0700 | [diff] [blame] | 318 | shared_ptr<v1::PublicKey> |
Alexander Afanasyev | 0711380 | 2015-01-15 19:14:36 -0800 | [diff] [blame] | 319 | DummyTpm::getPublicKeyFromTpm(const Name& keyName) |
| 320 | { |
| 321 | return nullptr; |
| 322 | } |
| 323 | |
| 324 | Block |
| 325 | DummyTpm::signInTpm(const uint8_t* data, size_t dataLength, const Name& keyName, |
| 326 | DigestAlgorithm digestAlgorithm) |
| 327 | { |
| 328 | return Block(DUMMY_SIGNATURE, sizeof(DUMMY_SIGNATURE)); |
| 329 | } |
| 330 | |
| 331 | ConstBufferPtr |
| 332 | DummyTpm::decryptInTpm(const uint8_t* data, size_t dataLength, const Name& keyName, |
| 333 | bool isSymmetric) |
| 334 | { |
Spyridon Mastorakis | 0d2ed2e | 2015-07-27 19:09:12 -0700 | [diff] [blame] | 335 | BOOST_THROW_EXCEPTION(Error("Not supported")); |
Alexander Afanasyev | 0711380 | 2015-01-15 19:14:36 -0800 | [diff] [blame] | 336 | } |
| 337 | |
| 338 | ConstBufferPtr |
| 339 | DummyTpm::encryptInTpm(const uint8_t* data, size_t dataLength, const Name& keyName, |
| 340 | bool isSymmetric) |
| 341 | { |
Spyridon Mastorakis | 0d2ed2e | 2015-07-27 19:09:12 -0700 | [diff] [blame] | 342 | BOOST_THROW_EXCEPTION(Error("Not supported")); |
Alexander Afanasyev | 0711380 | 2015-01-15 19:14:36 -0800 | [diff] [blame] | 343 | } |
| 344 | |
| 345 | void |
| 346 | DummyTpm::generateSymmetricKeyInTpm(const Name& keyName, const KeyParams& params) |
| 347 | { |
| 348 | } |
| 349 | |
| 350 | bool |
| 351 | DummyTpm::doesKeyExistInTpm(const Name& keyName, KeyClass keyClass) |
| 352 | { |
| 353 | return true; |
| 354 | } |
| 355 | |
| 356 | bool |
| 357 | DummyTpm::generateRandomBlock(uint8_t* res, size_t size) |
| 358 | { |
| 359 | return false; |
| 360 | } |
| 361 | |
| 362 | void |
| 363 | DummyTpm::addAppToAcl(const Name& keyName, KeyClass keyClass, const std::string& appPath, |
| 364 | AclType acl) |
| 365 | { |
| 366 | } |
| 367 | |
| 368 | ConstBufferPtr |
| 369 | DummyTpm::exportPrivateKeyPkcs8FromTpm(const Name& keyName) |
| 370 | { |
Spyridon Mastorakis | 0d2ed2e | 2015-07-27 19:09:12 -0700 | [diff] [blame] | 371 | BOOST_THROW_EXCEPTION(Error("Not supported")); |
Alexander Afanasyev | 0711380 | 2015-01-15 19:14:36 -0800 | [diff] [blame] | 372 | } |
| 373 | |
| 374 | bool |
| 375 | DummyTpm::importPrivateKeyPkcs8IntoTpm(const Name& keyName, const uint8_t* buffer, |
| 376 | size_t bufferSize) |
| 377 | { |
| 378 | return false; |
| 379 | } |
| 380 | |
| 381 | bool |
| 382 | DummyTpm::importPublicKeyPkcs1IntoTpm(const Name& keyName, const uint8_t* buffer, size_t bufferSize) |
| 383 | { |
| 384 | return false; |
| 385 | } |
| 386 | |
| 387 | std::string |
| 388 | DummyTpm::getScheme() |
| 389 | { |
| 390 | return DummyTpm::SCHEME; |
| 391 | } |
| 392 | |
Alexander Afanasyev | 4c9a3d5 | 2017-01-03 17:45:19 -0800 | [diff] [blame] | 393 | } // namespace v1 |
Alexander Afanasyev | 0711380 | 2015-01-15 19:14:36 -0800 | [diff] [blame] | 394 | } // namespace security |
| 395 | } // namespace ndn |