EC2 not working on a mac

Posted on 2011-10-27
Last Modified: 2012-05-12
I followed the this link but am unable to connect via the command line.

Here's the error and the .bash_profile

export EC2_HOME=~/.ec2
export PATH=$PATH:$EC2_HOME/bin
export EC2_PRIVATE_KEY=`ls $EC2_HOME/pk-*.pem`
export EC2_CERT=`ls $EC2_HOME/cert-*.pem`
export JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Home/

org.codehaus.xfire.fault.XFireFault: Signature creation failed; nested exception is: java.lang.ClassCastException: org.bouncycastle.asn1.DERSequence cannot be cast to org.bouncycastle.asn1.DERInteger
      at org.codehaus.xfire.fault.XFireFault.createFault(
      at org.codehaus.xfire.client.Invocation.invoke(
      at org.codehaus.xfire.client.Invocation.invoke(
      at org.codehaus.xfire.client.Client.invoke(
      at org.codehaus.xfire.client.XFireProxy.handleRequest(
      at org.codehaus.xfire.client.XFireProxy.invoke(
      at $Proxy12.describeImages(Unknown Source)
Caused by: Signature creation failed; nested exception is: java.lang.ClassCastException: org.bouncycastle.asn1.DERSequence cannot be cast to org.bouncycastle.asn1.DERInteger

Question by:timz955
    LVL 15

    Expert Comment

    At what step in the instructions are you getting the error?

    What version of OS X?

    Author Comment

    When I run any EC2 console command.
    LVL 13

    Expert Comment


    I think you need to have valid certificate. You can check this using your Keychain whether the cert install successfully or not.

    Apple is so picky with cert, so make sure that you have valid one.
    LVL 9

    Accepted Solution

    I suggest you stick to the official guide line, rather than a user experience:

    Nevertheless what you describe definitely is an certificate issue, caused by your certificate being private rather than public, for more information on this issue see:

    I am asking, because I can provoke the same behaviour with this command:
    ec2dim -K cert-XXX.pem -C cert-XXX.pem

    Open in new window

    It works with this:
    ec2dim -K pk-XXXpem -C cert-YYY.pem

    Open in new window

    Another post in the official forums which exactly handles your issue can be found here:
    That should fix your problems.

    Featured Post

    Make managing Office 365 email signatures a breeze

    Are you using Office 365? Having trouble trying to set up email signatures for your users? Getting stressed out managing multiple signatures? Need an easier way to manage? We have a solution for you, try the most-user friendly and powerful signature management tool on the market.

    Join & Write a Comment

    As a financial services provider, your business is impacted by two of the strictest federal regulations on record: the Sarbanes-Oxley Act and the Gramm-Leach-Bliley Act. Correctly implementing faxing into your organization to provide secure, real-ti…
    Moving your enterprise fax infrastructure from in-house fax machines and servers to the cloud makes sense — from both an efficiency and productivity standpoint. But does migrating to a cloud fax solution mean you will no longer be able to send or re…
    Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
    Internet Business Fax to Email Made Easy - With eFax Corporate (, you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

    728 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now