aws / rolesanywhere-credential-helper

Apache License 2.0
128 stars 38 forks source link

Unable to parse private key #68

Closed David-Jacobsen closed 7 months ago

David-Jacobsen commented 7 months ago

I'm trying to use the aws_signing_helper to figure out what I'm doing wrong when I manually sign an AWS request with my X509 cert.

I have downloaded the source code and built the project on my mac. When trying to call it similar to:

./aws_signing_helper credential-process --certificate ./certificate.pem --private-key ./private_key.txt --profile-arn arn:aws:rolesanywhere:us-east-1:... --role-arn arn:aws:iam::... --trust-anchor-arn arn:aws:rolesanywhere:us-east-1:...

I am getting the error: unable to parse private key.

The certificate.pem and private_key.txt were generated in AWS Certificate Manager and downloaded from there. I assume I am doing something wrong as the private_key is encrypted and there is no parameter to pass in a password, but I'm not sure what the correct process is.

David-Jacobsen commented 7 months ago

Obvious in hindsight, but I needed to decrypt the private key. Can be done with openssl...

openssl rsa -in EncryptedKey.key -out DecryptedKey.key