I have more questions regarding your response since I am relatively new to
this stuff:
What's PDU?
how do you decode PrivateKeyInfo PDU to extract PrivateKeyInfo PDU struct?
and how do you then encode it?


THank you
Alex





                                                                                       
                          
                    "Prashant Kumar"                                                   
                          
                    <prkumar@nortelnetwor       To:     <[EMAIL PROTECTED]>    
                          
                    ks.com>                     cc:                                    
                          
                    Sent by:                    Subject:     RE: BSafe RSA keys        
                          
                    owner-openssl-users@o                                              
                          
                    penssl.org                                                         
                          
                                                                                       
                          
                                                                                       
                          
                    03/08/02 12:19 PM                                                  
                          
                    Please respond to                                                  
                          
                    openssl-users                                                      
                          
                                                                                       
                          
                                                                                       
                          




Alex,

I guess B_GetKeyInfo(buffer, obj,KI_PKCS_RSAPrivateBER)
returns a ASN1 of PrivateKeyInfo PDU. You have to extract
RSAPrivateKey PDU from this PrivateKeyInfo PDU. Once you
get RSAPrivateKey PDU you can then use "SSL_CTX_use_PrivateKey_ASN1"
API to set the private key.

To do all these things I followed a very round about way. First
I store the private key (I mean the PrivateKeyInfo PDU) in the BER
ASN1 format (I don't apply B_SetKeyInfo to convert B_KEY_OBJ).
Next, I decode the PrivateKeyInfo PDU to extract the RSAPrivateKey
structure. Once I extract the RSAPrivateKey structure I encode this
structure to generate RSAPrivateKey PDU.

There should be a better way to do it!.

Regards,
Prashant.

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 08, 2002 11:31 AM
To: [EMAIL PROTECTED]
Subject: BSafe RSA keys


Hi,
I am working on putting OpenSSL into our app.
However, we are required to use RSA keys
that are produced with BSafe by another app.
Does anybody know how to get BSafe RSA Private key to work with open ssl?
I tried to use the output of B_GetKeyInfo(buffer,
obj,KI_PKCS_RSAPrivateBER)
However that does not work with d2i_RSAPrivatekey - it complains that
header is too long.
I guess that's because B_GetKeyInfo in this case returns PKCS#8
PrivateKeyInfo, which not what
open ssl expects on the input.

Could osmeone help me out?


Thank you
Alex


______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    [EMAIL PROTECTED]
Automated List Manager                           [EMAIL PROTECTED]

______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    [EMAIL PROTECTED]
Automated List Manager                           [EMAIL PROTECTED]



______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    [EMAIL PROTECTED]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to