What is the difference between
.cert certificate files?
Do we distribute
.cert for client authentication?
Information Security Stack Exchange is a question and answer site for information security professionals. It only takes a minute to sign up.Sign up to join this community
There are two objects: the private key, which is what the server owns, keeps secret, and uses to receive new SSL connections; and the public key which is mathematically linked to the private key, and made "public": it is sent to every client as part of the initial steps of the connection.
The certificate is, nominally, a container for the public key. It includes the public key, the server name, some extra information about the server, and a signature computed by a certification authority (CA). When the server sends its public key to a client, it actually sends its certificate, with a few other certificates (the certificate which contains the public key of the CA which signed its certificate, and the certificate for the CA which signed the CA's certificate, and so on). Certificates are intrinsically public objects.
Some people use the term "certificate" to designate both the certificate and the private key; this is a common source of confusion. I personally stick to the strict definition for which the certificate is the signed container for the public key only.
.pfx file is a PKCS#12 archive: a bag which can contain a lot of objects with optional password protection; but, usually, a PKCS#12 archive contains a certificate (possibly with its assorted set of CA certificates) and the corresponding private key.
On the other hand, a
.crt) file usually contains a single certificate, alone and without any wrapping (no private key, no password protection, just the certificate).
I know this is a year-old thread, but for future readers, as mentioned above, no you do not distribute the .pfx file because that is the file containing the private key. You can extract and distribute the certificate (which is public) from the .pfx file via the method described here: https://stackoverflow.com/questions/403174/convert-pfx-to-cer
What is the difference between .pfx and .cert certificate files?
The answer that @Thomas Pornin gave is pretty good.
Do we distribute .pfx or .cert for client authentication?
That depends on the process used.
The typical process for setting up an external client to authenticate using a certificate is as follows: 1) the client generates an asymmetric key pair (public and private keys); 2) the client generates a certificate signing request for the public key and sends this to the server; 3) the server signs the public key and returns this signature (the "certificate") to the client; 4) the client stores the private key along with this certificate in its keystore. Now when the client connects to the server, the certificate is presented and the client is authenticated.
In the above scenario, a ".cert" is sent back to the client.
Internally, many organizations will perform this process for their employees. In this situation, the following occurs: the IT staff generates the public and private key pair for an employee along with the certificate signing request. They then sign the public key (using their Private certificate authority) and place the resulting certificate, along with the corresponding private key and all intermediate CA certificates (the "certificate chain"), in the user's keystore.
In this scenario, a ".pfx" (or ".pem") would be appropriate as it would contain all items needed for client authentication: the private key, the certificate, and the certificate chain.
Search for "Certificate Auto-Enrollment" for a way to automate this process for your enterprise users and devices.