ICEnroll4::getCertFromPKCS7 method

[This method is no longer available for use as of Windows Server 2008 and Windows Vista.]

The getCertFromPKCS7 method retrieves the certificate, contained in a PKCS #7 message, that was issued in response to a PKCS #10 certificate request. This method was first defined by the ICEnroll interface.

This method retrieves the single certificate that was issued even though a PKCS #7 message may contain many certificates that specify the certification chain of authority that issued the certificate.

Syntax


HRESULT getCertFromPKCS7(
  [in]   BSTR wszPKCS7,
  [out]  BSTR *pbstrCert
);

Parameters

wszPKCS7 [in]

Specifies the PKCS #7 from which the issued certificate is being retrieved.

pbstrCert [out]

A pointer to a BSTR variable to receive the issued certificate. When you have finished using the BSTR, free it by calling the SysFreeString function.

Return value

C++

If the method succeeds, the method returns S_OK.

If the method fails, it returns an HRESULT value that indicates the error. For a list of common error codes, see Common HRESULT Values.

VB

The string that contains the issued certificate.

Examples


BSTR    bstrCert = NULL;
HRESULT    hr;

// pEnroll is previously instantiated ICEnroll interface pointer
// bstrPKCS7 is previously created BSTR containing PKCS #7
hr = pEnroll->getCertFromPKCS7( bstrPKCS7, &bstrCert );
if (FAILED(hr))
    printf("Failed getCertFromPKCS7 - %x\n", hr );
else
{
    printf("Successfully called getCertFromPKCS7\n");   
    // do something with the certificate
}

// free BSTR when done
if ( NULL != bstrCert )
    SysFreeString( bstrCert );

Requirements

Minimum supported client

Windows XP [desktop apps only]

Minimum supported server

Windows Server 2003 [desktop apps only]

End of client support

Windows XP

End of server support

Windows Server 2003

Header

Xenroll.h

Library

Uuid.lib

DLL

Xenroll.dll

IID

IID_ICEnroll4 is defined as c1f1188a-2eb5-4a80-841b-7e729a356d90

 

 

Community Additions

ADD
Show:
© 2014 Microsoft