in src/local_gpu_verifier/src/verifier/nvml/gpu_cert_chains.py [0:0]
def __init__(self, handle):
""" Constructor method for the GpuCertificateChains class.
Args:
handle (pynvml.LP_struct_c_nvmlDevice_t): the GPU device handle.
"""
# Removing the last certificate from the certificate as it is the root certificate for the GPU device certificate chain.
# The verifier_device_root.pem cert in certs directory is used as the root cert for the GPU device certificate chain.
if isinstance(handle, TestHandle):
self.GpuAttestationCertificateChain = self.extract_cert_chain(handle.get_test_gpu_certificate_chain())[:-1]
else:
self.GpuAttestationCertificateChain = self.extract_cert_chain(self.get_gpu_certificate_chains(handle))[:-1]
with open(BaseSettings.DEVICE_ROOT_CERT, 'r') as f:
data = f.read()
self.GpuAttestationCertificateChain.append(crypto.load_certificate(type= crypto.FILETYPE_PEM, buffer= data))