Lab 6 Exercise 1

Learn how to read X.509 certificate from file.

1.1. Get some (valid) X.509 certificate.

Simplest way to get a certificate to play with is to download one from some website using HTTPS. https://google.com/, https://twitter.com/, https://sso.ut.ee/ -- here are only few examples.

To access the certificate, click the favicon in the left part of address bar of your browser. Further process of certificate download may vary for different browsers and operating systems but shouldn't be a big problem (:

1.2. Read the saved certificate file in as Java object.

Print out the information contained in the certificate.

Hints:

  • Check out javadoc for java.security.cert.X509Certificate.

Q:

  • What encoding is certificate saved in?
  • How long is the certificate valid? Why so?
  • What is IssuerDN and what is SubjectDN? What format is used?
  • What is the signature algorithm? What exactly is signed?
Sidebar
Page edit