Skip to content

Commit

Permalink
fix: ruff checks
Browse files Browse the repository at this point in the history
Signed-off-by: Daniel Bluhm <[email protected]>
  • Loading branch information
dbluhm committed Oct 19, 2023
1 parent 5516584 commit bb64078
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions did_peer_2.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ def verification_relationship(self) -> str:

@classmethod
def key_purposes(cls):
"""Return a list of purpose codes that correspond to keys."""
return (
PurposeCode.assertion,
PurposeCode.key_agreement,
Expand All @@ -52,6 +53,8 @@ def key_purposes(cls):


class ServiceEncoder:
"""Encoder for did:peer:2 services."""

common_string_abbreviations = {
"type": "t",
"DIDCommMessaging": "dm",
Expand Down Expand Up @@ -149,30 +152,37 @@ class KeySpec:

@classmethod
def assertion(cls, material: str) -> "KeySpec":
"""Create a key spec for assertion purposes."""
return cls(PurposeCode.assertion, material)

@classmethod
def key_agreement(cls, material: str) -> "KeySpec":
"""Create a key spec for key agreement purposes."""
return cls(PurposeCode.key_agreement, material)

@classmethod
def encryption(cls, material: str) -> "KeySpec":
"""Create a key spec for key agreement purposes."""
return cls(PurposeCode.key_agreement, material)

@classmethod
def authentication(cls, material: str) -> "KeySpec":
"""Create a key spec for authentication purposes."""
return cls(PurposeCode.authentication, material)

@classmethod
def verification(cls, material: str) -> "KeySpec":
"""Create a key spec for authentication purposes."""
return cls(PurposeCode.authentication, material)

@classmethod
def capability_invocation(cls, material: str) -> "KeySpec":
"""Create a key spec for capability invocation purposes."""
return cls(PurposeCode.capability_invocation, material)

@classmethod
def capability_delegation(cls, material: str) -> "KeySpec":
"""Create a key spec for capability delegation purposes."""
return cls(PurposeCode.capability_delegation, material)

@property
Expand Down

0 comments on commit bb64078

Please sign in to comment.