blob: 59dd6150c2a1ca9eb2ee81f27c337a00e276df05 [file] [log] [blame]
Jeff Thompson3f3cfd32013-09-27 11:46:52 -07001/* -*- 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 Yu4f324632014-01-15 18:10:03 -08009#ifndef NDN_SEC_POLICY_NO_VERIFY_HPP
10#define NDN_SEC_POLICY_NO_VERIFY_HPP
Jeff Thompson3f3cfd32013-09-27 11:46:52 -070011
Yingdi Yu4f324632014-01-15 18:10:03 -080012#include "sec-policy.hpp"
Jeff Thompson3f3cfd32013-09-27 11:46:52 -070013
14namespace ndn {
15
Yingdi Yu4f324632014-01-15 18:10:03 -080016class SecPolicyNoVerify : public SecPolicy {
Jeff Thompson3f3cfd32013-09-27 11:46:52 -070017public:
18 /**
19 * The virtual destructor.
20 */
21 virtual
Yingdi Yu4f324632014-01-15 18:10:03 -080022 ~SecPolicyNoVerify();
Jeff Thompson3f3cfd32013-09-27 11:46:52 -070023
24 /**
Yingdi Yue07e3392014-01-28 10:29:27 -080025 * 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 Thompson3f3cfd32013-09-27 11:46:52 -070028 * @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 Yue07e3392014-01-28 10:29:27 -080030 * @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 Thompson3f3cfd32013-09-27 11:46:52 -070033 */
34 virtual ptr_lib::shared_ptr<ValidationRequest>
35 checkVerificationPolicy
Yingdi Yu4270f202014-01-28 14:19:16 -080036 (const ptr_lib::shared_ptr<const Data>& data, int stepCount, const OnVerified& onVerified, const OnVerifyFailed& onVerifyFailed);
Yingdi Yue07e3392014-01-28 10:29:27 -080037
Jeff Thompson3f3cfd32013-09-27 11:46:52 -070038 /**
Yingdi Yue07e3392014-01-28 10:29:27 -080039 * 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 Thompson3f3cfd32013-09-27 11:46:52 -070047 */
Yingdi Yue07e3392014-01-28 10:29:27 -080048 virtual ptr_lib::shared_ptr<ValidationRequest>
49 checkVerificationPolicy
Yingdi Yu4270f202014-01-28 14:19:16 -080050 (const ptr_lib::shared_ptr<const Interest>& interest, int stepCount, const OnVerified& onVerified, const OnVerifyFailed& onVerifyFailed);
Jeff Thompson3f3cfd32013-09-27 11:46:52 -070051};
52
53}
54
55#endif