wasat.trust
Trust models and certificate verification for Gemini connections.
FileTrustStore
Bases: TrustStore
A standard file-based TOFU (Trust On First Use) store.
Stores fingerprints in a simple text file format similar to known_hosts.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str | Path
|
The path to the file storing fingerprints. |
required |
get_fingerprint
async
save
async
verify
async
Verify the peer certificate against the stored fingerprint.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str
|
The remote hostname. |
required |
|
int
|
The remote port. |
required |
|
bytes
|
The DER-encoded certificate. |
required |
Returns:
| Type | Description |
|---|---|
bool
|
True if the fingerprint matches the stored one, False otherwise. |
TrustStore
Bases: Protocol
Protocol defining the interface for certificate fingerprint stores.
get_fingerprint
async
save
async
verify
async
Verify the peer certificate against the stored fingerprint.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str
|
The remote hostname. |
required |
|
int
|
The remote port. |
required |
|
bytes
|
The DER-encoded certificate. |
required |
Returns:
| Type | Description |
|---|---|
bool
|
True if the certificate is trusted, False otherwise. |