Jcat.Context¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
None
Signals¶
- Inherited:
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
|---|---|---|---|
parent_instance |
r |
Class Details¶
- class Jcat.Context(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
- classmethod new()¶
- Returns:
- Return type:
Creates a new context.
New in version 0.1.0.
- add_public_key(filename)¶
- Parameters:
filename (
str) – A filename
Adds a single public key.
New in version 0.1.0.
- add_public_keys(path)¶
- Parameters:
path (
str) – A directory of files
Adds a public key directory.
New in version 0.1.0.
- blob_kind_allow(kind)¶
- Parameters:
kind (
Jcat.BlobKind) –Jcat.BlobKind, e.g.Jcat.BlobKind.GPG
Adds a blob kind to the allowlist. By default, JCat will use all signature and checksum schemes compiled in at build time. Once this function has been called only specific blob kinds will be used in functions like
Jcat.Context.verify_blob().New in version 0.1.12.
- blob_kind_disallow(kind)¶
- Parameters:
kind (
Jcat.BlobKind) –Jcat.BlobKind, e.g.Jcat.BlobKind.GPG
Removes a blob kind from the allowlist. By default, JCat will use all signature and checksum schemes compiled in at build time. Once this function has been called this kind will not be used in functions like
Jcat.Context.verify_blob().New in version 0.1.12.
- get_engine(kind)¶
- Parameters:
kind (
Jcat.BlobKind) –Jcat.BlobKind, e.g.Jcat.BlobKind.GPG- Raises:
- Returns:
Jcat.Engine, orNonefor unavailable- Return type:
Gets the engine for a specific engine kind, setting up the context automatically if required.
New in version 0.1.0.
- get_keyring_path()¶
-
Gets the local state directory the engines are using.
New in version 0.1.0.
- set_keyring_path(path)¶
- Parameters:
path (
str) – A directory
Sets the local state directory for the engines to use.
New in version 0.1.0.
- verify_blob(data, blob, flags)¶
- Parameters:
data (
GLib.Bytes) –GLib.Bytesflags (
Jcat.VerifyFlags) –Jcat.VerifyFlags, e.g.Jcat.VerifyFlags.DISABLE_TIME_CHECKS
- Raises:
- Returns:
Jcat.Result, orNonefor failed- Return type:
Verifies a
Jcat.Blobusing the public keys added to the context.New in version 0.1.0.
- verify_item(data, item, flags)¶
- Parameters:
data (
GLib.Bytes) –GLib.Bytesflags (
Jcat.VerifyFlags) –Jcat.VerifyFlags, e.g.Jcat.VerifyFlags.REQUIRE_SIGNATURE
- Raises:
- Returns:
array of
Jcat.Result, orNonefor failed- Return type:
Verifies a
Jcat.Itemusing the public keys added to the context. Allverify=CHECKSUMengines (e.g. SHA256) must verify correctly, but only one non-checksum signature has to verify.New in version 0.1.0.
- verify_target(item_target, item, flags)¶
- Parameters:
item_target (
Jcat.Item) –Jcat.Itemcontaining checksums of the dataflags (
Jcat.VerifyFlags) –Jcat.VerifyFlags, e.g.Jcat.VerifyFlags.REQUIRE_SIGNATURE
- Raises:
- Returns:
results, or
Nonefor failed- Return type:
Verifies a
Jcat.Itemusing the target to an item. At least oneverify=CHECKSUM(e.g. SHA256) must exist and all checksum types that do exist must verify correctly.New in version 0.2.0.