def METHOD_NAME(self):
    # Sort certificates in order to do binary search when looking up certificates
    self.certificates = sorted(self.certificates, key=lambda cert: cert.subject.public_bytes(default_backend()))
    bundle = struct.pack('>H', len(self.certificates))
    for crt in self.certificates:
        """ Read the public key as DER format """
        pub_key = crt.public_key()
        pub_key_der = pub_key.public_bytes(serialization.Encoding.DER, serialization.PublicFormat.SubjectPublicKeyInfo)
        """ Read the subject name as DER format """
        sub_name_der = crt.subject.public_bytes(default_backend())
        name_len = len(sub_name_der)
        key_len = len(pub_key_der)
        len_data = struct.pack('>HH', name_len, key_len)
        bundle += len_data
        bundle += sub_name_der
        bundle += pub_key_der
    return bundle