Historical Content Alert
This is a historical content for Windows NT 4.0 product and is presented for informative purposes only. All content in this directory is copyrighted and owned by Microsoft.


The GetCACertificate method returns the root certificate for the certificate server.

[VB] BSTR GetCACertificate(
  long fExchangeCertificate,  
  BSTR strConfig,             
  long Flags                  
[JAVA] java.lang.String GetCACertificate(
  int fExchangeCertificate,  
  java.lang.String strConfig,  
  int Flags                  
[C++] HRESULT GetCACertificate(
  LONG fExchangeCertificate,  // in
  BSTR const strConfig,       // in
  LONG Flags,                 // in
  BSTR * strCertificate       // out, return value


[VB][JAVA][C++] fExchangeCertificate
A boolean value specifying which CA certificate to return. If set to TRUE, the CA's Exchange certificate will be returned. The CA's Exchange certificate can be used to encrypt requests sent to the CA. If set to FALSE, the CA's Signature certificate will be returned. The CA's Signature certificate can be used to verify signatures on certificates issued by the CA.
[VB][JAVA][C++] strConfig
Points to a valid configuration string for the certificate server. See ICertConfig::GetConfig.
[VB][JAVA][C++] Flags
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 CA certificate. Otherwise, just the requested CA certificate is returned.

Certificate Flag Description
CR_OUT_CHAIN Include complete certificate chain.

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

hResult = GetCACertificate(CR_OUT_BINARY | CR_OUT_CHAIN, &pstrCert);

[C++] strCertificate
Points to the return value. See Return Values.

Return Values

Returns the root certificate for the certificate server, in the specified format.

Share this article: