Class verification

Namespace: keychain

#include "keychain/wallet/verification.hpp"

Inheritance: verification

Definition

A verification object contains result of a gateway’s attempt to verify one of the signatures on signed data. The gateway verify methods return an array 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.


Constructors

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


Method Summary

Return Type Method and Description

bool

is_verified()

Whether the data’s signature was cryptographically verified with the data’s specified public key.

bool

signer_is_known()

Whether the data signature’s public key is associated with a known contact/persona.

facade

get_facade()

Get the facade (persona or contact) that is associated with the data signature’s public key.

Int64

get_timestamp()

Get the signatures’s timestamp in milliseconds since the epoch.


Methods

is_verified() Method

bool is_verified();

Determines whether data’s signature was cryptographically verified with the public key specified in a signed data structure.

Parameters

None

Returns

bool

true if the data’s signature was cryptographically verified using the public key and cryptographic algorithm specified in the signed data structure; otherwise, false.




signer_is_known() Method

bool signer_is_known();

Determines whether data’s signature public key is contained in a locally stored keychain of either either an internal persona or a previously paired contact.

Parameters

None

Returns

bool

true if the data’s signature public key is contained in a locally stored keychain of either either an internal persona or a previously paired contact; otherwise, false.




get_facade() Method

Facade get_facade();

Get the facade that is associated internally with the data’s public key. The data’s public key (or a reference to it) is included in the signed data string.

Parameters

None

Returns

A facade object representing the identity associated with the data’s public key; otherwise, a NULL facade (a facade for which isNull() returns true).




get_timestamp() Method

kc::timestamp_t get_timestamp();

Get the time the signature was added to the signed data in expressed milliseconds since Jan 1, 1970.

Parameters

None

Returns

Int64

The time the signature was added to the signed data in expressed milliseconds since Jan 1, 1970.


Thread Safety

This class is fully thread-safe; any of its methods may be invoked in multiple threads concurrently.