ICertServerExit::GetRequestProperty method (certif.h)

The GetRequestProperty method returns a named property from a request.

Note that the request is used to hold all associated states for the request and the eventual granted certificate that is not a part of the certificate. Thus, data such as revocation times and disposition data are kept in the request data object.

Syntax

HRESULT GetRequestProperty(
  [in]  const BSTR strPropertyName,
  [in]  LONG       PropertyType,
  [out] VARIANT    *pvarPropertyValue
);

Parameters

[in] strPropertyName

Specifies the property to retrieve. There is a stock set of certificate properties, referred to as the name properties, that are always valid and can be retrieved by calling this method. For information about these properties, see Name Properties.

Other properties valid for certificate requests include the request properties.

Note  The request's DistinguishedName and RawName properties are accessible by GetRequestProperty only if the certificate is requested by using a PKCS #10 certificate request or another supported request format that contains encoded subject name information. Note that KeyGen requests do not contain encoded subject name information.
 

The following properties are unique to requests and can be accessed by using the GetRequestProperty method.

Request property Meaning
Disposition
Signed long
Current request disposition
DispositionMessage
String
Informational disposition message
RawCACertificate
Binary
Certificate for the issuing certification authority
RawRequest
Binary
Raw request bytes
RequestAttributes
String
Attribute string (can be truncated)
RequesterName
String
The name of the requester in the form "DomainName\UserID"
RequestID
Signed long
Internal requestID
RequestType
Signed long
Indicates PKCS #10 or KeyGen request
ResolvedWhen
Date/time
When resolved
StatusCode
Signed long
Windows error for last operation
SubmittedWhen
Date/time
When arrived
 

The RequestType property will be one of the following values.

Value Meaning
CR_IN_PKCS7
PKCS #7 renewal or registration request
CR_IN_PKCS10
PKCS #10 request
CR_IN_KEYGEN
Keygen request (Netscape format)
 

In addition, other properties may be set by a specific request type, request extensions, or by named attributes set in the header of a request.

[in] PropertyType

Specifies the property type. The type can be one of the following types.

Value Meaning
PROPTYPE_LONG
Signed long data
PROPTYPE_DATE
Date/time
PROPTYPE_BINARY
Binary data
PROPTYPE_STRING
Unicode string data

[out] pvarPropertyValue

A pointer to the VARIANT that will contain the request property type.

Return value

C++

If the method succeeds, the method returns S_OK, and *pvarPropertyValue is set to the VARIANT that contains the request property value.

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 return value is the request property value.

Remarks

You must call ICertServerExit::SetContext prior to using this method.

Examples

BSTR      bstrPropName = NULL;
VARIANT   varProp;

VariantInit( &varProp );

bstrPropName = SysAllocString(L"RequestID");

// Retrieve the request property.
// pCertServerExit has been used to call SetContext previously.
hr = pCertServerExit->GetRequestProperty( bstrPropName,
                                          PROPTYPE_LONG,
                                          &varProp );
if (FAILED(hr))
{
    printf("Failed GetRequestProperty [%x]\n", hr);
    goto error;
}
else
{
    // Successfully retrieved property; use varProp as needed.
    // ...
}

// Done processing.
VariantClear( &varProp );
if ( NULL != bstrPropName )
    SysFreeString( bstrPropName );

Requirements

Requirement Value
Minimum supported client None supported
Minimum supported server Windows Server 2003 [desktop apps only]
Target Platform Windows
Header certif.h (include Certsrv.h)
Library Certidl.lib
DLL Certcli.dll

See also

ICertServerExit

ICertServerExit::SetContext

Name Properties