'Load a user certificate and keypair from the specified file paths.
Extracts the username from the parsed certificate.
:param FilePath certificate_path: Absolute path to the user
certificate file.
:param FilePath key_path: Absolute path to the user private key file.
:return: A ``UserCredential`` instance representing the parsed data.'

@classmethod
def from_files(cls, certificate_path, key_path):

    certificate = load_certificate_file(certificate_path)
    keypair = load_key_file(key_path)
    dn = certificate.getSubject()
    username = dn.CN.decode('utf-8').replace(u'user-', u'', 1)
    credential = FlockerCredential(path=certificate_path.parent(), keypair=keypair, certificate=certificate)
    return cls(credential=credential, username=username)
