IX509ExtensionTemplate interface (certenroll.h)

The IX509ExtensionTemplate interface defines methods and properties that can be used to initialize or retrieve a CertificateTemplate extension. This extension can be placed in the certificate request to tell the certification authority what template to use when issuing or renewing a certificate.

Note  The CertificateTemplate extension is used to identify version 2 templates. To identify a version 1 template, you can use the CertificateTemplateName extension defined by the IX509ExtensionTemplateName interface.

The following syntax shows the Abstract Syntax Notation One (ASN.1) structure of the extension. The extension value is encoded by using Distinguished Encoding Rules (DER) and included in the certificate request.

-- CertificateTemplate

CertificateTemplate ::= SEQUENCE 
   templateID              EncodedObjectID,
   templateMajorVersion    TemplateVersion,
   templateMinorVersion    TemplateVersion OPTIONAL

TemplateVersion ::= INTEGER (0..4294967295)

To add this extension object to a PKCS #10 request or a CMC request, you must first add it to an IX509Extensions collection and use the collection to initialize an IX509AttributeExtensions object. For more information, see the PKCS #10 Extensions and the CMC Extensions topics.


The IX509ExtensionTemplate interface inherits from IX509Extension. IX509ExtensionTemplate also has these types of members:


The IX509ExtensionTemplate interface has these methods.


Retrieves the minimum major version number of the certificate template.

Retrieves the minimum minor version number of the certificate template.

Retrieves the template object identifier (OID).

Initializes the extension from a DER-encoded byte array that contains the extension value.

Initializes the extension from a template object identifier (OID) and from major and minor version numbers.


Requirement Value
Minimum supported client Windows Vista [desktop apps only]
Minimum supported server Windows Server 2008 [desktop apps only]
Target Platform Windows
Header certenroll.h

See also

CertEnroll Interfaces