edk2toollib/uefi/authenticated_variables_structure_support_test.py
def x509_esl_builder(initList: []):
    """
    Creates an EfiSignatureList of type EFI_CERT_X509 from a tuple containing x509 and signatureowner hex strings

    initList is [ (hashString1, ownerGuidString1), ...]
    NOTE: x509 EfiSignatureLists only support 1 data element, so initList should either be empty or 1 element.
    The interface is a List for consistency with other esl_builders
    """

    listSize = len(initList)

    if(listSize > 1):
        raise Exception("initList length > 1, unsupported by type")

    Esl = EfiSignatureList(typeguid=EfiSignatureDataFactory.EFI_CERT_X509_GUID)

    if(listSize == 0):
        Esl.AddSignatureHeader(SigHeader=None, SigSize=0)
    else:
        (certHexStr, ownerGuidStr) = initList[0]
        certBytes = bytes.fromhex(certHexStr)
        Esl.AddSignatureHeader(SigHeader=None, SigSize=EfiSignatureDataEfiCertX509.STATIC_STRUCT_SIZE + len(certBytes))
        Esl.AddSignatureData(EfiSignatureDataEfiCertX509(cert=certBytes,
                                                         sigowner=uuid.UUID(ownerGuidStr)))
    return Esl

    Creates an EfiSignatureList of type EFI_CERT_X509 from a tuple containing x509 and signatureowner hex strings

    initList is [ (hashString1, ownerGuidString1), ...]
    NOTE: x509 EfiSignatureLists only support 1 data element, so initList should either be empty or 1 element.
    The interface is a List for consistency with other esl_builders
    
Creates an EfiSignatureList of type EFI_CERT_X509 from a tuple containing x509 and signatureowner hex strings
initList is [ (hashString1, ownerGuidString1), ...]
NOTE: x509 EfiSignatureLists only support 1 data element, so initList should either be empty or 1 element.
The interface is a List for consistency with other esl_builders
Creates an EfiSignatureList of type EFI_CERT_X509 from a tuple containing x509 and signatureowner hex strings initList is [ ( hashString1 ownerGuidString1 ) ... ] NOTE : x509 EfiSignatureLists only support 1 data element so initList should either be empty or 1 element . The interface is a List for consistency with other esl_builders
def x509_esl_builder(initList: []):
    listSize = len(initList)
    if(listSize > 1):
        raise Exception("initList length > 1, unsupported by type")
    Esl = EfiSignatureList(typeguid=EfiSignatureDataFactory.EFI_CERT_X509_GUID)
    if(listSize == 0):
        Esl.AddSignatureHeader(SigHeader=None, SigSize=0)
    else:
        (certHexStr, ownerGuidStr) = initList[0]
        certBytes = bytes.fromhex(certHexStr)
        Esl.AddSignatureHeader(SigHeader=None, SigSize=EfiSignatureDataEfiCertX509.STATIC_STRUCT_SIZE + len(certBytes))
        Esl.AddSignatureData(EfiSignatureDataEfiCertX509(cert=certBytes,
                                                         sigowner=uuid.UUID(ownerGuidStr)))
    return Esl
def x509_esl_builder ( initList : [ ] ) : listSize = len ( initList ) if ( listSize > 1 ) : raise Exception ( "initList length > 1, unsupported by type" ) Esl = EfiSignatureList ( typeguid = EfiSignatureDataFactory . EFI_CERT_X509_GUID ) if ( listSize == 0 ) : Esl . AddSignatureHeader ( SigHeader = None , SigSize = 0 ) else : ( certHexStr , ownerGuidStr ) = initList [ 0 ] certBytes = bytes . fromhex ( certHexStr ) Esl . AddSignatureHeader ( SigHeader = None , SigSize = EfiSignatureDataEfiCertX509 . STATIC_STRUCT_SIZE + len ( certBytes ) ) Esl . AddSignatureData ( EfiSignatureDataEfiCertX509 ( cert = certBytes , sigowner = uuid . UUID ( ownerGuidStr ) ) ) return Esl
Creates an EfiSignatureList of type EFI_CERT_X509 from a tuple containing x509 and signatureowner hex strings
initList is [ (hashString1, ownerGuidString1), ...]
NOTE: x509 EfiSignatureLists only support 1 data element, so initList should either be empty or 1 element.
Creates an EfiSignatureList of type EFI_CERT_X509 from a tuple containing x509 and signatureowner hex strings initList is [ ( hashString1 ownerGuidString1 ) ... ] NOTE : x509 EfiSignatureLists only support 1 data element so initList should either be empty or 1 element .
"""
    Creates an EfiSignatureList of type EFI_CERT_X509 from a tuple containing x509 and signatureowner hex strings

    initList is [ (hashString1, ownerGuidString1), ...]
    NOTE: x509 EfiSignatureLists only support 1 data element, so initList should either be empty or 1 element.
    The interface is a List for consistency with other esl_builders
    """
initList
[]