You Are Here:

Community: Developer Discussion Boards

#1 Old ensymble.py: not an RSA or DSA private key in PEM format (Publisher Id) - 2008-06-26, 09:30

Join Date: Feb 2008
Posts: 63
blackpaw
Offline
Regular Contributor
I've
  • purchased a publisher ID
  • Extracted the .cer and .key files with tcp12p8.bat
  • Filled in a DevRequest certificat and submitted it to Symbian Signed Online
  • Got a developer certificate file back

But when I try to create a signed sis file using the key file and the developer certificate I just get:
Code:
ensymble.py: not an RSA or DSA private key in PEM format
The key file is base64 encoded and starts with -----BEGIN PRIVATE KEY-----

Any suggestions?

thanks,

Lindsay
Reply With Quote

#2 Old Re: ensymble.py: not an RSA or DSA private key in PEM format (Publisher Id) - 2008-06-26, 09:41

Join Date: May 2004
Posts: 524
Location: Tampere, Finland
jethro.fn's Avatar
jethro.fn
Offline
Forum Nokia Champion
Quote:
Originally Posted by blackpaw View Post
I just get:
Code:
ensymble.py: not an RSA or DSA private key in PEM format
The key file is base64 encoded and starts with -----BEGIN PRIVATE KEY-----
Ensymble is unable to determine whether the key type is RSA or DSA. Change the first line to read

Code:
-----BEGIN RSA PRIVATE KEY-----
or

Code:
-----BEGIN DSA PRIVATE KEY-----
depending on the key type (my guess is RSA).
Reply With Quote

#3 Old Re: ensymble.py: not an RSA or DSA private key in PEM format (Publisher Id) - 2008-06-27, 03:47

Join Date: Feb 2008
Posts: 63
blackpaw
Offline
Regular Contributor
Thanks jethro, that seemed to make a difference. I checked the cert in explorer - its RSA 2048 bit, so I set that in the certificate.

Now I just get
Code:
ensymble.py: wrong pass phrase
I set no password when I exported the key from IE. It tried rexport with a passphrase and using that, still no joy.

Oddly when I set the key type to DSA (which I kow is wrong) I still get the same error.

Can ensymble/signsis cope with RSA 2048 bit?
Reply With Quote

#4 Old Re: ensymble.py: not an RSA or DSA private key in PEM format (Publisher Id) - 2008-06-27, 07:34

Join Date: May 2004
Posts: 524
Location: Tampere, Finland
jethro.fn's Avatar
jethro.fn
Offline
Forum Nokia Champion
Quote:
Originally Posted by blackpaw View Post
Code:
ensymble.py: wrong pass phrase
Any failure to convert the key to a binary format will lead to this error message. Most of the time that means wrong pass-phrase, so I decided that there was not much point trying to guess all the possible failures that might occur and handle them separately.


Quote:
Originally Posted by blackpaw View Post
Oddly when I set the key type to DSA (which I kow is wrong) I still get the same error.

Can ensymble/signsis cope with RSA 2048 bit?
Ensymble uses the OpenSSL command line tool and should therefore support all the key types and sizes OpenSSL supports. However, Ensymble's OpenSSL integration is less than optimal, making it sensitive to untested cases. There's a command line swith --debug, which displays a lot of information about the OpenSSL invocations. Can you copy here the output of Ensymble with that option enabled?
Reply With Quote

#5 Old Re: ensymble.py: not an RSA or DSA private key in PEM format (Publisher Id) - 2008-06-27, 07:46

Join Date: Feb 2008
Posts: 63
blackpaw
Offline
Regular Contributor
Thanks jethro, here it is:

Code:
DEBUG: os.popen3('c:\\utils\\openssl rsa -in c:\\docume~1\\lindsay\\locals~1\\te
mp\\ensymble-ttqfpe\\privkey.pem -out c:\\docume~1\\lindsay\\locals~1\\temp\\ens
ymble-ttqfpe\\privkey2.pem -passin stdin')
DEBUG: pipeerr.read() = 'unable to load Private Key\n2140:error:0906D066:PEM rou
tines:PEM_read_bio:bad end line:.\\crypto\\pem\\pem_lib.c:744:\n'
Traceback (most recent call last):
  File "ensymble.py", line 1010, in <module>
    import cmdmain
  File "D:\Python25\lib\ihooks.py", line 404, in import_module
    q, tail = self.find_head_package(parent, str(name))
  File "D:\Python25\lib\ihooks.py", line 440, in find_head_package
    q = self.import_it(head, qname, parent)
  File "D:\Python25\lib\ihooks.py", line 495, in import_it
    m = self.loader.load_module(fqname, stuff)
  File "<package>", line 28, in load_module
  File "cmdmain.py", line 98, in <module>
  File "cmdmain.py", line 82, in main
  File "cmd_py2sis.py", line 625, in run
  File "sisfile.py", line 634, in tofile
  File "sisfile.py", line 574, in tostring
  File "sisfile.py", line 88, in signstring
  File "cryptutil.py", line 121, in signstring
ValueError: wrong pass phrase
Reply With Quote

#6 Old Re: ensymble.py: not an RSA or DSA private key in PEM format (Publisher Id) - 2008-06-27, 08:19

Join Date: May 2004
Posts: 524
Location: Tampere, Finland
jethro.fn's Avatar
jethro.fn
Offline
Forum Nokia Champion
Wow. I learned something here...

Files that contain "-----BEGIN PRIVATE KEY-----" are in a newer format called PKCS#8, according to OpenSSL documentation. Ensymble only handles the old SSLeay compatible format.

This is something that needs to be implemented in Ensymble, but in the meantime you can convert your key to the old format with the OpenSSL command line tool:

Code:
openssl pkcs8 -in newformatkey.pem -out oldformatkey.pem
or

Code:
openssl pkcs8 -in newformatkey.pem -out oldformatkey.pem -nocrypt
if the new format key is not encrypted (OpenSSL does not auto-detect this).
Reply With Quote

#7 Old Re: ensymble.py: not an RSA or DSA private key in PEM format (Publisher Id) - 2008-06-27, 08:31

Join Date: Feb 2008
Posts: 63
blackpaw
Offline
Regular Contributor
Thanks! worked a treat (unencrypted),

Saved my ass
Reply With Quote
Reply « Previous Thread | Next Thread »
Display Modes
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules

You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump
Similar Threads
Thread Thread Starter Forum Replies Last Post
How to make a private key and self signed certificate arun_sl Symbian Tools & SDKs 8 2005-06-30 10:46
another Null pointer exception kvchen1985 Mobile Java Tools & SDKs 1 2004-06-28 16:33
FullCanvas, Nokia 3650: I'm lost rudolphous Mobile Java General 1 2003-10-28 15:06
PC Connectity with VB6 mkintanar PC Suite API and PC Connectivity SDK 5 2003-09-24 05:18
Painting problem guidopater Mobile Java Media (Graphics & Sounds) 12 2003-06-20 09:53

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia