| /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */ |
| * Copyright (C) 2013 Regents of the University of California. |
| * @author: Jeff Thompson <jefft0@remap.ucla.edu> |
| * See COPYING for copyright and distribution information. |
| #ifndef NDN_SIGNATURE_SHA256_WITH_RSA_HPP |
| #define NDN_SIGNATURE_SHA256_WITH_RSA_HPP |
| #include "../../data.hpp" |
| * Representing of SHA256-with-RSA signature in a data packet. |
| class SignatureSha256WithRsa : public Signature { |
| info_ = Block(Tlv::SignatureInfo); |
| type_ = Signature::Sha256WithRsa; |
| info_.push_back(nonNegativeIntegerBlock(Tlv::SignatureType, Tlv::SignatureSha256WithRsa)); |
| SignatureSha256WithRsa(const Signature &signature) |
| if (getType() != Signature::Sha256WithRsa) |
| throw Signature::Error("Incorrect signature type"); |
| Block::element_iterator i = info_.find(Tlv::KeyLocator); |
| if (i != info_.getAll().end()) |
| keyLocator_.wireDecode(*i); |
| setKeyLocator(const KeyLocator& keyLocator) |
| keyLocator_ = keyLocator; |
| /// @todo Ensure that keylocator does not exist |
| info_.push_back(keyLocator_.wireEncode()); |