Claim

Claim

Identity claim

Constructor

new Claim(uriopt, fingerprintopt)

Description:
  • Initialize a Claim object

Source:
Properties:
Name Type Description
uri string

The claim's URI

fingerprint string

The fingerprint to verify the claim against

status number

The current status code of the claim

matches Array.<object>

The claim definitions matched against the URI

Example
const claim = doip.Claim();
const claim = doip.Claim('dns:domain.tld?type=TXT');
const claim = doip.Claim('dns:domain.tld?type=TXT', '123abc123abc');
Parameters:
Name Type Attributes Description
uri string <optional>

The URI of the identity claim

fingerprint string <optional>

The fingerprint of the OpenPGP key

Classes

Claim

Members

_fingerprint :string

Source:
Type:
  • string

_matches :Array.<ServiceProvider>

Source:
Type:

_status :number

Source:
Type:
  • number

_uri :string

Source:
Type:
  • string

Methods

isAmbiguous() → {boolean}

Description:
  • Determine the ambiguity of the claim. A claim is only unambiguous if any of the candidates is unambiguous. An ambiguous claim should never be displayed in an user interface when its result is negative.

Source:
Returns:

Whether the claim is ambiguous

Type
boolean

match()

Description:
  • Match the claim's URI to candidate definitions

Source:

toJSON() → {object}

Description:
  • Get a JSON representation of the Claim object. Useful when transferring data between instances/machines.

Source:
Returns:

JSON reprentation of the claim

Type
object

(async) verify(optsopt)

Description:
  • Verify the claim. The proof for each candidate is sequentially fetched and checked for the fingerprint. The verification stops when either a positive result was obtained, or an unambiguous claim definition was processed regardless of the result.

Source:
Parameters:
Name Type Attributes Description
opts module:types~VerificationConfig <optional>

Options for proxy, fetchers

(static) fromJSON(claimObject) → {Claim}

Source:
Example
doip.Claim.fromJSON(JSON.stringify(claim));
Parameters:
Name Type Description
claimObject *

JSON representation of a claim

Throws:

Will throw an error if the JSON object can't be coerced into a Claim

Returns:

Parsed claim

Type
Claim