Skip to content

Commit 7cd02fe

Browse files
committed
Updating wolfCLU docs
1 parent 3f898ba commit 7cd02fe

File tree

14 files changed

+140
-20
lines changed

14 files changed

+140
-20
lines changed

wolfCLU/create-pdf.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/bash
2+
3+
pandoc -s header.txt src/Intro.md src/build.md src/command_list.md src/bench.md src/ca.md src/crl.md src/dsaparam.md src/dhparam.md src/dgst.md src/ecparam.md src/enc.md src/genkey.md src/hash.md src/md5.md src/sha.md src/pkcs12.md src/pkey.md src/rand.md src/req.md src/rsa.md src/s_client.md src/verify.md src/x509.md --toc -o wolfCLU_Manual.pdf

wolfCLU/src/build.md

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
## Building wolfCLU
2+
3+
### Building on *NIX
24
To build wolfCLU first build wolfSSL with the --enable-wolfclu flag. An example of this would be:
35

46
```
@@ -26,4 +28,38 @@ cd wolfclu
2628
./configure --with-wolfssl=/path/to/wolfssl/install
2729
make
2830
sudo make install
29-
```
31+
```
32+
33+
Run `make check` to run unit tests.
34+
35+
## Building on Windows
36+
37+
wolfCLU can also be built with its Visual Studios solution, wolfclu.sln. The solution provides both Debug and Release builds of Dynamic 32- or 64-bit libraries. The file `user_settings.h` should be used in the wolfSSL build to configure it.
38+
39+
The file `wolfclu\ide\winvs\user_settings.h` contains the settings used to configure wolfSSL with the appropriate settings. This file must be copied from the directory `wolfclu\ide\winvs` to `wolfssl\IDE\WIN`. You can then build wolfSSL with support for wolfCLU.
40+
41+
Before building wolfCLU, Make sure you have the same architecture (Win32 or x64) selected as used in wolfSSL.
42+
43+
This project assumes that the wolfSSH and wolfSSL source directories
44+
are installed side-by-side and do not have the version number in their
45+
names:
46+
```
47+
Projects\
48+
wolfclu\
49+
wolfssl\
50+
```
51+
52+
Building wolfCLU a release configuration will generate `wolfssl.exe` in the
53+
`Release\Win32` or `Release\x64` directory.
54+
55+
#### Running Unit Tests
56+
57+
To run the shell-script unit tests, you will need either the `sh` or `bash`
58+
commands, both of which come with a Git installation on Windows (although you
59+
may have to add them to the PATH).
60+
61+
1. Copy the `wolfssl.exe` to the root directory of wolfclu.
62+
2. Modify the `run` function (as well as `run_fail`, if present) of the desired
63+
unit test to run `./wolfssl.exe $1` instead of `./wolfssl $1`.
64+
3. In your terminal, run `sh <desired_unit_test>` from the root directory. For
65+
instance, to run the hash unit tests, run `sh tests\hash\hash-test.sh`.

wolfCLU/src/ca.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
### CA Command
2+
Used for signing Certificates. Can handle some basic config file parsing.
3+
4+
Available arguments are:
5+
6+
- [-in] input CSR file
7+
- [-out] file to write to
8+
- [-keyfile] file to read private key from
9+
- [-cert] file to read CA from
10+
- [-extensions] section in config file to parse extensions from
11+
- [-md] type of hash to use i.e sha, sha256, ...
12+
- [-inform] PEM/DER type of CSR input
13+
- [-config] file to parse for configuration
14+
- [-days] number of days should be valid for
15+
- [-selfsign] sign with key associated with input cert
16+
17+
Example:
18+
19+
```
20+
wolfssl ca -config ca.conf -in test.csr -out test.pem -md sha256 -selfsign -keyfile ./key
21+
```

wolfCLU/src/command_list.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
## List Of Commands:
22
- bench
3+
- ca
34
- crl
5+
- dsaparam
46
- dgst
57
- ecparam
68
- enc
@@ -15,3 +17,7 @@
1517
- s_client
1618
- verify
1719
- x509
20+
- dhparam
21+
- sha256
22+
- sha384
23+
- sha512

wolfCLU/src/dgst.md

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,26 @@ Hash algos supported:
99
- [-sha384]
1010
- [-sha512]
1111

12+
**Sign**
13+
14+
Parameters:
15+
16+
- [-sign] key used to create signature
17+
- [-out] file to write signature to
18+
19+
Example:
20+
```
21+
wolfssl dgst -sign keyPrivate.pem -out test.sig testfile
22+
```
23+
24+
**Verify**
25+
1226
Parameters:
1327

14-
- [-signature] file containing the signature
1528
- [-verify] key used to verify the signature
29+
- [-signature] file containing the signature
1630

1731
Example:
1832
```
19-
wolfssl dgst -signature test.sig -verify key.pem test
20-
```
33+
wolfssl dgst -verify keyPublic.pem -signature test.sig testfile
34+
```

