Using TLS client certificates
In this section, we will learn how to use TLS client certificates: generate them, package them into Public Key Cryptography Standards #12 (PKCS #12) containers, request them from TLS servers, and supply them to TLS clients.
Generating TLS client certificates
Apart from a TLS server, a TLS client can also provide a certificate on a TLS connection. However, according to the TLS protocol, the TLS client does not send its certificate by default, even if the client has it. The TLS client only sends its certificate if the TLS server requests it.
Another peculiarity of TLS client certificates is that a client certificate is often stored together with its certificate private key (or rather a key pair) in the PKCS #12 format. PKCS #12 is a file format that can store several cryptographic objects, such as X.509 certificates and key pairs. These stored objects can be encrypted using a symmetric cipher and authenticated using a Hash-based Message Authentication...