def METHOD_NAME(self, body, chain, key, options, **kwargs):
    """
    Generates a PKCS#12 archive.
    :param key:
    :param chain:
    :param body:
    :param options:
    :param kwargs:
    """
    if self.get_option("passphrase", options):
        passphrase = self.get_option("passphrase", options)
    else:
        passphrase = get_psuedo_random_string()
    if self.get_option("alias", options):
        alias = self.get_option("alias", options)
    else:
        alias = common_name(parse_certificate(body))
    type = self.get_option("type", options)
    with mktemppath() as output_tmp:
        if type == "PKCS12 (.p12)":
            if not key:
                raise Exception("Private Key required by {0}".format(type))
            create_pkcs12(body, chain, output_tmp, key, alias, passphrase)
            extension = "p12"
        elif type == "legacy PKCS12 (.p12)":
            if not key:
                raise Exception("Private Key required by {0}".format(type))
            create_pkcs12(body, chain, output_tmp, key, alias, passphrase, legacy=True)
            extension = "p12"
        else:
            raise Exception("Unable to export, unsupported type: {0}".format(type))
        with open(output_tmp, "rb") as f:
            raw = f.read()
    return extension, passphrase, raw