Skip to content

Instantly share code, notes, and snippets.

@boltronics
Created January 29, 2014 06:54
Show Gist options
  • Save boltronics/8683091 to your computer and use it in GitHub Desktop.
Save boltronics/8683091 to your computer and use it in GitHub Desktop.
User Signing Certificates for AWS
#!/bin/bash
# Based in instructions here:
# http://docs.aws.amazon.com/IAM/latest/UserGuide/ManagingUserCerts.html
declare -ri key_size=2048
declare -ri days=365
openssl genrsa ${key_size} > private-key.pem
openssl pkcs8 -topk8 -nocrypt -inform PEM -in private-key.pem \
-out private-key-in-PCKS8-format.pem
echo -e '\n\n\n\n\n\n' | openssl req -new -x509 -nodes -sha1 \
-days ${days} -key private-key.pem -outform PEM \
>certificate.pem 2>/dev/null
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment