Assignment for week 6: The goal is to study and use OpenSSL API on two tasks - generate an RSA key pair and work with TLS certificate validation. Deadline: November 24, 2020 (8:00 AM), maximum is 5+5 points. Write two simple programs using OpenSSL library on Linux. 1) Create a simple program that generates 4096 bit RSA key with public exponent 65537 and print private and public output to the screen. Hints: - Use RSA_generate_key_ex() function. - Use PEM_read/write_PrivateKey or BIO based PEM_read/write_bio_PrivateKey (the same for public key). 2) Create a program that will connect to https port (443) of faculty web server (www.fi.muni.cz) and prints info about the whole certification chain provided by server. The info for www.fi.muni.cz must contain: - Issuer - Subject - "Not before" certificate validity date - "Not after" certificate date Example output format (for google.com): Cert 0 Issuer: GTS CA 1O1 Subject: www.google.com Not before: Oct 28 16:23:45 2020 GMT Not after: Jan 20 16:23:45 2021 GMT Cert 1 Issuer: GlobalSign Subject: GTS CA 1O1 Not before: Jun 15 00:00:42 2017 GMT Not after: Dec 15 00:00:42 2021 GMT Cert 2 Issuer: GlobalSign Subject: GlobalSign Not before: Dec 15 08:00:00 2006 GMT Not after: Dec 15 08:00:00 2021 GMT Hints: - You can modify 7_tls_client_openssl example (it already contains Issuer and Subject). - Print info about *all* (server and CA) certificates, not only the server one. - For validity dates use X509_get0_notBefore() and X509_get0_notAfter() and ASN1 date helper function ASN1_TIME_print() Your submitted archive should contain *two* C programs above and Makefiles. The source code must be compilable on the provided virtual machine (Linux Fedora) or on aisa server.