Example #1
0
 def __init__(self, name, owner, plugin_name, body, roles=None, chain=None, description=None):
     self.name = name
     self.body = body
     self.chain = chain
     self.owner = owner
     self.plugin_name = plugin_name
     cert = x509.load_pem_x509_certificate(str(body), default_backend())
     self.cn = get_cn(cert)
     self.not_before = get_not_before(cert)
     self.not_after = get_not_after(cert)
     self.roles = roles
     self.description = description
Example #2
0
 def __init__(self,
              name,
              owner,
              plugin_name,
              body,
              roles=None,
              chain=None,
              description=None):
     self.name = name
     self.body = body
     self.chain = chain
     self.owner = owner
     self.plugin_name = plugin_name
     cert = x509.load_pem_x509_certificate(str(body), default_backend())
     self.cn = get_cn(cert)
     self.not_before = get_not_before(cert)
     self.not_after = get_not_after(cert)
     self.roles = roles
     self.description = description
Example #3
0
def test_cert_get_cn():
    from lemur.tests.certs import INTERNAL_VALID_LONG_CERT
    from lemur.certificates.models import get_cn

    assert get_cn(INTERNAL_VALID_LONG_CERT) == 'long.lived.com'
Example #4
0
def test_cert_get_cn():
    from lemur.tests.certs import INTERNAL_VALID_LONG_CERT
    from lemur.certificates.models import get_cn

    assert get_cn(INTERNAL_VALID_LONG_CERT) == 'long.lived.com'
Example #5
0
def test_cert_get_cn(client):
    from .vectors import INTERNAL_VALID_LONG_CERT
    from lemur.certificates.models import get_cn

    assert get_cn(INTERNAL_VALID_LONG_CERT) == 'long.lived.com'