blob: 1ee9f75070ee667c9bc121567b0164efaaca9ec7 [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
9#ifndef NDN_NO_VERIFY_POLICY_MANAGER_HPP
Jeff Thompsone589c3f2013-10-12 17:30:50 -070010#define NDN_NO_VERIFY_POLICY_MANAGER_HPP
Jeff Thompson3f3cfd32013-09-27 11:46:52 -070011
12#include "policy-manager.hpp"
13
14namespace ndn {
15
16class NoVerifyPolicyManager : public PolicyManager {
17public:
18 /**
19 * The virtual destructor.
20 */
21 virtual
22 ~NoVerifyPolicyManager();
23
24 /**
25 * Override to always skip verification and trust as valid.
26 * @param data The received data packet.
27 * @return true.
28 */
29 virtual bool
30 skipVerifyAndTrust(const Data& data);
31
32 /**
33 * Override to return false for no verification rule for the received data.
34 * @param data The received data packet.
35 * @return false.
36 */
37 virtual bool
38 requireVerify(const Data& data);
39
40 /**
41 * Override to call onVerified(data) and to indicate no further verification step.
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 This does override to call onVerified(data).
45 * @param onVerifyFailed Override to ignore this.
46 * @return null for no further step.
47 */
48 virtual ptr_lib::shared_ptr<ValidationRequest>
49 checkVerificationPolicy
Jeff Thompson31aeed82013-11-25 15:44:45 -080050 (const ptr_lib::shared_ptr<Data>& data, int stepCount, const OnVerified& onVerified, const OnVerifyFailed& onVerifyFailed);
Jeff Thompson3f3cfd32013-09-27 11:46:52 -070051
52 /**
53 * Override to always indicate that the signing certificate name and data name satisfy the signing policy.
54 * @param dataName The name of data to be signed.
55 * @param certificateName The name of signing certificate.
56 * @return true to indicate that the signing certificate can be used to sign the data.
57 */
58 virtual bool
59 checkSigningPolicy(const Name& dataName, const Name& certificateName);
60
61 /**
62 * Override to indicate that the signing identity cannot be inferred.
63 * @param dataName The name of data to be signed.
64 * @return An empty name because cannot infer.
65 */
66 virtual Name
67 inferSigningIdentity(const Name& dataName);
68};
69
70}
71
72#endif