EldoS | Feel safer!

Software components for data protection, secure storage and transfer

Problem with TElECKeyMaterial.LoadSecret

Posted: 07/26/2012 04:43:01
by Andy Calvert (Standard support level)
Joined: 08/10/2011
Posts: 2

Please could somebody advise me the correct format of the private key for loading. I created and exported a key using openssl. I noted that it's format agreed with that in Certicom's SEC1 ASN.1 definitions. When I attempted to load it I got an invalid key error.

I then looked at the samples, and used the CertificateRequest demo to create and export an EC DSA key. I noted that it did not include the optional parameter to specify the curve. I then modified my test data to remove that field (and adjusted lengths accordingly). When attempting to load this modified key format I got am Unsupported Property Value error.

Please could you advise the correct format ?
Posted: 07/26/2012 05:02:51
by Mykola Olshevsky (Basic support level)
Joined: 07/07/2005
Posts: 442

Hi. Thank you for contacting us.
.LoadSecret method of ElECKeyMaterial loads private key as it is saved in X.509 certificates raw private key format. It is an ASN.1 SEQUENCE with version, D and Q.
Actually, easier for you would be just to set KeyMaterial.CurveOID, KeyMaterial.D and KeyMaterial.Q parameters, or load key from PFX, as part of certificate.

As far as I remember, OpenSSL uses PKCS#8 keys format.
Posted: 07/26/2012 05:04:39
by Andy Calvert (Standard support level)
Joined: 08/10/2011
Posts: 2

Excellent response - extremely quick and detailed. Many thanks.



Topic viewed 679 times

Number of guests: 1, registered members: 0, in total hidden: 0


Back to top

As of July 15, 2016 EldoS business operates as a division of /n software, inc. For more information, please read the announcement.

Got it!