Пример #1
0
        c.save()

        if cert_data['type'] == 'ca':
            password = cert_data.get('password')
            if password is not None:
                password = password.encode('utf-8')
            c.generate_ocsp_key(password=password)

    # create admin user for login
    User.objects.create_superuser('user', '*****@*****.**', 'nopass')

    ok()

    # create a chain file for the child
    chain = loaded_cas['child'].pub + loaded_cas['root'].pub
    chain_path = ca_storage.path(ca_storage.save('child-chain.pem', ContentFile(chain)))

    base_url = 'http://localhost:8000/'
    cwd = os.getcwd()
    rel = lambda p: os.path.relpath(p, cwd)  # NOQA
    root_ca_path = ca_storage.path(certs['root']['pub_filename'])
    child_ca_path = ca_storage.path(certs['child']['pub_filename'])

    root_cert_path = ca_storage.path(certs['root-cert']['pub_filename'])
    child_cert_path = ca_storage.path(certs['child-cert']['pub_filename'])

    ocsp_url = '%s%s' % (base_url.rstrip('/'),
                         reverse('django_ca:ocsp-cert-post', kwargs={'serial': certs['child']['serial']}))

    print("")
    print('* All certificates are in %s.' % bold(ca_settings.CA_DIR))
Пример #2
0
        if cert_data["type"] == "ca":
            password = cert_data.get("password")
            if password is not None:
                password = password.encode("utf-8")
            c.generate_ocsp_key(password=password)

    # create admin user for login
    User.objects.create_superuser("user", "*****@*****.**", "nopass")

    ok()

    # create a chain file for the child
    chain = loaded_cas["child"].pub.pem + loaded_cas["root"].pub.pem
    chain_path = ca_storage.path(
        ca_storage.save("child-chain.pem", ContentFile(chain)))

    cwd = os.getcwd()
    rel = lambda p: os.path.relpath(p, cwd)  # NOQA
    root_ca_path = ca_storage.path(certs["root"]["pub_filename"])
    child_ca_path = ca_storage.path(certs["child"]["pub_filename"])

    root_cert_path = ca_storage.path(certs["root-cert"]["pub_filename"])
    child_cert_path = ca_storage.path(certs["child-cert"]["pub_filename"])

    ocsp_url = "%s%s" % (
        args.base_url.rstrip("/"),
        reverse("django_ca:ocsp-cert-post",
                kwargs={"serial": certs["child"]["serial"]}),
    )
Пример #3
0
        if cert_data['type'] == 'ca':
            password = cert_data.get('password')
            if password is not None:
                password = password.encode('utf-8')
            c.generate_ocsp_key(password=password)

    # create admin user for login
    User.objects.create_superuser('user', '*****@*****.**', 'nopass')

    ok()

    # create a chain file for the child
    chain = loaded_cas['child'].pub + loaded_cas['root'].pub
    chain_path = ca_storage.path(
        ca_storage.save('child-chain.pem', ContentFile(chain)))

    base_url = 'http://localhost:8000/'
    cwd = os.getcwd()
    rel = lambda p: os.path.relpath(p, cwd)  # NOQA
    root_ca_path = ca_storage.path(certs['root']['pub_filename'])
    child_ca_path = ca_storage.path(certs['child']['pub_filename'])

    root_cert_path = ca_storage.path(certs['root-cert']['pub_filename'])
    child_cert_path = ca_storage.path(certs['child-cert']['pub_filename'])

    ocsp_url = '%s%s' % (base_url.rstrip('/'),
                         reverse('django_ca:ocsp-cert-post',
                                 kwargs={'serial': certs['child']['serial']}))

    print("")