source: internals/2016/linuxloginsmartcardwizard/trunk/project1/main.py @ 16327

Last change on this file since 16327 was 16327, checked in by dcorreia, 3 years ago

Added main.py to manage calls to config modules.
Added tests.py to manage tests.

File size: 1.2 KB
Line 
1#!/usr/bin/python3
2import configpkcs11
3
4PAMPKCS11_PACKAGE = "libpam-pkcs11"
5PAMPKCS11_DIRPATH = "/etc/pampkcs11"
6CACERTS_DIRPATH = "/etc/pampkcs11/cacerts"
7CRLS_DIRPATH = "/etc/pampkcs11/crls"
8ECRAIZ_CERT = "/usr/local/share/certs/ECRaizEstado_novo_assinado_GTE.der"
9CC001_CERT = "/usr/local/share/certs/CartaodeCidadao001.der"
10CC_CRL_HTTP = "https://pki.cartaodecidadao.pt/publico/lrc/cc_ec_cidadao_crl001_crl.crl"
11
12
13# Install PKCS#11 module for PAM
14configpkcs11.installPackage(PAMPKCS11_PACKAGE)
15
16# Create directories to support configuration files
17configpkcs11.makeDirectory(PAMPKCS11_DIRPATH)
18configpkcs11.makeDirectory(CACERTS_DIRPATH)
19configpkcs11.makeDirectory(CRLS_DIRPATH)
20
21# TODO Copy certificate files to cacerts directory and make hash links
22configpkcs11.copyFileToDirectory(ECRAIZ_CERT, CACERTS_DIRPATH)
23configpkcs11.copyFileToDirectory(CC001_CERT, CACERTS_DIRPATH)
24configpkcs11.makeHashLinks(CACERTS_DIRPATH)
25
26
27# TODO Get crl file from web link
28configpkcs11.getCRLFile(CC_CRL_HTTP, CRLS_DIRPATH)
29
30# TODO Generate pam_pkcs11.conf file
31
32
33# TODO Add portuguese CC module to pam_pkcs11.conf file
34
35
36# TODO Change pkcs11 module to be used in pam_pkcs11.conf file
37
38
39# TODO Test this phase of configuration by running pkcs11_inspect
40
Note: See TracBrowser for help on using the repository browser.