From 01a7b9de34851205fecdcfa22befce094e983b3a Mon Sep 17 00:00:00 2001 From: J08nY Date: Sun, 17 Jul 2022 15:04:14 +0200 Subject: Fix FIPSalgo serialization. --- sec_certs/sample/fips_algorithm.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'sec_certs/sample/fips_algorithm.py') diff --git a/sec_certs/sample/fips_algorithm.py b/sec_certs/sample/fips_algorithm.py index fcfd42b6..ea74cd33 100644 --- a/sec_certs/sample/fips_algorithm.py +++ b/sec_certs/sample/fips_algorithm.py @@ -1,20 +1,21 @@ -from dataclasses import dataclass +from dataclasses import dataclass, field +from typing import Optional from sec_certs import constants from sec_certs.serialization.json import ComplexSerializableType -@dataclass(eq=True) +@dataclass(eq=True, order=True, frozen=True) class FIPSAlgorithm(ComplexSerializableType): """ Data structure for algorithm of `FIPSCertificate` """ - cert_id: int - vendor: str - implementation: str - algorithm_type: str - date: str + cert_id: str + algorithm_type: Optional[str] = field(default=None) + vendor: Optional[str] = field(default=None) + implementation: Optional[str] = field(default=None) + date: Optional[str] = field(default=None) @property def dgst(self) -> str: -- cgit v1.3.1