'Generate a certificate signed by the supplied root certificate.
:param FilePath output_path: Directory where the certificate will be
written.
:param CertificateAuthority authority: The certificate authority with
which this certificate will be signed.
:param unicode username: A UTF-8 encoded username to be included in
the certificate.
:param datetime begin: The datetime from which the generated
certificate should be valid.'

@classmethod
def initialize(cls, output_path, authority, username, begin=None):

    key_filename = (username + u'.key')
    cert_filename = (username + u'.crt')
    name = (u'user-' + username)
    organizational_unit = authority.organizational_unit
    dn = DistinguishedName(commonName=name, organizationalUnitName=organizational_unit)
    keypair = flocker_keypair()
    request = keypair.keypair.requestObject(dn)
    serial = os.urandom(16).encode('hex')
    serial = int(serial, 16)
    cert = sign_certificate_request(authority.credential.keypair.keypair, authority.credential.certificate.original.get_subject(), request, serial, EXPIRY_20_YEARS, 'sha256', start=begin, additional_extensions=[crypto.X509Extension('extendedKeyUsage', False, 'clientAuth')])
    credential = FlockerCredential(path=output_path, keypair=keypair, certificate=cert)
    credential.write_credential_files(key_filename, cert_filename)
    instance = cls(credential=credential, username=username)
    return instance
