O'Reilly logo

Java Security, 2nd Edition by Scott Oaks

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Identities

Now we’ll turn to the programmatic support for key management in Java 1.1, which is based on a set of classes that deal with the notion of identity: the entity to which a key belongs. An identity can represent an individual or a corporation (or anything else that can possess a public and a private key). Key management in 1.1 is only concerned with managing public and private keys; none of these classes understand the notion of a secret key.

The Identity Class

First we’ll look at the primary class used to encapsulate an entity that has a public key, the Identity class (java.security.Identity):

public abstract class Identity implements Principal, Serializable

Implement an identity -- an entity that has a public key. Although it is an abstract class, it contains no abstract methods.

An identity object holds only a public key; private keys are held in a different type of object (the signer object, which we’ll look at a little later). Hence, identity objects represent the entities in the world who have sent you their public keys in order for you to verify their identity.

An identity contains five pieces of information:

  • A name -- the name of the identity; this satisfies the Principal interface that the identity implements.

  • A public key.

  • An optional information string describing the identity.

  • An optional identity scope to which it belongs. Identities can be aggregated into a collection, which is called an identity scope.

  • A list of certificates that vouch for the identity.

Note ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required