Jcat.Context

g GObject.Object GObject.Object Jcat.Context Jcat.Context GObject.Object->Jcat.Context

Subclasses:

None

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

new ()

add_public_key (filename)

add_public_keys (path)

blob_kind_allow (kind)

blob_kind_disallow (kind)

get_engine (kind)

get_keyring_path ()

set_keyring_path (path)

verify_blob (data, blob, flags)

verify_item (data, item, flags)

verify_target (item_target, item, flags)

Virtual Methods

Inherited:

GObject.Object (7)

Properties

None

Signals

Inherited:

GObject.Object (1)

Fields

Inherited:

GObject.Object (1)

Name

Type

Access

Description

parent_instance

GObject.Object

r

Class Details

class Jcat.Context(**kwargs)
Bases:

GObject.Object

Abstract:

No

Structure:

Jcat.ContextClass

classmethod new()
Returns:

a Jcat.Context

Return type:

Jcat.Context

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:

GLib.Error

Returns:

Jcat.Engine, or None for unavailable

Return type:

Jcat.Engine

Gets the engine for a specific engine kind, setting up the context automatically if required.

New in version 0.1.0.

get_keyring_path()
Returns:

path

Return type:

str or None

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:
Raises:

GLib.Error

Returns:

Jcat.Result, or None for failed

Return type:

Jcat.Result

Verifies a Jcat.Blob using the public keys added to the context.

New in version 0.1.0.

verify_item(data, item, flags)
Parameters:
Raises:

GLib.Error

Returns:

array of Jcat.Result, or None for failed

Return type:

[Jcat.Result]

Verifies a Jcat.Item using the public keys added to the context. All verify=CHECKSUM engines (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:
Raises:

GLib.Error

Returns:

results, or None for failed

Return type:

[Jcat.Result]

Verifies a Jcat.Item using the target to an item. At least one verify=CHECKSUM (e.g. SHA256) must exist and all checksum types that do exist must verify correctly.

New in version 0.2.0.