Skip to content

Commit

Permalink
Added O and L to fake issuer
Browse files Browse the repository at this point in the history
  • Loading branch information
reinkrul committed Nov 13, 2024
1 parent d470876 commit 650ad71
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion test_ca/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
To issue a new fake UZI certificate, you can use the following command:

```bash
./issue-cert.sh <domain> <uzi> <ura> <agb>
./issue-cert.sh <domain (CN)> <name (O)> <locality (L)> <uzi> <ura> <agb>
```

You can then use the credential issuance tool (given you've run `go build .` in the parent directory) to generate a Verifiable Credential:
Expand Down
12 changes: 7 additions & 5 deletions test_ca/issue-cert.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,18 @@ fi

mkdir out
HOST=$1
UZI=$2
URA=$3
AGB=$4
X509_O=$2
X509_L=$3
UZI=$4
URA=$5
AGB=$6
echo Generating key and certificate for $HOST
openssl genrsa -out out/$HOST.key 2048
openssl req -new -key out/$HOST.key -out $HOST.csr -subj "${DN_PREFIX}CN=${HOST}/serialNumber=${UZI}"
openssl req -new -key out/$HOST.key -out $HOST.csr -subj "${DN_PREFIX}CN=${HOST}/O=${X509_O}/L=${X509_L}/serialNumber=${UZI}"

local_openssl_config="
extendedKeyUsage = serverAuth, clientAuth
subjectAltName = DNS:${HOST}, otherName:2.5.5.5;UTF8:2.16.528.1.1007.99.2110-1-${UZI}-S-${URA}-00.000-${AGB}
subjectAltName = otherName:2.5.5.5;UTF8:2.16.528.1.1007.99.2110-1-${UZI}-S-${URA}-00.000-${AGB}
"
cat <<< "$local_openssl_config" > node.ext
openssl x509 -req -in $HOST.csr -CA ca.pem -CAkey ca.key -CAcreateserial -out out/$HOST.pem -days 365 -sha256 \
Expand Down

0 comments on commit 650ad71

Please sign in to comment.