Remove __main__ code from ipalib.x509 and ipalib.pkcs10

This code was presumably once used for testing, but has been
subsumed by the actual test suite.

Part of: https://fedorahosted.org/freeipa/ticket/6398

Reviewed-By: Jan Cholasta <jcholast@redhat.com>
Reviewed-By: Florence Blanc-Renaud <frenaud@redhat.com>
This commit is contained in:
Fraser Tweedale
2016-11-04 17:07:41 +10:00
committed by David Kupka
parent db116f73fe
commit b0430b67dc
2 changed files with 0 additions and 25 deletions

View File

@@ -20,7 +20,6 @@
from __future__ import print_function
import binascii
import sys
from cryptography.hazmat.backends import default_backend
import cryptography.x509
@@ -55,12 +54,3 @@ def load_certificate_request(data):
except binascii.Error as e:
raise ValueError(e)
return cryptography.x509.load_der_x509_csr(data, default_backend())
if __name__ == '__main__':
# Read PEM request from stdin and print out its components
csrlines = sys.stdin.readlines()
csr = ''.join(csrlines)
print(load_certificate_request(csr))

View File

@@ -35,7 +35,6 @@ from __future__ import print_function
import binascii
import datetime
import ipaddress
import sys
import base64
import re
@@ -486,17 +485,3 @@ def format_datetime(t):
if t.tzinfo is None:
t = t.replace(tzinfo=UTC())
return unicode(t.strftime("%a %b %d %H:%M:%S %Y %Z"))
if __name__ == '__main__':
# this can be run with:
# python ipalib/x509.py < /etc/ipa/ca.crt
# Read PEM cert from stdin and print out its components
certlines = sys.stdin.readlines()
cert = ''.join(certlines)
cert = load_certificate(cert)
print(cert)