File: gen-pubcert.sh

package info (click to toggle)
wireless-regdb 2025.10.07-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 388 kB
  • sloc: python: 892; makefile: 151; sh: 38
file content (18 lines) | stat: -rwxr-xr-x 363 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/bin/bash

if [[ $# -ne 3 ]]; then
	echo "Usage: $0 priv-key out-file common-name"
	exit 1
fi

openssl req -new -key "$1" -days 36500 -utf8 -nodes -batch \
	-x509 -outform PEM -out "$2" \
	-config <(cat <<-EOF
		[ req ]
		distinguished_name = req_distinguished_name
		string_mask = utf8only
		prompt = no
		[ req_distinguished_name ]
		commonName = $3
		EOF
	)