<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix"><tt>(top posting because OP did so)</tt><tt><br>
      </tt><tt><br>
      </tt><tt>Note that as I already said, checking the template name<br>
        is usually a mistake, unless you happen to know that<br>
        some other software will reject certificates without<br>
        specific template names.</tt><tt><br>
      </tt><tt><br>
      </tt><tt>It is much more relevant (and should be done even if<br>
        the template name is also checked) to check all the<br>
        specific certificate properties (extensions, basic<br>
        settings, name forms etc.) against the requirements. <br>
        <br>
        Tests such as:</tt><tt><br>
      </tt><tt><br>
      </tt><tt>Does it include the required set of key usages and<br>
        extended key usages?</tt><tt><br>
      </tt><tt><br>
      </tt><tt>Does it include any neither required nor optional<br>
        (and thus unwanted) key usages or extended key<br>
        usages?</tt><tt><br>
      </tt><tt><br>
      </tt><tt>Does the Subject Name have the required form and<br>
        the required fields?</tt><tt><br>
      </tt><tt><br>
      </tt><tt>Does it include any required "Subject Alternate<br>
        Names".</tt><tt><br>
      </tt><tt><br>
      </tt><tt>Does it include any unwanted "Subject Alternate<br>
        Names".</tt><tt><br>
      </tt><tt><br>
      </tt><tt>Is the key of the required type and size?</tt><tt><br>
      </tt><tt><br>
      </tt><tt>Is the signature on the certificate of the required<br>
        type and size?</tt><tt><br>
      </tt><tt><br>
      </tt><tt>Etc. Etc.</tt><tt><br>
      </tt><tt><br>
      </tt><tt>Basically, look at valid certificates and create a<br>
        test for each of the fields/attributes</tt><tt>.</tt><tt><br>
      </tt><tt><br>
      </tt><tt>This way, unless some other broken software tests the<br>
        template name, the testing will be correct even if at<br>
        some later stage a "variant" template is created for<br>
        some subset of the certificates used for this purpose.<br>
        For example, a special template for servers in the HR<br>
        department.</tt><tt><br>
      </tt><br>
      On 28/04/2015 10:08, Franks Andy (IT Technical Architecture
      Manager) wrote:<br>
    </div>
    <blockquote
      cite="mid:20150428080849.E293D449C52@nhs-pd1e-esg105.ad1.nhs.net"
      type="cite">
      <pre wrap="">Thanks Rich, Jakob. 
So, can I use openssl as it is to query the values of the extension on an existing certificate do you think? The usual issue seems that people want to use openssl to form a request and insert the ms CA template name in there otherwise it complains. I don't want to do that, I want to take a presented certificate (to freeradius) and perform something in the shell that will check  against acceptable template names (and that the certificate chains properly, but that's not a problem).
I can't find anything on google citing that someone has achieved it so far.
Thanks again.
Andy

-----Original Message-----
From: openssl-users [<a class="moz-txt-link-freetext" href="mailto:openssl-users-bounces@openssl.org">mailto:openssl-users-bounces@openssl.org</a>] On Behalf Of Jakob Bohm
Sent: 28 April 2015 04:17
To: <a class="moz-txt-link-abbreviated" href="mailto:openssl-users@openssl.org">openssl-users@openssl.org</a>
Subject: Re: [openssl-users] Certificate template information

On 28/04/2015 02:59, Salz, Rich wrote:
</pre>
      <blockquote type="cite">
        <blockquote type="cite">
          <pre wrap="">I have need to identify a Microsoft generated certificate's template name, I believe as part of oid 1.3.6.1.4.1.311.21.7
</pre>
        </blockquote>
        <pre wrap="">Where, in a cert OtherName field?
</pre>
      </blockquote>
      <pre wrap="">It is an extension.  Microsoft certificate server (their
bundled CA software) puts the name of the "certificate
template" (analogous to an openssl.cnf section) in a
certificate extension, and a few other Microsoft tools
unfortunately check this name in addition to more
relevant conditions such as EKU values etc.

The form I know of can be implemented as follows in
openssl.cnf (in the [sometemplatename_cert] section of
the file):

#     enrollCerttypeExtension (1 3 6 1 4 1 311 20 2)
#   OCTET STRING, encapsulates {
#     BMPString 'SomeTemplateName'
#     }
#   }
1.3.6.1.4.1.311.20.2 = ASN1:BMP:SomeTemplateName

I am not sure about the 1.3.6.1.4.1.311.21.7 OID, but it
might be similar.

Enjoy

Jakob
</pre>
    </blockquote>
    <br>
    <br>
    <pre class="moz-signature" cols="72">Enjoy

Jakob
-- 
Jakob Bohm, CIO, Partner, WiseMo A/S.  <a class="moz-txt-link-freetext" href="http://www.wisemo.com">http://www.wisemo.com</a>
Transformervej 29, 2860 Søborg, Denmark.  Direct +45 31 13 16 10
This public discussion message is non-binding and may contain errors.
WiseMo - Remote Service Management for PCs, Phones and Embedded </pre>
  </body>
</html>