title: Any way to obtain the EC2 Identity Document private key?
body: <p>Is it possible to obtain the private key used to sign the EC2 Identity Document (<a href="http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-identity-documents.html" rel="nofollow noreferrer">http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-identity-documents.html</a>) from within the instance, or in any other way? Assuming that one signs the Identity Document with this key I'm looking for, the OpenSSL command would be:</p>
  
  <p><code>openssl smime -sign -in document.txt -out document.p7 -outform pem -nodetach -inkey &lt;private_key&gt; -signer AWSpubkey
  </code></p>
  
  <p>Where <code>&lt;private_key&gt;</code> is the key I'm looking for.</p>
  
  <p>I'm trying to determine if someone could potentially forge the PKCS7 signature in <a href="http://169.254.169.254/latest/dynamic/instance-identity/pkcs7" rel="nofollow noreferrer">http://169.254.169.254/latest/dynamic/instance-identity/pkcs7</a> by creating a <code>document.txt</code> and signing it with the private key.</p>
  
  <p>Thanks.</p>