Skip to content

Commit f04bea8

Browse files
committed
feat: Added .pyi file for certificate.c
* Card ID: CCT-2233 * Added src/rhsm/_certificate.pyi interface file for Python module that is written in C language (certificate.c) * This help could help IDEs with type-hinting Signed-off-by: Jiri Hnidek <jhnidek@redhat.com>
1 parent f3b12b2 commit f04bea8

1 file changed

Lines changed: 21 additions & 0 deletions

File tree

src/rhsm/_certificate.pyi

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Stubs interface file for rhsm._certificate CPython module written in C. The C code is
2+
# available at ./src/certificate.c. If you are editing the ./src/certificate.c file, you
3+
# should also edit this file to be able to provide better type hinting in IDEs.
4+
5+
# TODO: Extend stubs of classes to provide better type hinting.
6+
7+
class X509: ...
8+
class PrivateKey: ...
9+
class OpenSSLCertificateLoadingError: ...
10+
11+
def get_public_key_algorithms(*args, **kwargs) -> list[str]:
12+
"""return a list of public key algorithms"""
13+
14+
def get_signature_algorithms(*args, **kwargs) -> list[str]:
15+
"""return a list of signature algorithms"""
16+
17+
def load(*args, **kwargs) -> X509:
18+
"""load a certificate from a file"""
19+
20+
def load_private_key(*args, **kwargs) -> PrivateKey:
21+
"""load a private key from a file"""

0 commit comments

Comments
 (0)