Which of the following is more appropriate to use as an identification field in a database to represent a client, when two-way SSL authentication is used?
The client's X500Principal
OR
The thumbprint of the client's certificate
Which of the following is more appropriate to use as an identification field in a database to represent a client, when two-way SSL authentication is used?
The client's X500Principal
OR
The thumbprint of the client's certificate
What is appropriate depends on what you are doing with the authentication information, but in general I would guess that you want to use the subject distinguished name (DN) which you can retrieve with the java.security.cert.X509Certificate.getSubjectX500Principal
method.
The thumbprint will change when the certificate expires and the user renews it, but of course the user's identity will remain the same.