Skip to content

Commit

Permalink
Report generation: first steps
Browse files Browse the repository at this point in the history
  • Loading branch information
MatthiasValvekens committed Nov 14, 2023
1 parent 3f38192 commit 0431059
Show file tree
Hide file tree
Showing 11 changed files with 822 additions and 46 deletions.
17 changes: 17 additions & 0 deletions pyhanko/sign/ades/report.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
'AdESIndeterminate',
]


# TODO document these


Expand All @@ -29,6 +30,10 @@ class AdESSubIndic:
def status(self) -> AdESStatus:
raise NotImplementedError

@property
def standard_name(self):
raise NotImplementedError


class AdESPassed(AdESSubIndic, enum.Enum):
OK = enum.auto()
Expand All @@ -37,6 +42,10 @@ class AdESPassed(AdESSubIndic, enum.Enum):
def status(self) -> AdESStatus:
return AdESStatus.PASSED

@property
def standard_name(self):
return self.name


class AdESFailure(AdESSubIndic, enum.Enum):
FORMAT_FAILURE = enum.auto()
Expand All @@ -49,6 +58,10 @@ class AdESFailure(AdESSubIndic, enum.Enum):
def status(self):
return AdESStatus.FAILED

@property
def standard_name(self):
return self.name


class AdESIndeterminate(AdESSubIndic, enum.Enum):
SIG_CONSTRAINTS_FAILURE = enum.auto()
Expand Down Expand Up @@ -76,3 +89,7 @@ class AdESIndeterminate(AdESSubIndic, enum.Enum):
@property
def status(self):
return AdESStatus.INDETERMINATE

@property
def standard_name(self):
return self.name
Loading

0 comments on commit 0431059

Please sign in to comment.