[prev in list] [next in list] [prev in thread] [next in thread] 

List:       ms-cryptoapi
Subject:    Re: 0x80093005 in CryptDecodeObjectEx
From:       Weimin Yang <weimin.yang () LITRONIC ! COM>
Date:       2000-08-30 15:00:40
[Download RAW message or body]


I figured out. I misunderstood how to use CryptDecodeObjectEx. First Create
the CERT_CONTEXT, use CertFindExtension to get proper extension data, then
pass to CryptDecodeObjectEx.


Weimin

----- Original Message -----
From: Slawomir Marciniak <Slawek@SUNTECH.COM.PL>
To: <CryptoAPI@DISCUSS.MICROSOFT.COM>
Sent: Wednesday, August 30, 2000 1:29 AM
Subject: Re: 0x80093005 in CryptDecodeObjectEx


> You are trying to decode extension but you are giving certificate.
> I don't know how to decode extension.
> I was think that CertCreateCertificateContext is decoding extensions in
> CERT_CONTEXT->PCERT_INFO->rgExtension.
> One of position in rgExtension array should be szOID_KEY_USAGE_RESTRICTION
> that can you decode by CryptDecodeObject.
> But PCCERT_CONTEXT acquired in several different methods always have NULL
in
> rgExtension.
> Maybe somebody know how to decode certificate with extensions?
>
>
>
> -----Original Message-----
> From: Weimin Yang [mailto:weimin.yang@LITRONIC.COM]
> Sent: Tuesday, August 29, 2000 10:21 PM
> To: CryptoAPI@DISCUSS.MICROSOFT.COM
> Subject: 0x80093005 in CryptDecodeObjectEx
>
> I tried to use CryptDecodeObjectEx to decode a X509 certificate. I always
> get the 0x80093005 error.
> When I use the same data to create certificate
> context(CertCreateCertificateContext), it 's ok.
>
>
>    if ( ! CryptDecodeObjectEx(X509_ASN_ENCODING,
>             szOID_KEY_USAGE_RESTRICTION,
>             pCertificate,            /* buffer to certificate */
>             dwCertificate,        /* size of certificate */
>            CRYPT_DECODE_NOCOPY_FLAG,
>             NULL,
>             NULL,
>             &dwKeyUsage) )
>
>
>     DWORD myError = GetLastError();
>
>     return NTE_FAIL;
>    }
>
>
> Any help will be highly appreciated.
>
>
> Weimin
>
> ----------------------------------------------------------------
> Users Guide http://msdn.microsoft.com/workshop/essentials/mail.asp
> contains important info including how to unsubscribe.  Save time, search
> the archives at http://discuss.microsoft.com/archives/index.html
>
> ----------------------------------------------------------------
> Users Guide http://msdn.microsoft.com/workshop/essentials/mail.asp
> contains important info including how to unsubscribe.  Save time, search
> the archives at http://discuss.microsoft.com/archives/index.html
>

----------------------------------------------------------------
Users Guide http://msdn.microsoft.com/workshop/essentials/mail.asp
contains important info including how to unsubscribe.  Save time, search
the archives at http://discuss.microsoft.com/archives/index.html

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic