Subject: [pkix] URN namespace for certs (pkix ietf84 presentation)

From: [email-masked] (Martin Rex)
Date: Thu, 2 Aug 2012 02:10:31 +0200 (CEST)

A few comments on the presentation about the URN Namespace for Certificates
from the IETF 84 PKIX WG session.

There are existing standards for identifying certificates in textual form,
and that is XMLdsig and standards derived from it (WS-Security from OASIS),

>From the top of my head, the following references are defined:

  (a)  Subject Name (of the certificate)
  (b)  Issuer & Serial
  (c)  SubjectKeyIdentifier
  (d)  the cert itself (base64-encoded)

I see a problem with the proposal of using a certificate hash in case
there are situation when the certificate itself is _not_ conveyed along
with the message.

There are usage scenarios where instead of using a PKI, the consumer
may decided to configure direct trust to the peer certificate.
In order to do that, the consumer might have to import the certificate
as "trust anchor", and potentially it is persisted in one of the
formats defined for trust anchors in rfc5914

>From the three trust anchor formats defined in rfc5914, one is only the
ToBeSigned part of a certificate, so a certificate hash is useless to
find/identify that trust anchor, and for the trust anchor format
"TrustAnchorInfo", storing the certificate is purely optional,
so again, matching of a certificate hash may simply impossible.

With respect to existing standards for referencing certificate
in textual formats, look here:

The WSS-X509TokenProfile-20040315.pdf document lists the
following token references in Section 3.2:

http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0.pdf

  3.2 Token References

  In order to ensure a consistent processing model across all the
  token types supported by WSS:SOAP Message Security,
  the <wsse:SecurityTokenReference> element SHALL be used to specify all
  references to X.509 token types in signature or encryption elements
  that comply with this profile.

  A <wsse:SecurityTokenReference> element MAY reference an X.509 token
  type by one of the following means:

    Reference to a Subject Key Identifier
       The <wsse:SecurityTokenReference> element contains
       a <wsse:KeyIdentifier> element that specifies the token data
       by means of a X.509 SubjectKeyIdentifier reference.

    Reference to a Binary Security Token
       The <wsse:SecurityTokenReference> element contains a <wsse:Reference>
       element that references a local <wsse:BinarySecurityToken> element
       or a remote data source that contains the token data itself.

    Reference to an Issuer and Serial Number
       The <wsse:SecurityTokenReference> element contains a <ds:X509Data>
       element that contains a <ds:X509IssuerSerial> element that uniquely
       identifies an end entity certificate by its X.509 Issuer and
       Serial Number.

The basic XMLdsig spec is less specific here:
http://www.w3.org/TR/xmldsig-core/#sec-KeyInfo

http://www.w3.org/TR/xmldsig-core/#dname-encrules

   4.4.4.1 Distinguished Name Encoding Rules

     [...]

   Schema Definition

   <element name="X509Data" type="ds:X509DataType"/> 
   <complexType name="X509DataType">
     <sequence maxOccurs="unbounded">
       <choice>
         <element name="X509IssuerSerial" type="ds:X509IssuerSerialType"/>
         <element name="X509SKI" type="base64Binary"/>
         <element name="X509SubjectName" type="string"/>
         <element name="X509Certificate" type="base64Binary"/>
         <element name="X509CRL" type="base64Binary"/>
         <any namespace="##other" processContents="lax"/>
       </choice>
     </sequence>
   </complexType>

   <complexType name="X509IssuerSerialType"> 
     <sequence> 
       <element name="X509IssuerName" type="string"/> 
       <element name="X509SerialNumber" type="integer"/> 
     </sequence>
   </complexType>

-Martin