Initial version with identity handling

This commit is contained in:
2022-04-11 15:45:45 +02:00
commit 382449d6bb
19 changed files with 1340 additions and 0 deletions

View File

@@ -0,0 +1,22 @@
from .keys import (
BadSignatureError,
BadPrefixError,
create_keypair,
SigningKey,
VerifyingKey,
remove_prefix,
to_ascii,
from_ascii,
)
__all__ = (
'BadSignatureError',
'BadPrefixError',
'create_keypair',
'SigningKey',
'VerifyingKey',
'remove_prefix',
'to_ascii',
'from_ascii',
'__version__'
)

View File

@@ -0,0 +1,3 @@
version_json: str
def get_versions(): ...

View File

@@ -0,0 +1,32 @@
from typing import Any, Callable, Optional, Tuple
BadSignatureError: Any
def create_keypair(entropy: Callable[[int], bytes] = ...) -> Tuple[SigningKey, VerifyingKey]: ...
class BadPrefixError(Exception): ...
def remove_prefix(s_bytes: bytes, prefix: bytes) -> bytes: ...
def to_ascii(s_bytes: bytes, prefix: str = ..., encoding: str = ...) -> str: ...
def from_ascii(s_ascii: str, prefix: str = ..., encoding: str = ...) -> bytes: ...
class SigningKey:
sk_s: bytes
vk_s: bytes
def __init__(self, sk_s: bytes, prefix: str = ..., encoding: Optional[str] = ...) -> None: ...
def to_bytes(self, prefix: str = ...) -> bytes: ...
def to_ascii(self, prefix: str = ..., encoding: Optional[str] = ...) -> str: ...
def to_seed(self, prefix: str = ...) -> bytes: ...
def __eq__(self, them: object) -> bool: ...
def get_verifying_key(self) -> VerifyingKey: ...
def sign(self, msg: bytes, prefix: str = ..., encoding: Optional[str] = ...) -> bytes: ...
class VerifyingKey:
vk_s: bytes
def __init__(self, vk_s: bytes, prefix: str = ..., encoding: Optional[str] = ...) -> None: ...
def to_bytes(self, prefix: str = ...) -> bytes: ...
def to_ascii(self, prefix: str = ..., encoding: Optional[str] = ...) -> str: ...
def __eq__(self, them: object) -> bool: ...
def verify(self, sig: bytes, msg: bytes, prefix: str = ..., encoding: Optional[str] = ...) -> bool: ...
def selftest() -> None: ...