Project

General

Profile

CommandValidatorConf » History » Version 5

Yingdi Yu, 03/17/2014 03:40 PM

1 3 Yingdi Yu
# Validator Configuration File Format
2 1 Yingdi Yu
3 3 Yingdi Yu
You can set up a `Validator` via a configuration file. 
4
Next, we will show you how to write a configuration file.
5 1 Yingdi Yu
6 4 Yingdi Yu
The configuration file consists of **`rules`** that will be used in validation.
7
Here is an example of configuration file containing two rules.
8 3 Yingdi Yu
9
    rule
10 1 Yingdi Yu
    {
11 3 Yingdi Yu
      for data
12
      name "Simple Rule"
13
      type self-defined
14
      definition
15 1 Yingdi Yu
      {
16 3 Yingdi Yu
        target
17 1 Yingdi Yu
        {
18 3 Yingdi Yu
          type name
19
          name "/localhost/example"
20
          condition isPrefixOf
21 1 Yingdi Yu
        }
22 3 Yingdi Yu
        signer
23 1 Yingdi Yu
        {
24 3 Yingdi Yu
          type name
25
          rule "/ndn/edu/ucla/KEY/yingdi/ksk-1234/ID-CERT"
26
          condition equal
27 2 Yingdi Yu
        }
28
      }
29
    }
30 3 Yingdi Yu
    rule
31
    {
32
      for data
33
      name "Testbed Validation Rule"
34
      type hierarchical
35
      trust-anchor
36
      {
37
        type file
38
        file-name "testbed-trust-anchor.cert"
39
      }
40 1 Yingdi Yu
    }
41
42 4 Yingdi Yu
Each rule has a unique name (which should be unique in the configuration file), e.g., "Simple Rule", "Testbed Validation Rule".
43 5 Yingdi Yu
The rule name is specified in the property **`name`**. 
44
Each rule must be specified with a usage which is specified in the property **`for`**. 
45
Only two usages can be specified so far: either for data validation (i.e., **`fordata`**) or for interest validation (i.e., **`forinterest`**).
46
Each rule must have
47 1 Yingdi Yu