title: Which parts of the client certificate to use when uniquely identifying users?
body: <p>I'm designing a system where users will be able to register and afterward authenticate with client certificates in addition to username/password authentication.</p>
  <p>The client certificates will have to be valid certificates issued by a configured list of certificate authorities and will be checked (validated) when presented.</p>
  <p>In the registration phase, I need to store part(s) of the client certificate in a user repository (DB, LDAP, whatever) so that I can map the user who authenticates with client certificate to an internal &quot;user&quot;.</p>
  <p>One fairly obvious choice would be to use certificate fingerprint; But fingerprint itself is not enough, since collisions may occur (even though they're not probable), so we need to store additional information from the certificate. <a href="https://stackoverflow.com/questions/1086084/ssl-authentication-by-comparing-certificate-fingerprint">This SO question</a> is also informative in this regard.</p>
  <p><a href="https://www.rfc-editor.org/rfc/rfc2459" rel="nofollow noreferrer">RFC 2459</a> defines (4.1.2.2) that certificate serial number must be unique within a given CA.</p>
  <p>With all of this combined, I'm thinking of storing certificate serial number and certificate issuer for each registered user. Given that client certificates will be verified and valid, this should uniquely identify each client certificate. That way, even when client certificate is renewed, it would still be valid (serial number stays the same, and so does the issuer).</p>
  <p>Did I miss something?</p>