GpgLinkedDataKeyClass2020

GpgLinkedDataKeyClass2020

new GpgLinkedDataKeyClass2020(options)

Source:
Parameters:
Name Type Description
options KeyPairOptions The options to use.
Properties
Name Type Description
id string The key ID.
controller string The key controller.
publicKeyGpg string The ascii armored Public Key.
privateKeyGpg string The ascii armored Private Key.
passphrase string The private key passphrase if needed.

Members

privateKey

Source:
Returns the JWK encoded private key.

publicKey

Source:
Returns the JWK encoded public key.

Methods

addEncodedPublicKey(publicKeyNode) → {Object}

Source:
Adds a public key base to a public key node.
Parameters:
Name Type Description
publicKeyNode Object The public key node in a jsonld-signature.
Properties
Name Type Description
publicKeyGpg string JWK Public Key for jsonld-signatures.
Returns:
A PublicKeyNode in a block.
Type
Object

(async) fingerprint() → {string}

Source:
Generates and returns a public key fingerprint using https://tools.ietf.org/html/rfc7638
Returns:
The fingerprint.
Type
string

publicNode(optionsopt) → {Object}

Source:
Contains the public key for the KeyPair and other information that json-ld Signatures can use to form a proof.
Parameters:
Name Type Attributes Default Description
options Object <optional>
{} Needs either a controller or owner.
Properties
Name Type Attributes Default Description
controller string <optional>
this.controller DID of the person/entity controlling this key pair.
Returns:
A public node with information used in verification methods by signatures.
Type
Object

signer() → {Object}

Source:
Returns a signer object for use with jsonld-signatures.
Returns:
A signer for the json-ld block.
Type
Object

verifier() → {Object}

Source:
Returns a verifier object for use with jsonld-signatures.
Returns:
Used to verify jsonld-signatures.
Type
Object

(async) verifyFingerprint(fingerprint) → {Object}

Source:
Tests whether the fingerprint was generated from a given key pair.
Parameters:
Name Type Description
fingerprint string A JWK public key.
Returns:
An object indicating valid is true or false.
Type
Object

(async, static) fingerprintFromPublicKey(publicKeyGpg) → {string}

Source:
Generates and returns a public key fingerprint using https://tools.ietf.org/html/rfc7638
Parameters:
Name Type Description
publicKeyGpg string The ascii armor encoded public key material.
Returns:
The fingerprint.
Type
string

(async, static) generate(optionsopt) → {Promise.<GpgLinkedDataKeyClass2020>}

Source:
Generates a KeyPair with an optional deterministic seed.
Parameters:
Name Type Attributes Default Description
options KeyPairOptions <optional>
{} The options to use.
Returns:
Generates a key pair.
Type
Promise.<GpgLinkedDataKeyClass2020>