title: How to sign an saml 2.0 assertion using the openssl (.PCKS8) file
body: <p>Hi i need some infomation on saml 2.0 Authn Request . I want to sign my authn request with a openssl created *.pkcs8 file. I can do with a keystore file using java keytool . But I want to achieve the same using *.PKCS8 file generateing using the openssl. I have been struggling with this for some time . I am able to generate the xml with it .</p>
  
  <p>// Authn Request ...</p>
  
  <pre><code>&lt;samlp:AuthnRequest xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol" AssertionConsumerServiceURL="http://localhost:8080/sp/AssertionConsumerService" Destination="http://localhost:8080/idp/SingleSignOnService" ID="95cc3943-67dd-43ef-809b-2ccd8bd3e4e9" IssueInstant="2013-04-26T12:18:48.799Z" Version="2.0"&gt;
    &lt;saml:Issuer xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion" Format="urn:oasis:names:tc:SAML:2.0:nameid-format:entity"&gt;sp&lt;/saml:Issuer&gt;
    &lt;ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#"&gt;
      &lt;ds:SignedInfo&gt;
        &lt;ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/&gt;
        &lt;ds:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/&gt;
        &lt;ds:Reference URI="#95cc3943-67dd-43ef-809b-2ccd8bd3e4e9"&gt;
          &lt;ds:Transforms&gt;
            &lt;ds:Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"/&gt;
            &lt;ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"&gt;
              &lt;ec:InclusiveNamespaces xmlns:ec="http://www.w3.org/2001/10/xml-exc-c14n#" 
                PrefixList="ds saml samlp"/&gt;
             &lt;/ds:Transform&gt;
          &lt;/ds:Transforms&gt;
          &lt;ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/&gt;
          &lt;ds:DigestValue&gt;2HkVe/KnVzcMgneRUItjq2V/FEA=&lt;/ds:DigestValue&gt;
         &lt;/ds:Reference&gt;
      &lt;/ds:SignedInfo&gt;
      &lt;ds:SignatureValue&gt;
             NjCxy8R3NjkN8B932FJolGTqtYTBBTLboHUo7ZqEXxICUW/ZhOV2Pwe+c4R0/TrPqBPVZBItlXyv
             at3edIMrr7RlEFGy3rt7pPVRXUcmF6jtDZajCpwwaEKKD--REMOVED SOME CODE------------
             egb8dua65WhY1KkugNPG4FWTVhtzul/CBo9a8vN/ZuXRbZQ6sUWbq1BFgC6Zmw8kr1aUNBwqRi7r
             ZNPXcGVhXuFQTTV4Kuc1eiI1lgANKLTrkCBRSw==
     &lt;/ds:SignatureValue&gt;
    &lt;/ds:Signature&gt;
  &lt;/samlp:AuthnRequest&gt;
  </code></pre>
  
  <p>// END</p>
  
  <p>I am not able to get the keyInfo and x509data and certificate values that i was able to get using the java keytool. </p>
  
  <pre><code>    &lt;ds:KeyInfo&gt;
        &lt;ds:X509Data&gt;
          &lt;ds:X509Certificate&gt;hZB2kOYypWs33Bs2BTaKZOKGig0CAwEAATANBgkqhkiG9w0BAQUFAAOB
           gQB3Cfe0iTfrXY9E22TFy5b87kwpDKjLopNLtX3kqSUlfjnbN5tYN4zr91H5dZUkuFF83z7ztzKi
           zkcxiMgVVQkU2X1bn5SdErvmS7aEcG8+5TdlO5bf+8as04u5qug+oQun5s1t9mSvaF7Ol5CX/gkp
           EUTjXx28kldbY7ETgDUrSw==&lt;/ds:X509Certificate&gt;
        &lt;/ds:X509Data&gt;
       &lt;/ds:KeyInfo&gt;
     &lt;/ds:Signature&gt;
  </code></pre>
  
  <p>Also tell me is my Authn Request complete . 
  Also is the Authn request same for both the Artifact and POST(Assertion) saml message</p>
  
  <p>PLS HELP !!!</p>