@classmethod<EOL><INDENT>def from_string(cls, string):<DEDENT>
fields = string.split(None, <NUM_LIT:2>)<EOL>if len(fields) < <NUM_LIT:2>:<EOL><INDENT>msg = "<STR_LIT>"<EOL>raise ValueError(msg.format(fields))<EOL><DEDENT>key_type = fields[<NUM_LIT:0>]<EOL>key_blob = decodebytes(b(fields[<NUM_LIT:1>]))<EOL>try:<EOL><INDENT>comment = fields[<NUM_LIT:2>].strip()<EOL><DEDENT>except IndexError:<EOL><INDENT>comment = None<EOL><DEDENT>m = Message(key_blob)<EOL>blob_type = m.get_text()<EOL>if blob_type != key_type:<EOL><INDENT>deets = "<STR_LIT>".format(<EOL>key_type, blob_type<EOL>)<EOL>raise ValueError("<STR_LIT>".format(deets))<EOL><DEDENT>return cls(type_=key_type, blob=key_blob, comment=comment)<EOL>
Create a public blob from a ``-cert.pub``-style string.