Exemplo n.º 1
0
    def test_split_x509s(self):
        imds = []
        for x509Pem in cert_parser._split_x509s(X509_IMDS):
            imds.append(cert_parser._get_x509_from_pem_bytes(x509Pem))

        for i in six.moves.xrange(0, len(imds)):
            self.assertEqual(EXPECTED_IMD_SUBJS[i], imds[i].get_subject().CN)
Exemplo n.º 2
0
    def test_split_x509s(self):
        imds = []
        for x509Pem in cert_parser._split_x509s(X509_IMDS):
            imds.append(cert_parser._get_x509_from_pem_bytes(x509Pem))

        for i in six.moves.xrange(0, len(imds)):
            self.assertEqual(EXPECTED_IMD_SUBJS[i], imds[i].get_subject().CN)
Exemplo n.º 3
0
    def test_split_x509s(self):
        imds = []
        for x509Pem in cert_parser._split_x509s(sample_certs.TEST_X509_IMDS):
            imds.append(cert_parser._get_x509_from_pem_bytes(x509Pem))

        for i in range(0, len(imds)):
            self.assertEqual(sample_certs.EXPECTED_IMD_TEST_SUBJS[i],
                             imds[i].subject.get_attributes_for_oid(
                                 x509.OID_COMMON_NAME)[0].value)
Exemplo n.º 4
0
    def test_split_x509s(self):
        imds = []
        for x509Pem in cert_parser._split_x509s(X509_IMDS):
            imds.append(cert_parser._get_x509_from_pem_bytes(x509Pem))

        for i in range(0, len(imds)):
            self.assertEqual(
                EXPECTED_IMD_SUBJS[i], imds[i].subject.get_attributes_for_oid(
                    x509.OID_COMMON_NAME)[0].value)
Exemplo n.º 5
0
 def get_intermediates(self):
     if self._cert_container.intermediates:
         intermediates = self._cert_container.intermediates.payload
         return [imd for imd in cert_parser._split_x509s(intermediates)]
Exemplo n.º 6
0
 def get_intermediates(self):
     if self._cert_container.intermediates:
         intermediates = self._cert_container.intermediates.payload
         return [imd for imd in cert_parser._split_x509s(intermediates)]