Python implementation of [Earthstar](https://earthstar-project.org/)
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
1.4 KiB
32 lines
1.4 KiB
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: ...
|
|
|