File: create-private-keys.sh

package info (click to toggle)
python-googleapi 1.5.0-2~bpo8%2B1
  • links: PTS
  • area: main
  • in suites: jessie-backports
  • size: 28,336 kB
  • sloc: python: 6,808; makefile: 64; sh: 53; xml: 5
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