Jeff Thompson | 6c314bc | 2013-09-23 18:09:38 -0700 | [diff] [blame] | 1 | /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */ |
| 2 | /** |
| 3 | * Copyright (C) 2013 Regents of the University of California. |
| 4 | * @author: Jeff Thompson <jefft0@remap.ucla.edu> |
| 5 | * See COPYING for copyright and distribution information. |
| 6 | */ |
| 7 | |
| 8 | #include <stdexcept> |
| 9 | #include "memory-identity-storage.hpp" |
| 10 | |
| 11 | using namespace std; |
| 12 | using namespace ndn::ptr_lib; |
| 13 | |
| 14 | namespace ndn { |
| 15 | |
| 16 | MemoryIdentityStorage::~MemoryIdentityStorage() |
| 17 | { |
| 18 | } |
| 19 | |
| 20 | bool |
| 21 | MemoryIdentityStorage::doesIdentityExist(const Name& identityName) |
| 22 | { |
| 23 | #if 1 |
| 24 | throw std::runtime_error("MemoryIdentityStorage::doesIdentityExist not implemented"); |
| 25 | #endif |
| 26 | } |
| 27 | |
| 28 | void |
| 29 | MemoryIdentityStorage::addIdentity(const Name& identityName) |
| 30 | { |
| 31 | #if 1 |
| 32 | throw std::runtime_error("MemoryIdentityStorage::addIdentity not implemented"); |
| 33 | #endif |
| 34 | } |
| 35 | |
| 36 | bool |
| 37 | MemoryIdentityStorage::revokeIdentity() |
| 38 | { |
| 39 | #if 1 |
| 40 | throw std::runtime_error("MemoryIdentityStorage::revokeIdentity not implemented"); |
| 41 | #endif |
| 42 | } |
| 43 | |
| 44 | Name |
| 45 | MemoryIdentityStorage::getNewKeyName(const Name& identityName, bool useKsk) |
| 46 | { |
| 47 | #if 1 |
| 48 | throw std::runtime_error("MemoryIdentityStorage::getNewKeyName not implemented"); |
| 49 | #endif |
| 50 | } |
| 51 | |
| 52 | bool |
| 53 | MemoryIdentityStorage::doesKeyExist(const Name& keyName) |
| 54 | { |
| 55 | #if 1 |
| 56 | throw std::runtime_error("MemoryIdentityStorage::doesKeyExist not implemented"); |
| 57 | #endif |
| 58 | } |
| 59 | |
| 60 | Name |
| 61 | MemoryIdentityStorage::getKeyNameForCertificate(const Name& certificateName) |
| 62 | { |
| 63 | int i = certificateName.getComponentCount() - 1; |
| 64 | |
| 65 | for (; i >= 0; --i) { |
| 66 | if(certificateName.getComponent(i).toEscapedString() == string("ID-CERT")) |
| 67 | break; |
| 68 | } |
| 69 | |
| 70 | return certificateName.getSubName(0, i); |
| 71 | } |
| 72 | |
| 73 | void |
| 74 | MemoryIdentityStorage::addKey(const Name& keyName, KeyType keyType, Blob& publicKeyDer) |
| 75 | { |
| 76 | #if 1 |
| 77 | throw std::runtime_error("MemoryIdentityStorage::addKey not implemented"); |
| 78 | #endif |
| 79 | } |
| 80 | |
| 81 | Blob |
| 82 | MemoryIdentityStorage::getKey(const Name& keyName) |
| 83 | { |
| 84 | #if 1 |
| 85 | throw std::runtime_error("MemoryIdentityStorage::getKey not implemented"); |
| 86 | #endif |
| 87 | } |
| 88 | |
| 89 | void |
| 90 | MemoryIdentityStorage::activateKey(const Name& keyName) |
| 91 | { |
| 92 | #if 1 |
| 93 | throw std::runtime_error("MemoryIdentityStorage::activateKey not implemented"); |
| 94 | #endif |
| 95 | } |
| 96 | |
| 97 | void |
| 98 | MemoryIdentityStorage::deactivateKey(const Name& keyName) |
| 99 | { |
| 100 | #if 1 |
| 101 | throw std::runtime_error("MemoryIdentityStorage::deactivateKey not implemented"); |
| 102 | #endif |
| 103 | } |
| 104 | |
| 105 | bool |
| 106 | MemoryIdentityStorage::doesCertificateExist(const Name& certificateName) |
| 107 | { |
| 108 | #if 1 |
| 109 | throw std::runtime_error("MemoryIdentityStorage::doesCertificateExist not implemented"); |
| 110 | #endif |
| 111 | } |
| 112 | |
| 113 | void |
| 114 | MemoryIdentityStorage::addCertificate(const Certificate& certificate) |
| 115 | { |
| 116 | #if 1 |
| 117 | throw std::runtime_error("MemoryIdentityStorage::addCertificate not implemented"); |
| 118 | #endif |
| 119 | } |
| 120 | |
| 121 | ptr_lib::shared_ptr<Data> |
| 122 | MemoryIdentityStorage::getCertificate(const Name &certificateName, bool allowAny) |
| 123 | { |
| 124 | #if 1 |
| 125 | throw std::runtime_error("MemoryIdentityStorage::getCertificate not implemented"); |
| 126 | #endif |
| 127 | } |
| 128 | |
| 129 | Name |
| 130 | MemoryIdentityStorage::getDefaultIdentity() |
| 131 | { |
| 132 | #if 1 |
| 133 | throw std::runtime_error("MemoryIdentityStorage::getDefaultIdentity not implemented"); |
| 134 | #endif |
| 135 | } |
| 136 | |
| 137 | Name |
| 138 | MemoryIdentityStorage::getDefaultKeyNameForIdentity(const Name& identityName) |
| 139 | { |
| 140 | #if 1 |
| 141 | throw std::runtime_error("MemoryIdentityStorage::getDefaultKeyNameForIdentity not implemented"); |
| 142 | #endif |
| 143 | } |
| 144 | |
| 145 | Name |
| 146 | MemoryIdentityStorage::getDefaultCertificateNameForKey(const Name& keyName) |
| 147 | { |
| 148 | #if 1 |
| 149 | throw std::runtime_error("MemoryIdentityStorage::getDefaultCertificateNameForKey not implemented"); |
| 150 | #endif |
| 151 | } |
| 152 | |
| 153 | void |
| 154 | MemoryIdentityStorage::setDefaultIdentity(const Name& identityName) |
| 155 | { |
| 156 | #if 1 |
| 157 | throw std::runtime_error("MemoryIdentityStorage::setDefaultIdentity not implemented"); |
| 158 | #endif |
| 159 | } |
| 160 | |
| 161 | void |
| 162 | MemoryIdentityStorage::setDefaultKeyNameForIdentity(const Name& keyName, const Name& identityName) |
| 163 | { |
| 164 | #if 1 |
| 165 | throw std::runtime_error("MemoryIdentityStorage::setDefaultKeyNameForIdentity not implemented"); |
| 166 | #endif |
| 167 | } |
| 168 | |
| 169 | void |
| 170 | MemoryIdentityStorage::setDefaultCertificateNameForKey(const Name& keyName, const Name& certificateName) |
| 171 | { |
| 172 | #if 1 |
| 173 | throw std::runtime_error("MemoryIdentityStorage::setDefaultCertificateNameForKey not implemented"); |
| 174 | #endif |
| 175 | } |
| 176 | |
| 177 | } |