wolfCLU/src/dhparam.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
### DHPARAM Command
2+
3+
Used for creating Diffie Hellman params and keys.
4+
5+
Available arguments are:
6+
7+
- [-genkey] create new DH key
8+
- [-in] file to read params from to create a key
9+
- [-out] file to output to (default stdout)
10+
- [-check] check if generated parameters are valid
11+
- [-noout] do not print out the params
12+
13+
Example:
14+
15+
```
16+
wolfssl dhparam -check -out dh.params 1024

wolfCLU/src/dsaparam.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
### DSAPARAM Command
2+
3+
Used for creating DSA params and keys. Make sure wolfSSL is compiled with `--enable-dsa`.
4+
5+
Available arguments are:
6+
7+
- [-genkey] create new DSA key
8+
- [-in] file to read params from to create a key
9+
- [-out] file to output to (default stdout)
10+
- [-noout] do not print out the params
11+
12+
Example:
13+
14+
```
15+
wolfssl dsaparam -out dsa.params 1024
16+
wolfssl dsaparam -in dsa.params -genkey
17+
```

wolfCLU/src/genkey.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
11
### GENKEY Command
2-
Used to generate RSA, ECC, and ED25519 keys. If using "-output KEY" a private key is created having .priv appended to -out argument and a public key is created with .pub appended to the -out argument. If generating ED25519 keys compile wolfSSL with --enable-ed25519.
2+
Used to generate RSA, ECC, ED25519 and DSA keys. If using "-output KEY" a private key is created having .priv appended to -out argument and a public key is created with .pub appended to the -out argument. If generating ED25519 keys compile wolfSSL with --enable-ed25519.
33

44
Available arguments are:
55

66
- [-out] file to write to
77
- [rsa | ecc | ed25519] key type to generate
88
- [-inkey] input file for key
99
- [-size] size of key to generate
10-
- [-outform] output form, either DER or PEM
10+
- [-outform] output form, either DER or PEM (defaults to DER)
11+
- [-output] key to generate, either PUB, PRIV or KEYPAIR (defaults to KEYPAIR)
1112
- [-exponent] RSA exponent size
1213

1314
Example:
1415

1516
```
16-
wolfssl genkey rsa -size 2048 -out mykey -outform pem -output KEY
17-
```
17+
wolfssl genkey rsa -size 2048 -out mykey -outform pem -output KEYPAIR
18+
```

wolfCLU/src/pkey.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
Used for dealing with generic key operations. Prints the key read in to stdout.
33

44
- [-in] file input for key
5-
- [-inform] pem or der input format
5+
- [-inform] pem or der input format (defaults to pem)
66
- [-pubout] only print out the public key
7-
7+
- [-pubin] expect to public key as input
88

99
Example:
1010

1111
```
1212
./wolfssl pkey -in ./certs/server-key.pem -inform pem -pubout
13-
```
13+
```

wolfCLU/src/req.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ Available arguments are:
66
- [-in] input file to read from
77
- [-out] file to write to (default stdout)
88
- [-key] public key to put into certificate request
9-
- [-inform] der or pem format for '-in'
10-
- [-outform] der or pem format for '-out'
9+
- [-inform] der or pem format for '-in' (defaults to pem)
10+
- [-outform] der or pem format for '-out' (defaults to pem)
1111
- [-config] file to parse for certificate configuration
1212
- [-days] number of days should be valid for
1313
- [-x509] generate self signed certificate
@@ -18,4 +18,4 @@ Example:
1818
wolfssl ecparam -genkey -out ecc.key -name secp384r1
1919
wolfssl req -new -x509 -days 3650 -config selfsigned.conf -key ecc.key -out ecc.cert \
2020
-outform der -sha256
21-
```
21+
```

0 commit comments

Comments
 (0)