<div dir="ltr">I am using the latest strongswan version 5.5.0<div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Oct 5, 2016 at 4:07 PM, Ravi Kanth Vanapalli <span dir="ltr"><<a href="mailto:vvnrk.vanapalli@gmail.com" target="_blank">vvnrk.vanapalli@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi all,<div>  I am trying to use TLS to setup a connection to a gateway programmatically.</div><div><br></div><div>Used the code below.  </div><div>------------------------</div><div><br></div><div><br></div><div><br></div><div>    private_key_t *key;</div><div><span class="m_7290111942403962042gmail-Apple-tab-span" style="white-space:pre-wrap"> </span>char path[512]="/system/etc/user1_<wbr>private.pem";</div><div><span class="m_7290111942403962042gmail-Apple-tab-span" style="white-space:pre-wrap"> </span>key = lib->creds->create(lib->creds, CRED_PRIVATE_KEY, KEY_RSA,</div><div><span class="m_7290111942403962042gmail-Apple-tab-span" style="white-space:pre-wrap">                                                                             </span> BUILD_FROM_FILE, path, BUILD_END);</div><div><span class="m_7290111942403962042gmail-Apple-tab-span" style="white-space:pre-wrap">  </span>if (!key) {</div><div><span class="m_7290111942403962042gmail-Apple-tab-span" style="white-space:pre-wrap">          </span>DBG1(DBG_DMN, "Parsing private key failed");<span class="m_7290111942403962042gmail-Apple-tab-span" style="white-space:pre-wrap">              </span></div><div><span class="m_7290111942403962042gmail-Apple-tab-span" style="white-space:pre-wrap">     </span>} </div><div><br><div><br></div><div>------------------------------<wbr>----</div><div>On running, I do not see "Parsing private key failed". But I see the print as below<br></div><div><br></div><div><br></div><div><div>10-05 15:31:37.266  4630  4650 D     : 08[ASN]   file content is not binary ASN.1</div><div>10-05 15:31:37.266  4630  4650 D     : 08[ASN]   -----BEGIN RSA PRIVATE KEY---</div><div>10-05 15:31:37.266  4630  4650 D     : 08[ASN]   -----END RSA PRIVATE KEY-----</div></div><div><br></div><div>My private key file is below. Can you help me find the issue</div><div><br></div><div><div>-----BEGIN RSA PRIVATE KEY-----</div><div>MIIEpAIBAAKCAQEAsVqa9nZctF/<wbr>gxA26RTN3oSs6MbNiJYFP6jKpVJRAj<wbr>flB17rC</div><div>7Pg6bf5NBr4SdgR0YyklI17wvzwEWx<wbr>CDjJZHAw/CxeN/<wbr>icSCsN6VehHoJ6ROhPOo</div><div>jdRs2MsyYyut8OZiSoG/<wbr>jHVmLQWVgJIZvSOxxCGDj+<wbr>xYqEbd6YhO8ejPrrh4v3/r</div><div>NJW6glu6PbbrgNfwtozMeNOQrXnETm<wbr>SLBNJ5RlM+<wbr>sntzivq6t8QJzDcjmf2OV3Xk</div><div>GwvNaLeOvoq55dbPf1wpuVyaU3npZp<wbr>hQe4EDsrX3p05DhYEW6rwUXc9iyF98<wbr>D/HR</div><div>JTEnCN+Ri/pwXWyuUlEN/1Bq09nU/<wbr>L6KfAQ8HwIDAQABAoIBADnNvhP2H+<wbr>DqHufH</div><div>UZ6cV7E/1Ye9X4+<wbr>5xcIfIPFgIGolg0A8rqttfB29dH1uF<wbr>bZBXW20S1Zr6yto9EJ5</div><div>72Yy1JI64NB+<wbr>hWLxmWbsJOvUSkYhVzYd9CHFynQeRh<wbr>3sbpTFgeOmxjeRS+wAlemB</div><div>tMHgkF/MTITsEzlFX65trs1Jg+<wbr>b9zc7wJs5ZeebBqw9m+<wbr>Kn687MBDhOmx4uij59S</div><div>xP0ok2FnDlXNIEX1yLJpzSVPtEhhrF<wbr>hcrFCq7LESUitZULoWD0v9VLaUVNe3<wbr>n9yH</div><div>KPDRqu4lH5Y3bloI+Bx/hiZmxBCTV+<wbr>kTF+4+PZJq1WzB6PCqmxNhN9zn+<wbr>O7DDTzB</div><div>TSI/<wbr>QoECgYEA34MnKE93DCNj4qL85NMCyC<wbr>qo2ynsicqPBOtt1pZGXquYMbffefGx</div><div>kBl7BIpDfnn6077hWbTJzTeTO2gEXK<wbr>cncQPWnDWCwIiCBbmgiec3k6WG+/<wbr>Fki4mq</div><div>J+<wbr>E1kO9eLn5Qw3uUzMNaey9P4kIore2z<wbr>g7Ds42xHoNi7c3537evi6KsCgYEAyy<wbr>Ho</div><div>gz+gmIHr7mk6aKg6b4WydJuMYcB4g+<wbr>sVt+<wbr>JmUhhmfNAXx4MpKJo6c7jhgStAzXXD</div><div>d0FaYs4DfuU/<wbr>ptcNmkmDPkVrpLj8NYHt7i2RZhULiO<wbr>brY8iNRaW39LDUBvIkeuAr</div><div>JbuCJ7gYH8K7cnEF6/<wbr>LvDsqllDUUEt+<wbr>1I4UNIl0CgYEAkFyseOvCb3OYOzScd<wbr>MsZ</div><div>W+G5yDxuy5yp/Tp2aggLkW/<wbr>xUAN78s45qmHaw9btuw3cBNGfyYnsY<wbr>YDItrD7SECq</div><div>R+<wbr>N7xM8HEYXZvQrk9s0BZ3qdEbMbBsk2<wbr>vqVGLMN+<wbr>KDdrwKbcN9jhYvju9qtWjOgf</div><div>bypiBo3UQb5abEE+<wbr>Asy9dRsCgYEAvDiBMAxnDKlmKhWLL6<wbr>qh6vBheTcgjvs/ME1G</div><div>ZIr98Jf3bzOKtS3Nl3fBLbVkDsI7W6<wbr>YBJqGB1Qe7qXtWzYt7aTkwySSeJ5XY<wbr>7OOl</div><div>ygqjLYnWlFYUSvNsI9r4Z1zqOj1onA<wbr>rXMDFc2tz0TYmtEs+zgvwpkvUnE/<wbr>tSzGJJ</div><div>f84ra2kCgYAY/<wbr>qErTWgqRkc95A1qCyqsl/<wbr>oU1swLMDmqe6F4rceFvdXuHkIyWGzL</div><div>Op8l/<wbr>Nj1YzDRiGcQEyEooaGrgS1rvas2Q+<wbr>nzxHMFBypVQsZE4y6F1qJ5dyr0xRGE</div><div>XeWrqWY/<wbr>8UjLZzgDktjghg7DCoQEjI+<wbr>c0rUs8ld6fFv4iK9ecI0Gng==</div><div>-----END RSA PRIVATE KEY-----</div></div><span class="HOEnZb"><font color="#888888"><div><br></div><div><br></div><div><br></div>-- <br><div class="m_7290111942403962042gmail_signature"><div dir="ltr"><div><font color="#666666">Regards,</font></div>
<div><font color="#666666">RaviKanth VN Vanapalli</font></div><div><br></div></div></div>
</font></span></div></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><font color="#666666">Regards,</font></div>
<div><br><font color="#666666">RaviKanth VN Vanapalli</font></div><div><font color="#666666">Ph: (469) 999 7567</font></div>
<div><font color="#666666">Email: </font><a href="mailto:vvnrk.vanapalli@gmail.com" target="_blank"><font color="#666666">vvnrk.vanapalli@gmail.com</font></a></div></div></div>
</div>