Skip to content

Instantly share code, notes, and snippets.

@maxmanders
Created November 23, 2012 14:46
Show Gist options
  • Save maxmanders/4135953 to your computer and use it in GitHub Desktop.
Save maxmanders/4135953 to your computer and use it in GitHub Desktop.
Generate AWS IAM Certificate
#!/bin/bash
outdir=$1
if [ -z "${outdir}" ]; then
outdir=/tmp/
fi
cd ${outdir}
openssl genrsa -out pk-amazon.pem 2048
openssl req -new -x509 -key pk-amazon.pem -out cert-amazon.pem -days 3650
openssl pkcs8 -topk8 -in pk-amazon.pem -nocrypt > pk-temp.pem
mv pk-temp.pem pk-amazon.pem
cat cert-amazon.pem | pbcopy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment