Re: How to export private key in RSA format from NSS

2014-07-20 Thread Chuck Lee
於 2014/7/18 下午 11:35, Richard Barnes 提到: On Jul 15, 2014, at 11:05 PM, Chuck Lee wrote: Yes, but it doesn't work because it also calls PK11_ExportPrivKeyInfo() to get the RSA private key info. Why is this a problem? PK11_ExportDERPrivateKeyInfo() works fine for WebCrypto. Are you building

Re: How to export private key in RSA format from NSS

2014-07-18 Thread Richard Barnes
On Jul 15, 2014, at 11:05 PM, Chuck Lee wrote: > > Yes, but it doesn't work because it also calls PK11_ExportPrivKeyInfo() to > get the RSA private key info. Why is this a problem? PK11_ExportDERPrivateKeyInfo() works fine for WebCrypto. Are you building in some other context than gecko?

Re: How to export private key in RSA format from NSS

2014-07-16 Thread Chuck Lee
於 2014/7/17 上午 06:41, Robert Relyea 提到: On 07/15/2014 08:05 PM, Chuck Lee wrote: Yes, but it doesn't work because it also calls PK11_ExportPrivKeyInfo() to get the RSA private key info. Now I am trying to decrypt key exported by PK11_ExportEncryptedPrivKeyInfo() with method SEC_OID_PKCS12_

Re: How to export private key in RSA format from NSS

2014-07-16 Thread Robert Relyea
On 07/15/2014 08:05 PM, Chuck Lee wrote: Yes, but it doesn't work because it also calls PK11_ExportPrivKeyInfo() to get the RSA private key info. Now I am trying to decrypt key exported by PK11_ExportEncryptedPrivKeyInfo() with method SEC_OID_PKCS12_V2_PBE_WITH_SHA1_AND_40_BIT_RC4 directly,

Re: How to export private key in RSA format from NSS

2014-07-15 Thread Chuck Lee
Yes, but it doesn't work because it also calls PK11_ExportPrivKeyInfo() to get the RSA private key info. Now I am trying to decrypt key exported by PK11_ExportEncryptedPrivKeyInfo() with method SEC_OID_PKCS12_V2_PBE_WITH_SHA1_AND_40_BIT_RC4 directly, which seems to be the most simple method

Re: How to export private key in RSA format from NSS

2014-07-15 Thread Richard Barnes
Have you tried exporting with PK11_ExportDERPrivateKeyInfo? That's what WebCrypto uses to export keys in PKCSD#8 format: On Jul 13, 2014, at 10:48 PM, Chuck Lee wrote: > Hi all, >I am now working on supportin