Class Verification

Package: io.keychain.core

public class Verification
extends java.lang.Object

Description

A Verification object contains result of an attempt to verify one of the signatures on signed data. The Gateway verify methods return a VerificationResult object which has within it 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.

Since: v2.0

Public Member Functions

Return type Method and Description

boolean

isVerified()

Whether the associated signature was cryptographically verified

boolean

isApproval()

Whether the associated signature is for approval or rejection

boolean

signerIsKnown()

Whether the signer is a known contact of the active Persona

Facade

getFacade()

Gets signer’s facade

String

getPublicKey()

Gets public key

String

getPublicKeyId()

Gets public key id

String

getSignature()

Gets signature

long

getTimestamp()

Gets the signature timestamp as milliseconds since Unix epoch started

Public Member Functions Detail

isVerified

boolean isVerified()

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

isApproval

boolean isApproval()

Returns true if the data’s signature is an approval

Returns:

true if the signature is an approval

signerIsKnown

boolean signerIsKnown()

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

getFacade

Facade getFacade()

Gets the Facade (Persona or Contact) that is associated with the data signature’s public key. If none is found, throws SignerNotKnown.

Returns:

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

Raises:

SignerNotKnown - if the signer is not a known Contact

BadJniResult - if the underlying Facade is not allocated properly within the Keychain library

getPublicKey

String getPublicKey()

Gets the public key used to sign the message

Returns:

The public key used to sign the message

getPublicKeyId

String getPublicKeyId()

Gets the ID of the public key used to sign the message

Returns:

The ID of the public key used to sign the message

getSignature

String getSignature()

Gets the signature on the message

Returns:

The message signature. If isVerified() is true, it means the message when signed by the public key in getPublicKey() yields getSignature().

getTimestamp

long getTimestamp()

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

Returns:

The Unix epoch time for the signature timestamp