@classmethod<EOL><INDENT>def from_string(cls, key, password='<STR_LIT>'):<DEDENT>
key = _helpers._from_bytes(key)  <EOL>marker_id, key_bytes = pem.readPemBlocksFromFile(<EOL>six.StringIO(key), _PKCS1_MARKER, _PKCS8_MARKER)<EOL>if marker_id == <NUM_LIT:0>:<EOL><INDENT>pkey = rsa.key.PrivateKey.load_pkcs1(key_bytes,<EOL>format='<STR_LIT>')<EOL><DEDENT>elif marker_id == <NUM_LIT:1>:<EOL><INDENT>key_info, remaining = decoder.decode(<EOL>key_bytes, asn1Spec=_PKCS8_SPEC)<EOL>if remaining != b'<STR_LIT>':<EOL><INDENT>raise ValueError('<STR_LIT>', remaining)<EOL><DEDENT>pkey_info = key_info.getComponentByName('<STR_LIT>')<EOL>pkey = rsa.key.PrivateKey.load_pkcs1(pkey_info.asOctets(),<EOL>format='<STR_LIT>')<EOL><DEDENT>else:<EOL><INDENT>raise ValueError('<STR_LIT>')<EOL><DEDENT>return cls(pkey)<EOL>
Construct an RsaSigner instance from a string.

        Args:
            key: string, private key in PEM format.
            password: string, password for private key file. Unused for PEM
                      files.

        Returns:
            RsaSigner instance.

        Raises:
            ValueError if the key cannot be parsed as PKCS#1 or PKCS#8 in
            PEM format.