net/data/ssl/scripts/crlsetutil.py
def der_cert_to_subject_hash(der_bytes):
  """Returns SHA256(subject) of a DER-encoded certificate

  Args:
    der_bytes: A DER-encoded certificate (RFC 5280)

  Returns:
    The SHA-256 hash of the certificate's subject.
  """
  iterator = ASN1Iterator(der_bytes)
  iterator.step_into()  # enter certificate structure
  iterator.step_into()  # enter TBSCertificate
  iterator.step_over()  # over version
  iterator.step_over()  # over serial
  iterator.step_over()  # over signature algorithm
  iterator.step_over()  # over issuer name
  iterator.step_over()  # over validity
  return hashlib.sha256(iterator.contents()).digest()
Returns SHA256(subject) of a DER-encoded certificate

  Args:
    der_bytes: A DER-encoded certificate (RFC 5280)

  Returns:
    The SHA-256 hash of the certificate's subject.
  
Returns SHA256(subject) of a DER-encoded certificate
Returns SHA256 ( subject ) of a DER - encoded certificate
def der_cert_to_subject_hash(der_bytes):
  iterator = ASN1Iterator(der_bytes)
  iterator.step_into()  
  iterator.step_into()  
  iterator.step_over()  
  iterator.step_over()  
  iterator.step_over()  
  iterator.step_over()  
  iterator.step_over()  
  return hashlib.sha256(iterator.contents()).digest()
def der_cert_to_subject_hash ( der_bytes ) : iterator = ASN1Iterator ( der_bytes ) iterator . step_into ( ) iterator . step_into ( ) iterator . step_over ( ) iterator . step_over ( ) iterator . step_over ( ) iterator . step_over ( ) iterator . step_over ( ) return hashlib . sha256 ( iterator . contents ( ) ) . digest ( )
Returns SHA256(subject) of a DER-encoded certificate
Returns SHA256 ( subject ) of a DER - encoded certificate
"""Returns SHA256(subject) of a DER-encoded certificate

  Args:
    der_bytes: A DER-encoded certificate (RFC 5280)

  Returns:
    The SHA-256 hash of the certificate's subject.
  """ # enter certificate structure # enter TBSCertificate # over version # over serial # over signature algorithm # over issuer name # over validity
The SHA-256 hash of the certificate's subject.
The SHA - 256 hash of the certificate ' s subject .
der_bytes
A DER-encoded certificate (RFC 5280)
A DER - encoded certificate ( RFC 5280 )