def install_key(self, keyfile, authorized_keys):
<EOL>try:<EOL><INDENT>os.makedirs(os.path.dirname(authorized_keys), <NUM_LIT>)<EOL><DEDENT>except OSError:<EOL><INDENT>pass<EOL><DEDENT>keydata = open(keyfile).read()<EOL>target_fd = os.open(authorized_keys, os.O_RDWR | os.O_CREAT, <NUM_LIT>)<EOL>self.install_key_data(keydata, os.fdopen(target_fd, '<STR_LIT>'))<EOL>
Install a key into the authorized_keys file.