<div dir="ltr"><br><div style><p style>Hi Andreas,</p><div><br></div><div>I am converting my key file with below command:</div><div><br></div><div><p> openssl pkcs8 -nocrypt -in defaultPrivateKey.pem -out defaultPrivateKey1.pem</p>
<p><br></p><p>I am putting the new file in the /etc/ipsec/certs/ipsec.d/private, do not know the reason why it is not converting.</p><p><br></p><p style>Any thing in addition i need to do for converting pkcs8 private key to pkcs1 .</p>
</div><p style><br></p></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Jun 3, 2013 at 12:31 PM, Andreas Steffen <span dir="ltr"><<a href="mailto:andreas.steffen@strongswan.org" target="_blank">andreas.steffen@strongswan.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Bhargav,<br>
<br>
your are still loading the PKCS#8 private key file:<br>
<div class="im"><br>
charon: 00[LIB] L1 - modulus: ASN1 tag 0x02 expected, but is 0x30<br>
charon: 00[LIB] => 15 bytes @ 0x1200ac807<br>
charon: 00[LIB] 0: 30 0D 06 09 2A 86 48 86 F7 0D 01 01 01 05 00<br>
0...*.H........<br>
<br>
</div>Regards<br>
<br>
Andreas<br>
<div class="im"><br>
On 06/03/2013 08:57 AM, bhargav p wrote:<br>
> Hi Andreas,<br>
><br>
> I tried converting the private key from PKCS#8 to PKCS#1, but still I<br>
> am getting the same error:<br>
><br>
> CFPU-0 charon: 00[LIB] -----BEGIN PRIVATE KEY-----<br>
> charon: 00[LIB] -----END PRIVATE KEY-----<br>
> charon: 00[LIB] L0 - RSAPrivateKey:<br>
> charon: 00[LIB] L1 - version:<br>
> charon: 00[LIB] => 1 bytes @ 0x1200ac806<br>
> charon: 00[LIB] 0: 00 .<br>
> charon: 00[LIB] L1 - modulus: ASN1 tag 0x02 expected, but is 0x30<br>
> charon: 00[LIB] => 15 bytes @ 0x1200ac807<br>
> charon: 00[LIB] 0: 30 0D 06 09 2A 86 48 86 F7 0D 01 01 01 05 00<br>
> 0...*.H........<br>
> charon: 00[LIB] building CRED_PRIVATE_KEY - RSA failed, tried 5 builders<br>
> charon: 00[CFG] loading private key from<br>
> '/etc/ipsec/certs/ipsec.d//private/defaultPrivateKey.pem' failed<br>
> charon: 00[LIB] plugin 'stroke': loaded successfully<br>
> charon: 00[LIB] plugin 'kernel-netlink': loaded successfully<br>
><br>
><br>
> -Bhargav<br>
><br>
><br>
> On Sat, Jun 1, 2013 at 3:17 AM, Andreas Steffen<br>
</div>> <<a href="mailto:andreas.steffen@strongswan.org">andreas.steffen@strongswan.org</a> <mailto:<a href="mailto:andreas.steffen@strongswan.org">andreas.steffen@strongswan.org</a>>><br>
<div><div class="h5">> wrote:<br>
><br>
> Hi Bhargav,<br>
><br>
> The private key that you are trying to load is a PKCS#8 file,<br>
> a format being used by openssl 1.x.x. PKCS#8 support was introduced<br>
> with strongswan 4.6.2. So as a workaround either upgrade to a newer<br>
> strongSwan version or convert the private key from PKCS#8 to PKCS#1<br>
> using the following openssl command:<br>
><br>
> openssl pkcs8 -nocrypt -in key8.pem -out key1.pem<br>
><br>
> Regards<br>
><br>
> Andreas<br>
><br>
> On 05/31/2013 08:12 AM, bhargav p wrote:<br>
> > Hi,<br>
> ><br>
> > I am trying to establish the IPsec tunnel with certificates with<br>
> charon.<br>
> ><br>
> > From the logs the below error is thrown:<br>
> ><br>
> > L0 - RSAPrivateKey:<br>
> > charon: 00[LIB] L1 - version:<br>
> > charon: 00[LIB] => 1 bytes @ 0x1200ac406<br>
> > charon: 00[LIB] 0: 00<br>
> .<br>
> > charon: 00[LIB] L1 - modulus: ASN1 tag 0x02 expected, but is 0x30<br>
> > charon: 00[LIB] => 15 bytes @ 0x1200ac407<br>
> > charon: 00[LIB] 0: 30 0D 06 09 2A 86 48 86 F7 0D 01 01 01 05 00<br>
> > 0...*.H........<br>
> > charon: 00[LIB] building CRED_PRIVATE_KEY - RSA failed, tried 5<br>
> builders<br>
> > charon: 00[CFG] loading private key from<br>
> > '/etc/ipsec/certs/ipsec.d//private/defaultPrivateKey.pem' failed<br>
> > charon: 00[LIB] plugin 'stroke': loaded successfully<br>
> > charon: 00[LIB] plugin 'kernel-netlink': loaded successfully<br>
> > charon: 00[DMN] loaded plugins: openssl random pem x509 pubkey pkcs1<br>
> > hmac xcbc stroke kernel-netlink<br>
> > May 31 13:32:21.117438 info CLA-0 charon: 00[JOB] spawning 16<br>
> worker threads<br>
> > charon: 07[LIB] file content is not binary ASN.1<br>
> ><br>
> > Can some one help me here.<br>
> ><br>
> > Using strongswan version:4.5.3<br>
> ><br>
> > cat defaultPrivateKey.pem<br>
> > -----BEGIN PRIVATE KEY-----<br>
> > MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCyoayXeOOMy5rE<br>
> > tqdP56GJnNP29Ul1OSk7W8BS9Y6yZb0dlcL4NWhg4xbPk4zBZKR1FUsjKYUcNogE<br>
> > 33G5/muESiPzLWE8CeMGf6WrXH40W99kpIho204WsIJlLG3OCF2UQCXA/FGYJTqe<br>
> > ODKQzea0oxjEHzLdSxpYaCAggPeBuiZ5+2kf+hE+d1qxOYheFM0JGkduXr2F9I+f<br>
> > VMDAXk64uCG8v7z5DlTrYhgDr3WhRkzv+STIDuAvqiFaV26bpa7lqmpEcO5nrklF<br>
> > 3jJ8cDWSn+l390TIdg8pn4bJTyyfs9cYtpDpn0fndvuFvncbGAT+b5EifoUES6J9<br>
> > mmIBHioRAgMBAAECggEBAJZrxF2NI/jE3yA1OzDzObkbAfcc2G3I46qjeZGiTDZ3<br>
> > q8fE+/htaOblc6j6c/XKnR4m/y2t4fQ/C00nJ6pazwkIMbuuBAo9vRoU1Vo2ueO3<br>
> > Vad3UZMS0XAT1MoDnrd3ne2gEuquzrrS5sijRBlh+Zs1GD7Wkst8WcQGcr9MOp/W<br>
> > y9B+gOMb8QcoJkiyenKIGstyFFLUd8IWtzLpPVKYABfjw+qIFmZno2+Z3uWnE6jM<br>
> > h8J7sWFXQyBtcylhd9jxGpPn9gPkt4v9kWMe2+P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----<br>
> ><br>
> > --Bhargav<br>
<br>
</div></div>======================================================================<br>
Andreas Steffen <a href="mailto:andreas.steffen@strongswan.org">andreas.steffen@strongswan.org</a><br>
strongSwan - the Open Source VPN Solution! <a href="http://www.strongswan.org" target="_blank">www.strongswan.org</a><br>
<div class="HOEnZb"><div class="h5">Institute for Internet Technologies and Applications<br>
University of Applied Sciences Rapperswil<br>
CH-8640 Rapperswil (Switzerland)<br>
===========================================================[ITA-HSR]==<br>
<br>
</div></div></blockquote></div><br><br clear="all"><div><br></div><br><div><font color="#282828" face="Calibri"><span style="color:#282828;font-size:11pt"></span></font></div>
</div></div>