This is one of the most critical areas in security systems - on many occasions systems have been broken, not because of a poor encryption algorithm, but because of poor key selection or management. It is absolutely critical to get this right!
The simplest - but only applicable when the is personal contact between the recipient and the key issuer. Nonetheless, no matter what other mechanism is used - at some point a physical key transfer is going to be required to bootstrap the system. Examples include issue of logins/passwords, passport applications, and soon digital certificate applications (cf Australia Post).
Here use a trusted intermediary, whom all parties trust, to mediate the establishment of secure communications between them. Must trust intermediary not to abuse the knowledge of all session keys.
Here use a trusted notary to certify the identity of users and their public keys. With this model, the notary does not have access to the encrypted communications, hence less trust is required (but public key crypto is needed, see later).
public key certificates
If using public key techniques, then the usual approach is to use the services of a CA, which is trusted only to verify that a public key belongs to some named identity. Note that the CA does not (necessary) know the private key, hence can't decrypt or forge messages, unlike a private key server. So the level of trust in a CA is lower. Mind you - governments seem to want to generate private keys on user's behalf.....
X.509 is the Internationaly accepted standard for how to construct a public key certificate, and is becoming widely used. It has gone through several versions. See Stallings section 11.2 for discussion.
CA<<User>> means CA has
signed certificate details for User
The X.509 certificate is the heart of the standard. There are 3 versions, with successively more info in the certificate - must be v2 if either unique ident field exists, must be v3 if any extensions are used.
The extension field provides a general mechanism for adding new info into a certificate, sometimes standardised, sometimes simply de facto. Of particular interest is the extensions to do with trust, and the policies used in creating certificates. Currently these are just free form text, and hence cannot be automatically processed. There is a lot of debate, and not much agreement on how better to do this - but "trust" IS the key issue here.
All very easy is both parties use the same CA. If not, then there has to be some means to form a chain of certifications between the CA's used by the two parties. And that raises issues about whether the CA's are equivalent, whether they used the same policies to generate their certificates, and how much you're going to trust a CA at some remove from your own. These are all open issues.

This illustration shows the chain of certificates required for A and B to verify each other's certificates. Note the ordering used for each.
| Class | Identity Checks | Usage |
|---|---|---|
| Class 1 | automated name/email check | web browsing/email |
| Class 2 | + automated enrollment/address check | inter/intranet email,subscriptions,s/w validate |
| Class 3 | + ID documents sighted | e-banking/service access etc |
Whilst X.509 supposedly supports hierarchies of CA's, given the issues associated with trusting a chain of certifications, in practise we currently see only single-level CA's - where users share one or more CA's whose public keys they know or both learn and verify somehow. The most common are the ones whose CA certificates are distributed in every copy of Explorer/Netscape. Of these, Verisign have brought out most of the rest! Note the different classes of certificates Verisgn issue (at successively higher charges). There is an equivalent set of classes for business users. Seeing increasing use of such certificates for online services from gvt, business & the Uni.
The X.509 standard specifies the authentication protocols that can be used when obtaining and using certificates. 1-way for unidirectional messages (like email), 2-way for interactive sessions when timestamps are used, 3-way for interactive sessions with no need for timestamps (and hence synchronised clocks).