Example #1
0
 def _get_subject_alt_name(self):
     try:
         san_ext = self.csr.extensions.get_extension_for_class(x509.SubjectAlternativeName)
         result = [crypto_utils.cryptography_decode_name(san) for san in san_ext.value]
         return result, san_ext.critical
     except cryptography.x509.ExtensionNotFound:
         return None, False
Example #2
0
 def _get_authority_key_identifier(self):
     try:
         ext = self.csr.extensions.get_extension_for_class(x509.AuthorityKeyIdentifier)
         issuer = None
         if ext.value.authority_cert_issuer is not None:
             issuer = [crypto_utils.cryptography_decode_name(san) for san in ext.value.authority_cert_issuer]
         return ext.value.key_identifier, issuer, ext.value.authority_cert_serial_number
     except cryptography.x509.ExtensionNotFound:
         return None, None, None
Example #3
0
 def _dump_revoked(self, entry):
     return {
         'serial_number': entry['serial_number'],
         'revocation_date': entry['revocation_date'].strftime(TIMESTAMP_FORMAT),
         'issuer':
             [crypto_utils.cryptography_decode_name(issuer) for issuer in entry['issuer']]
             if entry['issuer'] is not None else None,
         'issuer_critical': entry['issuer_critical'],
         'reason': crypto_utils.REVOCATION_REASON_MAP_INVERSE.get(entry['reason']) if entry['reason'] is not None else None,
         'reason_critical': entry['reason_critical'],
         'invalidity_date':
             entry['invalidity_date'].strftime(TIMESTAMP_FORMAT)
             if entry['invalidity_date'] is not None else None,
         'invalidity_date_critical': entry['invalidity_date_critical'],
     }