Class Verification

Package: keychain.core.verification

Inheritance: Verification

Description

A Verification object contains result of an attempt to verify one of the signatures on signed data. The Gateway verify methods return a list of Verification objects, one for each signature in the data. The Verification object provides information on whether the signature was cryptographically valid, whether the identity of the signature’s owner is known as a contact, and other attributes.

Applications should use the information provided to implement logic about whether to accept the data and how to handle errors.

The Verification object should not be instantiated directly by the developer, as it is instantiated and returned by Gateway cryptographic verification methods.

Since: v2.0

Public Member Functions

Return type Method and Description

bool

is_verified()

Returns True if the data’s signature was cryptographically verified with the public key specified in a signed data structure

bool

is_approval()

Returns True if the data’s signature is an approval

bool

signer_is_known()

Returns True if the data’s signature public key is contained in a locally stored keychain of either an internal persona or a previously paired contact.

Facade

get_facade()

Get the facade (persona or contact) that is associated with the data signature’s public key. If none is found, returns a NULL facade (is_null() is true).

int

get_timestamp()

Get the signatures’s timestamp in milliseconds since the epoch

Public Member Functions Detail

is_verified

is_verified() → bool

Returns True if the data’s signature was cryptographically verified with the public key specified in a signed data structure

Returns:

True if the data was verified

is_approval

is_approval() → bool

Returns True if the data’s signature is an approval

Returns:

True if the signature is an approval

signer_is_known

signer_is_known() → bool

Returns True if the data’s signature public key is contained in a locally stored keychain of either an internal persona or a previously paired contact

Returns:

True if the signer is a known contact/persona

get_facade

get_facade() → Facade

Get the facade (persona or contact) that is associated with the data signature’s public key. If none is found, returns a NULL facade (is_null() is True).

Returns:

Returns the contact/persona associated with the signer, or a null-pattern Facade

Raises:

KeychainError - if the Keychain library ran into an error preventing success

get_timestamp

get_timestamp() → int

Get the signatures’s timestamp in milliseconds since the epoch

Returns:

The Unix epoch time for the signature timestamp