Conditions | 3 |
Total Lines | 8 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | from asyncua.crypto import uacrypto |
||
11 | async def trust_certificate(self, certificate_path: str, format: str = None, label: str = None): |
||
12 | certificate = await uacrypto.load_certificate(certificate_path, format) |
||
13 | if label is None: |
||
14 | label = certificate_path |
||
15 | if label in self._trusted_certificates: |
||
16 | logging.warning(f"certificate with label {label} " |
||
17 | f"attempted to be added multiple times, only the last version will be kept.") |
||
18 | self._trusted_certificates[label] = uacrypto.der_from_x509(certificate) |
||
19 | |||
24 |