On Thu, Feb 19, 2004, murugesan wrote:

> Thanks Dr. Stephen Henson ,
>     I got it working through,
>     pkey = (EVP_PKEY *)PEM_ASN1_read((char *(*)())d2i_AutoPrivateKey, 
> PEM_STRING_EVP_PKEY,
>                                    fp, buff, NULL, NULL);
> May be I am not sure that what I did was correct.
> In this case may I know why not to use PEM_ASN1_read  rather than using 
> PEM_read_PrivateKey.
> 

PEM_ASN1_read() is largely an internal function used by the library to build
the main PEM functions. Its behaviour is not guaranteed in future versions of
OpenSSL and could well change.

PEM_read_PrivateKey() includes additional functionality to read in various key
types automatically such as PKCS#8. If, for example, the default OpenSSL
private key format is changed to PKCS#8 (or something else) then applications
written using PEM_read_PrivateKey() would still work but those calling
PEM_ASN1_read() directly would fail.

Steve.
--
Dr Stephen N. Henson. Email, S/MIME and PGP keys: see homepage
OpenSSL project core developer and freelance consultant.
Funding needed! Details on homepage.
Homepage: http://www.drh-consultancy.demon.co.uk
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    [EMAIL PROTECTED]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to