Debian Codegraph @

example/client-brski/README

raw
1 This directory contains a test EST client BRSKI application. This example
2 code shows how the BRSKI APIs can be used. This application assumes that
3 libEST code base has been built with BRSKI support by adding -enable-brski
4 to the ./configure operation. This README assumes the EST server is listening
5 on the local host using port 8085. The EST process works as follows:
6
7 - First, the BRSKI support enabled and configures by
8 calling est_client_brski_mode()
9 - Next, est_client_brski_get_voucher() is invoked to obtain
10 the BRSKI voucher from the server.
11 - The BRSKI voucher contains the trust anchor to be used and
12 to obtain this voucher, est_client_brski_copy_voucher() is
13 invoked.
14 - Next, est_client_brski_send_voucher_status() is called to
15 indicate that this voucher has been retrieved and is going to be
16 used.
17 - At this point, a normal EST enroll process is performed.
18 - Once the certificate is obtained from the enroll process,
19 est_client_brski_send_enroll_status() is called to indicate
20 that this certificate has been obtained and will now be used.
21
22
23 To run the example:
24
25 1. Set LD_LIBRARY_PATH to include the directories where libest.so
26 and libcrypto.so are installed. For example...
27
28 export LD_LIBRARY_PATH=/usr/local/ssl/lib:/usr/local/est/lib
29
30 2. Set the following environment variable to specify the location
31 of the file containing the CA certificates used for verifying
32 the server. In this example we use the trusted certs for
33 the example EST server:
34
35 export EST_OPENSSL_CACERT=../server/estCA/cacert.crt
36
37 PDB NOTE: This can likely be removed since the first request of
38 the request voucher will obtain the CA certificate. The first
39 connection will need to be overridden by this application layer
40 code.
41
42 3. Connect to the EST server listening on port 8085 and request to
43 bootstrap. The example EST server uses the user ID and
44 password estuser/estpwd:
45
46 ./estclient_brski -s 127.0.0.1 -p 8085 -u estuser -h estpwd
47
48 Note: The user ID and password are hard-coded in this example.
49 There is currently no way to change the user ID presented
50 to the EST server.
51
52 After successfully provisioning a new certificate, the following
53 files are generated in the current working directory:
54
55 newcacerts.pkcs7 This file contains the latest copy of
56 the CA certifications from the EST server.
57 cert-b64.pkcs7 This file contains the newly provisioned
58 certificate.
59 new_key.pem This file contains the new keypair that
60 was generated when creating the certificate
61 request. This contains the private key that
62 matches the public key in the new cert.
63
64 Use this command to view the new CA certs returned by the server:
65
66 openssl base64 -d -in ./newcacerts.pkcs7 | \
67 openssl pkcs7 -inform DER -text -print_certs
68
69 Use this command to view the new certificate from the server:
70
71 openssl base64 -d -in ./cert-b64.pkcs7 | \
72 openssl pkcs7 -inform DER -text -print_certs
73