add PKCS8SerializationBackend support to MultiBackend

Maybe just rename it UNSUPPORTED_SERIALIZATION?


On 7 July 2014 21:10:04 Paul Kehrer <notifications@github.com> wrote:

> > @@ -302,3 +303,15 @@ def elliptic_curve_public_key_from_numbers(self, 
> numbers):
> >              "This backend does not support this elliptic curve.",
> >              _Reasons.UNSUPPORTED_ELLIPTIC_CURVE
> >          )
> > +
> > +    def load_pkcs8_pem_private_key(self, data, password):
> > +        for b in self._filtered_backends(PKCS8SerializationBackend):
> > +            try:
> > +                return b.load_pkcs8_pem_private_key(data, password)
> > +            except UnsupportedAlgorithm:
> > +                continue
> > +
> > +        raise UnsupportedAlgorithm(
> > +            "This backend does not support this key format.",
> > +            _Reasons.UNSUPPORTED_KEY_FORMAT
>
> Arguably that would make the key's format unsupported since it's encrypted 
> with an unsupported cipher, but I invented the reason because we use 
> reasons on `UnsupportedAlgorithm` exceptions and I couldn't think of a 
> better name. I am open to alternate proposals.
>
> ---
> Reply to this email directly or view it on GitHub:
> https://github.com/pyca/cryptography/pull/1222/files#r14619111