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.,, -- 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.


  • Check out javadoc for


  • 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?
Page edit