@classmethod<EOL><INDENT>def _from_p12_keyfile_contents(cls, service_account_email,<EOL>private_key_pkcs12,<EOL>private_key_password=None, scopes='<STR_LIT>',<EOL>token_uri=oauth2client.GOOGLE_TOKEN_URI,<EOL>revoke_uri=oauth2client.GOOGLE_REVOKE_URI):<DEDENT>
if private_key_password is None:<EOL><INDENT>private_key_password = _PASSWORD_DEFAULT<EOL><DEDENT>if crypt.Signer is not crypt.OpenSSLSigner:<EOL><INDENT>raise NotImplementedError(_PKCS12_ERROR)<EOL><DEDENT>signer = crypt.Signer.from_string(private_key_pkcs12,<EOL>private_key_password)<EOL>credentials = cls(service_account_email, signer, scopes=scopes,<EOL>token_uri=token_uri, revoke_uri=revoke_uri)<EOL>credentials._private_key_pkcs12 = private_key_pkcs12<EOL>credentials._private_key_password = private_key_password<EOL>return credentials<EOL>
Factory constructor from JSON keyfile.

        Args:
            service_account_email: string, The email associated with the
                                   service account.
            private_key_pkcs12: string, The contents of a PKCS#12 keyfile.
            private_key_password: string, (Optional) Password for PKCS#12
                                  private key. Defaults to ``notasecret``.
            scopes: List or string, (Optional) Scopes to use when acquiring an
                    access token.
            token_uri: string, URI for token endpoint. For convenience defaults
                       to Google's endpoints but any OAuth 2.0 provider can be
                       used.
            revoke_uri: string, URI for revoke endpoint. For convenience
                        defaults to Google's endpoints but any OAuth 2.0
                        provider can be used.

        Returns:
            ServiceAccountCredentials, a credentials object created from
            the keyfile.

        Raises:
            NotImplementedError if pyOpenSSL is not installed / not the
            active crypto library.