ICertEncodeSampleStructure1 Interface

The ICertEncodeSampleStructure1 interface provides methods that demonstrate how to handle a custom structure to be used in certificate extensions. A certificate extension can be created using a custom structure stored in an extension handler COM object instantiated by the policy module.

The interface methods are designed to handle the _CERT_SAMPLE_STRUCTURE1_INFO sample data structure. This data structure is defined as follows:

typedef struct _CERT_SAMPLE_STRUCTURE1_INFO
{
DWORD dwVersion;
WCHAR * pwszField1;
WCHAR * pwszField2;
LONG lField3;
CRYPT_DATA_BLOB blobField4;
FILETIME dateField5;
} CERT_SAMPLE_STRUCTURE1_INFO;

The following methods are provided by the ICertEncodeSampleStructure1 interface.

Method Description
Decode Decodes an ASN encoded CERT_SAMPLE_STRUCTURE1_INFO structure and stores the resulting structure in the COM object.
Encode Performs ASN encoding on a CERT_SAMPLE_STRUCTURE1_INFO structure stored in the COM object and returns the ASN encoded structure.
GetBinaryField4 Returns the binary value contained in the blobField4 field of the CERT_SAMPLE_STRUCTURE1_INFO structure.
GetDateField5 Returns the date value contained in the dateField5 field of the CERT_SAMPLE_STRUCTURE1_INFO structure.
GetLongField3 Returns the long value contained in the lField3 field of the CERT_SAMPLE_STRUCTURE1_INFO structure.
GetStringField1 Returns the string value contained in the pwszField1 field of the CERT_SAMPLE_STRUCTURE1_INFO structure.
GetStringField2 Returns the string value contained in the pwszField2 field of the CERT_SAMPLE_STRUCTURE1_INFO structure.