File: native.pyi

package info (click to toggle)
typeshed 0.0~git20221107.4f381af-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 18,036 kB
  • sloc: python: 3,216; sh: 62; makefile: 13
file content (21 lines) | stat: -rw-r--r-- 675 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
from _typeshed import ReadableBuffer
from collections.abc import Callable
from hashlib import _Hash
from typing import Any

from .base import Key

def get_random_bytes(num_bytes: int) -> bytes: ...

class HMACKey(Key):
    HASHES: dict[str, Callable[[bytes], _Hash]]
    prepared_key: bytes
    def __init__(
        self,
        # explicitly checks for key_data as dict instance, instead of a Mapping
        key: str | bytes | dict[str, Any],
        algorithm: str,
    ) -> None: ...
    def sign(self, msg: ReadableBuffer | None) -> bytes: ...
    def verify(self, msg: ReadableBuffer | None, sig: str | bytes) -> bool: ...
    def to_dict(self) -> dict[str, Any]: ...