-
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix Type Annotations and Improve Stub Structure for pyrage-stubs (#83)
- Loading branch information
1 parent
cd023bc
commit 125b12b
Showing
7 changed files
with
42 additions
and
22 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
from io import BufferedIOBase | ||
from typing import Sequence, Union | ||
|
||
from pyrage import passphrase, plugin, ssh, x25519 | ||
from pyrage.plugin import IdentityPluginV1, RecipientPluginV1 | ||
from pyrage.ssh import Identity as SSHIdentity | ||
from pyrage.ssh import Recipient as SSHRecipient | ||
from pyrage.x25519 import Identity as X25519Identity | ||
from pyrage.x25519 import Recipient as X25519Recipient | ||
|
||
_Identity = Union[SSHIdentity, X25519Identity, IdentityPluginV1] | ||
_Recipient = Union[SSHRecipient, X25519Recipient, RecipientPluginV1] | ||
|
||
__all__ = ( | ||
"ssh", | ||
"x25519", | ||
"passphrase", | ||
"plugin", | ||
"encrypt", | ||
"encrypt_file", | ||
"encrypt_io", | ||
"decrypt", | ||
"decrypt_file", | ||
"decrypt_io", | ||
"RecipientError", | ||
"IdentityError", | ||
) | ||
|
||
|
||
class RecipientError(Exception): | ||
... | ||
|
||
class IdentityError(Exception): | ||
... | ||
|
||
|
||
def encrypt(plaintext: bytes, recipients: Sequence[_Recipient]) -> bytes: ... | ||
def encrypt_file(infile: str, outfile: str, recipients: Sequence[_Recipient]) -> None: ... | ||
def encrypt_io(in_io: BufferedIOBase, out_io: BufferedIOBase, recipients: Sequence[_Recipient]) -> bytes: ... | ||
def decrypt(ciphertext: bytes, identities: Sequence[_Identity]) -> bytes: ... | ||
def decrypt_file(infile: str, outfile: str, identities: Sequence[_Identity]) -> None: ... | ||
def decrypt_io(in_io: BufferedIOBase, out_io: BufferedIOBase, recipient: Sequence[_Identity]) -> None: ... |
File renamed without changes.
File renamed without changes.
Empty file.
File renamed without changes.
File renamed without changes.