Re: how can i export the private key as PKCS#7 ?



Not sure if you can directly export to that RSAPrivateKey format using
single capi function.
The PKCS8 unencrypted format is just an asn.1 wrapper around the
RSAPrivateKey as discussed here:
http://www.jensign.com/opensslkey
- Mitch

"wuhao" <wuhao@xxxxxxxxxxx> wrote in message
news:u2nhxONaGHA.4036@xxxxxxxxxxxxxxxxxxxxxxx
hi Mitch
i have tried CryptExportPKCS8() using szOID_RSA_RSA
it export
///////////////////////////////////////////////////////////
30 82 03 85 30 82 02 EE-A0 03 02 01 02 02 01 0C 0...0...........
30 0D 06 09 2A 86 48 86-F7 0D 01 01 04 05 00 30 0...*.H........0
81 87 31 0B 30 09 06 03-55 04 06 13 02 43 4E 31 ..1.0...U....CN1
0B 30 09 06 03 55 04 08-13 02 42 4A 31 10 30 0E .0...U....BJ1.0.
06 03 55 04 07 13 07 42-65 69 6A 69 6E 67 31 0F ..U....Beijing1.
30 0D 06 03 55 04 0A 13-06 43 45 2E 6C 74 64 31 0...U....CE.ltd1
13 30 11 06 03 55 04 0B-13 0A 4D 61 69 6C 45 78 .0...U....MailEx
70 65 72 74 31 11 30 0F-06 03 55 04 03 13 08 77 pert1.0...U....w
75 68 61 6F 2D 43 41 31-20 30 1E 06 09 2A 86 48 uhao-CA1 0...*.H
86 F7 0D 01 09 01 16 11-77 75 68 61 6F 40 6D 79 ........wuhao@my
63 65 2E 6E 65 74 2E 63-6E 30 1E 17 0D 30 36 30 ce.net.cn0...060
34 32 34 30 37 30 32 30-33 5A 17 0D 31 36 30 34 424070203Z..1604
32 31 30 37 30 32 30 33-5A 30 6A 31 0B 30 09 06 21070203Z0j1.0..
03 55 04 06 13 02 43 4E-31 0B 30 09 06 03 55 04 .U....CN1.0...U.
08 13 02 42 4A 31 0F 30-0D 06 03 55 04 0A 13 06 ...BJ1.0...U....
43 45 2E 6C 74 64 31 0B-30 09 06 03 55 04 0B 13 CE.ltd1.0...U...
... ...
/////////////////////////////////////////////////////////////////////////


but i expected it can export as followed,
(so it can be read by the function PEM_read_PrivateKey() in openssl)
////////////////////////////////////////////////////////////////////////
// test.key
-----BEGIN RSA PRIVATE KEY-----
MIICXQIBAAKBgQDXQ+U/CaT/zVIEEY+eXJ6bdfOjBELVSdYXdRWfOomVCdMS0ENh
/ExSnI+2vDWlnyB1YkpTaPgvw0vbikfdXJMi0Zma0ZPG85qgEnm8MrYNb99WzUr2
Ii8HtnvFSGFXTPYRz1AjPz1c/ABWevQExU0uN8y06mMUnT4fWTqPONAfKQIDAQAB
AoGAbEV/EaTFM9BOlzNJ/EnzkJfUEkM7ZlH799JxLKRhvO+zFXxg1/DxZn/OnQev
J/2QctocLjXW1xcwmVzE5qcAbY7iumTiD9pZ5s/vvWTW2LeFCAj3wcE6czOUPQcm
905h3ARXIa3+0zw2c8szW3pcCrVqPUDcC3BF07t9DkFh7v0CQQD/qx4LJvt2WGQR
IaqblAU+fR0qR/C0mKmC5025XrM8o/8bc1PU1kih73NdomvDkLQ0GQh9YntPnowV
MP3iLXD3AkEA14tdOUTswcBhgIsvDxTRNmkSGT9QIc9mdPIB15Afm2nXsVxTHYM1
CjEx4gOkaO46Fi2hS8KlFwg12bf2LCUI3wJALIEM6cQPYbphMNo7aHmLsCT3PrTn
IYixeSfqT6o8aQHjFlQs84+ZdRbJbjMnrxMxSyBQagMKlAF1QPsWNpjSYQJBANGL
okDH2ifugJu4NDLEOTRdZ4P2AlAsUl4E3HeVnLS5bED4EbGSWiEjfGxOwCpm1z+y
cqm1fEvs5nVYG9IE2x8CQQC98iG4d0Y7fQker1U6MRpruWkYNrit/dQToOQmCyAk
S8q1azASHU7bvqigTZVX3b1SYV72IqMpTbEOKfeUrGRj
-----END RSA PRIVATE KEY-----
////////////////////////////////////////////////////////////

can i export the key in this format ?

thank you .







.



Relevant Pages

  • Re: Need SQL Help please
    ... If your Date column contains the date as text (in yyyy-mm-dd format), ... that the wrapper directly supports SQL-TextDate- ... Columns with an automatic mapping to VB-Date-Variables. ... Meta-Stock-FileContent, named VBDate. ...
    (microsoft.public.vb.database)
  • Re: Windows Vista Premium - TV Tuner - Video Format
    ... However the DVR-MS format is really only a wrapper around the MPEG2 ... formatted data which Media Center gets from the tuner driver. ...
    (microsoft.public.windows.mediacenter)
  • Re: parsing a file..
    ... seconds to read a number at a time, using sscanf(but I use a wrapper ... or two with some extra overhead) ... Using fread() on 2400000 bytes. ... argument for transforming the file into a binary format. ...
    (comp.lang.c)
  • Re: stream converting
    ... > expected input is either in binary or in some kind of text format; ... > write some kind of wrapper. ... > equivalent binary file would. ...
    (comp.lang.cpp)