"""
This type stub file was generated by pyright.
"""
from typing import Any, Dict, Optional
"""SSL Certificate class for handling certificate operations."""
class SSLCertificate(dict):
"""
A class representing an SSL certificate, behaving like a dictionary
for direct JSON serialization. It stores the certificate information internally
and provides methods for export and property access.
Inherits from dict, so instances are directly JSON serializable.
"""
def __init__(self, cert_info: Dict[str, Any]) -> None:
"""
Initializes the SSLCertificate object.
Args:
cert_info (Dict[str, Any]): The raw certificate dictionary.
"""
...
@staticmethod
def from_url(url: str, timeout: int = ...) -> Optional[SSLCertificate]:
"""
Create SSLCertificate instance from a URL. Fetches cert info and initializes.
(Fetching logic remains the same)
"""
...
@property
def issuer(self) -> Dict[str, str]:
...
@property
def subject(self) -> Dict[str, str]:
...
@property
def valid_from(self) -> str:
...
@property
def valid_until(self) -> str:
...
@property
def fingerprint(self) -> str:
...
def to_json(self, filepath: Optional[str] = ...) -> Optional[str]:
"""Export certificate as JSON."""
...
def to_pem(self, filepath: Optional[str] = ...) -> Optional[str]:
"""Export certificate as PEM."""
...
def to_der(self, filepath: Optional[str] = ...) -> Optional[bytes]:
"""Export certificate as DER."""
...
def __repr__(self) -> str:
...