X509 interfaces

Replaces #1267.

**Update: simplified interfaces so the below questions are irrelevant until we expand them in future PRs**

Two outstanding questions:

- Do we want to blow up when an X509Name has multiple identical OIDs in a single Name?
- Do we want to blow up when an X509Certificate has multiple extensions with the same OID?

These are both things you Should Not Do™, but since it's all ASN.1 under the hood nothing technically prohibits the existence of certificates and names that do this.

A bit more detail than is in the PR:

- `version` will return an enum object that will correspond to v1 or v3. Leaving it an integer is a mistake many other APIs have made to their sorrow.

I've decided to go down the path of keeping the interface small and having `get_extension` and `get_item`. When the requested OID is not available we will raise the exceptions that are added here.
Cool deal. thanks.

On Mon Nov 24 2014 at 2:13:27 PM Paul Kehrer <notifications@github.com>
wrote:

> In docs/hazmat/backends/interfaces.rst:
>
> > @@ -512,3 +512,17 @@ A specific ``backend`` may provide one or more of these interfaces.
> >          :raises cryptography.exceptions.UnsupportedAlgorithm: If the data is
> >              encrypted with an unsupported algorithm.
> >
> > +
> > +.. class:: X509Backend
> > +
> > +    .. versionadded:: 0.7
> > +
> > +    A backend with methods for working with X.509 objects.
> > +
> > +    .. method:: load_pem_x509_certificate(data)
> > +
> > +        :param bytes data: PEM formatted certificate data.
> > +
> > +        :returns: An instance of a
> > +            :class:`~cryptography.hazmat.primitives.interfaces.X509Certificate`
> > +            provider.
>
> Yeah, that sounds less confusing. I'll change it. We've got a lot of
> places to update in the docs for that if we're going to switch (I'll put
> that up as a separate PR).
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/pyca/cryptography/pull/1442/files#r20826878>.
>