MCPcopy Create free account
hub / github.com/cryptidtech/oberon / __init__

Method __init__

python/oberon/classes.py:17–29  ·  view source on GitHub ↗
(self, value: Optional[Union[str, bytes, list]] = None)

Source from the content-addressed store, hash-verified

15 """A secret signing key"""
16
17 def __init__(self, value: Optional[Union[str, bytes, list]] = None):
18 data = bytes()
19 if isinstance(value, memoryview):
20 data = value
21 if isinstance(value, bytearray):
22 data = value
23 if value is not None:
24 if isinstance(value, str):
25 data = value.encode("utf-8")
26 if len(data) == secret_key_size():
27 self.value = data
28 else:
29 self.value = new_secret_key()
30
31 def public_key(self):
32 return PublicKey(get_public_key(self.value))

Callers

nothing calls this directly

Calls 2

secret_key_sizeFunction · 0.85
new_secret_keyFunction · 0.70

Tested by

no test coverage detected