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

List:       ms-cryptoapi
Subject:    Re: extracting certificate attributes
From:       DolanP () DELUXE-DATA ! CO ! UK
Date:       1999-02-10 9:13:30
[Download RAW message or body]


Cameron,

Might not be what you want, but, if your certificate is in one of the
stores, you can use the following snippet:

     CERT_INFO *pCertInfo = NULL;
     HCRYPTKEY hPublicKey = NULL;

     // Get certificate context for appropriate certificate.
     // CertOpenStore(), CertEnumCertificatesInStore() etc.

     pCertInfo = pCertContext->pCertInfo;

     CryptImportPublicKeyInfo(
          hCryptProv,
          X509_ASN_ENCODING,
          &pCertInfo->SubjectPublicKeyInfo,
          &hPublicKey);

You now have a handle to the public key for use in the CryptoAPI style.

Patrick.






Cameron Durham <cameron.durham@LITRONIC.COM> on 10/02/99 03:37:27

Please respond to Microsoft Cryptographic API
      <CryptoAPI@DISCUSS.MICROSOFT.COM>

To:   CryptoAPI@DISCUSS.MICROSOFT.COM
cc:    (bcc: Patrick Dolan/UK/Deluxe Data/Deluxe Corporation)
Subject:  extracting certificate attributes




Hi -

I'm trying to extract a public key attribute from a certificate.  I
believe that CryptDecodeObject() will do the trick, but I'm not sure.

Is this the path to attribute enlightenment?  Are there any examples as
a shortcut?

Cam
--
"Never try to baptize a cat."

Cameron Durham
Software Engineer
Litronic
http://www.litronic.com
949.622.3606

----------------------------------------------------------------
Users Guide http://www.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://www.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