Created
January 29, 2014 06:54
-
-
Save boltronics/8683091 to your computer and use it in GitHub Desktop.
User Signing Certificates for AWS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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