ICertRequest::GetCertificate

The GetCertificate method returns the certificate issued for the request, packaged in a PKCS#7 message, including the complete certificate chain for the certificate server.

[VB] BSTR GetCertificate(
  long Flags  
);
 
[JAVA] java.lang.String GetCertificate(
  int Flags  
);
 
[C++] HRESULT GetCertificate(
  LONG Flags,              // in
  BSTR *pstrCertificate    // out, return value
);
 

Parameters

[VB][JAVA][C++] Flags
One of the following flags can be used to specify the format of the returned certificate.
Certificate Format Flag Description
CR_OUT_BASE64HEADER BASE64 format with begin/end.
CR_OUT_BASE64 BASE64 format without begin/end.
CR_OUT_BINARY Binary format.

The following flag can be used to specify that the complete certificate chain should be included with the requested certificate. Otherwise, just the requested certificate is returned.
Certificate Flag Description
CR_OUT_CHAIN Include complete certificate chain.

For example, to retrieve a binary certificate with complete certificate chain, in C++ you would write:

hResult = GetCertificate(CR_OUT_BINARY | CR_OUT_CHAIN, &pstrCert); 
 
[C++] pstrCertificate
Points to the return value. See Return Values.

Return Values

Returns the requested certificate.

QuickInfo

  Windows NT: Requires version 5.0 or later (or version 4.0 with the Windows NT 4.0 Option Pack).
  Windows: Unsupported.
  Windows CE: Unsupported.
  Header: Declared in certcli.h.
  Import Library: Use certidl.lib.