<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">
      <p>(top posting for consistency)</p>
      <p>Look at the functions named X509_sign(), X509_CRL_sign() and
        X509_REQ_to_X509(), those should get you started.</p>
      On 22/07/2015 11:57, Anirudh Raghunath wrote:<br>
    </div>
    <blockquote
      cite="mid:1937901886.290059.1437559036881.JavaMail.yahoo@mail.yahoo.com"
      type="cite">
      <div style="color:#000; background-color:#fff;
        font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial,
        Lucida Grande, Sans-Serif;font-size:16px">
        <div id="yui_3_16_0_1_1437507453899_143096">Thanks for the quick
          response. I am currently working with smart cards and am using
          the engine provided by openSC to access the private key in the
          smart card. Long story short I have the EVP_PKEY object with
          me. Can I use this to sign a certificate or some file which
          can be used for SSL client verification. </div>
        <div id="yui_3_16_0_1_1437507453899_143096"><br>
        </div>
        <div class="yahoo_quoted" style="display: block;">
          <div style="font-family: HelveticaNeue, Helvetica Neue,
            Helvetica, Arial, Lucida Grande, Sans-Serif; font-size:
            16px;">
            <div style="font-family: HelveticaNeue, Helvetica Neue,
              Helvetica, Arial, Lucida Grande, Sans-Serif; font-size:
              16px;">
              <div dir="ltr"> <font size="2" face="Arial"> On
                  Wednesday, 22 July 2015 11:52 AM, Erwann Abalea
                  <a class="moz-txt-link-rfc2396E" href="mailto:erwann.abalea@opentrust.com"><erwann.abalea@opentrust.com></a> wrote:<br>
                </font> </div>
              <br>
              <br>
              <div class="y_msg_container">
                <div id="yiv4969948448">
                  <div>Bonjour,
                    <div class="yiv4969948448"><br class="yiv4969948448"
                        clear="none">
                    </div>
                    <div class="yiv4969948448">An X.509 certificate is:</div>
                    <div class="yiv4969948448">
                      <div class="yiv4969948448"><br
                          class="yiv4969948448" clear="none">
                      </div>
                      <div class="yiv4969948448">Certificate  ::=
                         SEQUENCE  {</div>
                      <div class="yiv4969948448">        tbsCertificate
                              TBSCertificate,</div>
                      <div class="yiv4969948448">       
                        signatureAlgorithm   AlgorithmIdentifier,</div>
                      <div class="yiv4969948448">        signatureValue
                              BIT STRING  }</div>
                    </div>
                    <div class="yiv4969948448"><br class="yiv4969948448"
                        clear="none">
                    </div>
                    <div class="yiv4969948448">What you produced with «
                      openssl rsautl -sign » is the content of the
                      « signatureValue » element (not its BIT STRING
                      structure, only the inner content).</div>
                    <div class="yiv4969948448">What is missing is all
                      the rest, and it can’t be produced by the sole
                      « openssl x509 … » command.</div>
                    <div class="yiv4969948448"><br class="yiv4969948448"
                        clear="none">
                    </div>
                    <div class="yiv4969948448">Please refine your
                      question.</div>
                    <div class="yiv4969948448"><br class="yiv4969948448"
                        clear="none">
                      <br class="yiv4969948448" clear="none">
                      <div>
                        <blockquote class="yiv4969948448" type="cite">
                          <div class="yiv4969948448">Le 22 juil. 2015 à
                            11:17, Anirudh Raghunath <<a
                              moz-do-not-send="true" rel="nofollow"
                              shape="rect" class="yiv4969948448"
                              ymailto="mailto:anirudhraghunath@rocketmail.com"
                              target="_blank"
                              href="mailto:anirudhraghunath@rocketmail.com"><a class="moz-txt-link-abbreviated" href="mailto:anirudhraghunath@rocketmail.com">anirudhraghunath@rocketmail.com</a></a>>
                            a écrit :</div>
                          <br
                            class="yiv4969948448Apple-interchange-newline"
                            clear="none">
                          <div class="yiv4969948448">
                            <div class="yiv4969948448yqt9140975251"
                              id="yiv4969948448yqt20022">
                              <div class="yiv4969948448">
                                <div class="yiv4969948448"
                                  style="background-color:rgb(255, 255,
                                  255);font-family:HelveticaNeue,
                                  'Helvetica Neue', Helvetica, Arial,
                                  'Lucida Grande',
                                  sans-serif;font-size:16px;">
                                  <div class="yiv4969948448"
                                    id="yiv4969948448yui_3_16_0_1_1437507453899_130158">Hello,</div>
                                  <div class="yiv4969948448"
                                    id="yiv4969948448yui_3_16_0_1_1437507453899_130158"><br
                                      class="yiv4969948448" clear="none">
                                  </div>
                                  <div class="yiv4969948448" dir="ltr"
                                    id="yiv4969948448yui_3_16_0_1_1437507453899_130158">I
                                    have used rsault -sign option to
                                    sign a text file which gives me a
                                    binary file. I would like to convert
                                    this to X509 so that I can use it in
                                    a ssl handshake. I understand the
                                    command:</div>
                                  <div class="yiv4969948448" dir="ltr"
                                    id="yiv4969948448yui_3_16_0_1_1437507453899_130158"><br
                                      class="yiv4969948448" clear="none">
                                  </div>
                                  <div class="yiv4969948448" dir="ltr"
                                    id="yiv4969948448yui_3_16_0_1_1437507453899_130158">openssl
                                    x509 -inform <format> -in
                                    <certfile> -out
                                    <cert.pem> </div>
                                  <div class="yiv4969948448" dir="ltr"
                                    id="yiv4969948448yui_3_16_0_1_1437507453899_130158"><br
                                      class="yiv4969948448" clear="none">
                                  </div>
                                  <div class="yiv4969948448" dir="ltr"
                                    id="yiv4969948448yui_3_16_0_1_1437507453899_130158">is
                                    used. I want to know what the
                                    parameters would be for a binary
                                    input file.</div>
                                </div>
                              </div>
                            </div>
                          </div>
                        </blockquote>
                      </div>
                    </div>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </blockquote>
    <br>
    <br>
    <pre class="moz-signature" cols="72">Enjoy

Jakob
-- 
Jakob Bohm, CIO, Partner, WiseMo A/S.  <a class="moz-txt-link-freetext" href="http://www.wisemo.com">http://www.wisemo.com</a>
Transformervej 29, 2860 Søborg, Denmark.  Direct +45 31 13 16 10
This public discussion message is non-binding and may contain errors.
WiseMo - Remote Service Management for PCs, Phones and Embedded </pre>
  </body>
</html>