File: create-private-keys.sh

package info (click to toggle)
python-googleapi 2.182.0-1
  • links: PTS
  • area: main
  • in suites: forky, sid
  • size: 533,852 kB
  • sloc: python: 11,076; javascript: 249; sh: 114; makefile: 59
file content (13 lines) | stat: -rwxr-xr-x 402 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
#!/bin/bash

openssl req -new -newkey rsa:2048 -days 3650 -nodes -x509 \
  -keyout privatekey.pem -out publickey.pem \
  -subj "/CN=unit-tests"

openssl pkcs12 -export -out privatekey.p12 \
  -inkey privatekey.pem -in publickey.pem \
  -name "key" -passout pass:notasecret

openssl pkcs12 -in privatekey.p12 \
  -nodes -nocerts -passout pass:notasecret \
  -passin pass:notasecret > pem_from_pkcs12.pem