Chapter 4. PKI with Java

Public key cryptography alone is not sufficient for realizing the security services of data integrity, confidentiality, identification, authentication and non-repudiation. Think of this simple scenario: Alice wants to send a message to Bob for his eyes only and with the assurance that the message is from her only and no one else. To accomplish this, she signs the message with her private key and encrypts the signed message with Bob's public key. On receipt of the encrypted message, Bob decrypts it using his private key and verifies the signature with Alice's public key. As only Bob could decrypt the message, neither Alice nor Bob has to worry about someone else intercepting and reading it. Also, Alice's signature, verified with her public key, is the proof that the message originated from her and no one else. Mission accomplished.[1]

[1] This “sign and encrypt” mechanism suffers from a kind of surreptitious forward attack as Bob can encrypt the decrypted message with Charlie's public key and send it to Charlie, as if Alice sent the message to Charlie for his eyes only. There are many different ways to thwart this attack; the simplest one requires including information about the sender and the intended recipient in the message itself.

However, this simple mechanism makes a number of assumptions: both Alice and Bob must have public and private key pairs; they must be able to prove possession of their private keys; Alice has Bob's public key and Bob has Alice's public key; they have compatible programs to access the keys and messages; they are able to report a compromised key and get a new one, and so on. Also, Alice and Bob may not know each other in the physical world and may not have had a chance to exchange the keys in person.

To be able to use the power of public key cryptography, there have to be mechanisms in place so that Alice and Bob are able to create public and private key pairs, distribute their public keys with identification data and use the keys for authentication, encryption and signature.

PKI, short for Public Key Infrastructure, offers such a mechanism. It does so by establishing standards to encode key and identification data, individual and organizational roles and responsibilities, trust relationships, processing rules, and agreed upon conventions of interactions. The standards and abstractions defined by PKI, also known as PKI components, form the backbone of cryptography-based security services. As a developer and operator of Java-based secure systems, you will be dealing with these components routinely.

The objective of this chapter is to learn about the PKI components and use Java APIs and tools to perform PKI operations. Source files of example programs illustrating use of Java PKI APIs are available in srcjsbookch4 directory of JSTK installation. As we see, Java platform has good API-level support for PKI but doesn't include readymade programs to carry out PKI operations. In the course of writing this book, I developed certtool and reptool utilities to fill these gaps. We learn more about these programs as we go over PKI operations and related Java APIs in this chapter.

These utility programs are packaged within JSTK software, the software accompanying this book. For more information about JSTK, refer to Appendix C: JSTK Tools.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
13.59.26.152