aboutsummaryrefslogtreecommitdiffhomepage
path: root/examples/fips_iut_demo.py
blob: f19f16e8775bbf9f51ef9a22984e8fd2dca3feda (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/usr/bin/env python3

import click

from sec_certs.dataset.fips_iut import IUTDataset


@click.command()
@click.argument("directory", type=click.Path(exists=True, file_okay=False))
@click.argument("output", type=click.Path(dir_okay=False, writable=True))
def main(directory, output):
    """
    Parse FIPS 'Implementation Under Test' pages.

    \b
    To use, download pages from the URL:
    https://csrc.nist.gov/Projects/cryptographic-module-validation-program/modules-in-process/IUT-List
    into a directory `d` and name them `fips_iut_<iso-timestamp>.html`.

    \b
    Then run:
      in_process.py fips-iut d output.json
    to obtain the parsed output in `output.json`.
    """
    dataset = IUTDataset.from_dumps(directory)
    dataset.to_json(output)


if __name__ == "__main__":
    main()