Jeff Thompson | 3f3cfd3 | 2013-09-27 11:46:52 -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: Yingdi Yu <yingdi@cs.ucla.edu> |
| 5 | * @author: Jeff Thompson <jefft0@remap.ucla.edu> |
| 6 | * See COPYING for copyright and distribution information. |
| 7 | */ |
| 8 | |
Yingdi Yu | 4f32463 | 2014-01-15 18:10:03 -0800 | [diff] [blame] | 9 | #ifndef NDN_SEC_POLICY_NO_VERIFY_HPP |
| 10 | #define NDN_SEC_POLICY_NO_VERIFY_HPP |
Jeff Thompson | 3f3cfd3 | 2013-09-27 11:46:52 -0700 | [diff] [blame] | 11 | |
Yingdi Yu | 4f32463 | 2014-01-15 18:10:03 -0800 | [diff] [blame] | 12 | #include "sec-policy.hpp" |
Jeff Thompson | 3f3cfd3 | 2013-09-27 11:46:52 -0700 | [diff] [blame] | 13 | |
| 14 | namespace ndn { |
| 15 | |
Yingdi Yu | 4f32463 | 2014-01-15 18:10:03 -0800 | [diff] [blame] | 16 | class SecPolicyNoVerify : public SecPolicy { |
Jeff Thompson | 3f3cfd3 | 2013-09-27 11:46:52 -0700 | [diff] [blame] | 17 | public: |
| 18 | /** |
| 19 | * The virtual destructor. |
| 20 | */ |
| 21 | virtual |
Yingdi Yu | 4f32463 | 2014-01-15 18:10:03 -0800 | [diff] [blame] | 22 | ~SecPolicyNoVerify(); |
Jeff Thompson | 3f3cfd3 | 2013-09-27 11:46:52 -0700 | [diff] [blame] | 23 | |
| 24 | /** |
Yingdi Yu | e07e339 | 2014-01-28 10:29:27 -0800 | [diff] [blame] | 25 | * Check whether the received data packet complies with the verification policy, and get the indication of the next verification step. |
| 26 | * If there is no next verification step, that imlies policy MUST have already made the verification decision. |
| 27 | * i.e., either onVerified or onVerifyFailed callback is invoked. |
Jeff Thompson | 3f3cfd3 | 2013-09-27 11:46:52 -0700 | [diff] [blame] | 28 | * @param data The Data object with the signature to check. |
| 29 | * @param stepCount The number of verification steps that have been done, used to track the verification progress. |
Yingdi Yu | e07e339 | 2014-01-28 10:29:27 -0800 | [diff] [blame] | 30 | * @param onVerified If the signature is verified, this calls onVerified(data). |
| 31 | * @param onVerifyFailed If the signature check fails, this calls onVerifyFailed(data). |
| 32 | * @return the indication of next verification step, null if there is no further step. |
Jeff Thompson | 3f3cfd3 | 2013-09-27 11:46:52 -0700 | [diff] [blame] | 33 | */ |
| 34 | virtual ptr_lib::shared_ptr<ValidationRequest> |
| 35 | checkVerificationPolicy |
Yingdi Yu | 4270f20 | 2014-01-28 14:19:16 -0800 | [diff] [blame] | 36 | (const ptr_lib::shared_ptr<const Data>& data, int stepCount, const OnVerified& onVerified, const OnVerifyFailed& onVerifyFailed); |
Yingdi Yu | e07e339 | 2014-01-28 10:29:27 -0800 | [diff] [blame] | 37 | |
Jeff Thompson | 3f3cfd3 | 2013-09-27 11:46:52 -0700 | [diff] [blame] | 38 | /** |
Yingdi Yu | e07e339 | 2014-01-28 10:29:27 -0800 | [diff] [blame] | 39 | * Check whether the received interest packet complies with the verification policy, and get the indication of the next verification step. |
| 40 | * If there is no next verification step, that implies policy MUST have already made the verification decision. |
| 41 | * i.e., either onVerified or onVerifyFailed callback is invoked. |
| 42 | * @param data The Data object with the signature to check. |
| 43 | * @param stepCount The number of verification steps that have been done, used to track the verification progress. |
| 44 | * @param onVerified If the signature is verified, this calls onVerified(data). |
| 45 | * @param onVerifyFailed If the signature check fails, this calls onVerifyFailed(data). |
| 46 | * @return the indication of next verification step, null if there is no further step. |
Jeff Thompson | 3f3cfd3 | 2013-09-27 11:46:52 -0700 | [diff] [blame] | 47 | */ |
Yingdi Yu | e07e339 | 2014-01-28 10:29:27 -0800 | [diff] [blame] | 48 | virtual ptr_lib::shared_ptr<ValidationRequest> |
| 49 | checkVerificationPolicy |
Yingdi Yu | 4270f20 | 2014-01-28 14:19:16 -0800 | [diff] [blame] | 50 | (const ptr_lib::shared_ptr<const Interest>& interest, int stepCount, const OnVerified& onVerified, const OnVerifyFailed& onVerifyFailed); |
Jeff Thompson | 3f3cfd3 | 2013-09-27 11:46:52 -0700 | [diff] [blame] | 51 | }; |
| 52 | |
| 53 | } |
| 54 | |
| 55 | #endif |