'Process a --csr flag.'

def handle_csr(self, parsed_args):

    if (parsed_args.verb != 'certonly'):
        raise errors.Error('Currently,    a    CSR    file    may    only    be    specified    when    obtaining    a    new    or    replacement    via    the    certonly    command.    Please    try    the    certonly    command    instead.')
    if parsed_args.allow_subset_of_names:
        raise errors.Error('--allow-subset-of-names    cannot    be    used    with    --csr')
    (csrfile, contents) = parsed_args.csr[0:2]
    (typ, csr, domains) = crypto_util.import_csr_file(csrfile, contents)
    for domain in domains:
        add_domains(parsed_args, domain)
    if (not domains):
        raise errors.Error(('Unfortunately,    your    CSR    %s    needs    to    have    a    SubjectAltName    for    every    domain' % parsed_args.csr[0]))
    parsed_args.actual_csr = (csr, typ)
    csr_domains = set([d.lower() for d in domains])
    config_domains = set(parsed_args.domains)
    if (csr_domains != config_domains):
        raise errors.ConfigurationError('Inconsistent    domain    requests:\nFrom    the    CSR:    {0}\nFrom    command    line/config:    {1}'.format(',    '.join(csr_domains), ',    '.join(config_domains)))
