Class: User

key~User()

Class that represents an user ID or attribute packet and the relevant signatures.

Constructor

new User()

Source:

Methods

(async) isRevoked(primaryKey, certificate, key,, date) → {Promise.<Boolean>}

Checks if a given certificate of the user is revoked

Parameters:
Name Type Description
primaryKey module:packet.SecretKey | module:packet.PublicKey

The primary key packet

certificate module:packet.Signature

The certificate to verify

key, module:packet.PublicSubkey | module:packet.SecretSubkey | module:packet.PublicKey | module:packet.SecretKey

optional The key to verify the signature

date Date

Use the given date instead of the current time

Source:
Returns:

True if the certificate is revoked

Type
Promise.<Boolean>

(async) sign(primaryKey, privateKeys) → {Promise.<module:key.Key>}

Signs user

Parameters:
Name Type Description
primaryKey module:packet.SecretKey | module:packet.PublicKey

The primary key packet

privateKeys Array.<module:key.Key>

Decrypted private keys for signing

Source:
Returns:

New user with new certificate signatures

Type
Promise.<module:key.Key>

toPacketlist() → {module:packet.List}

Transforms structured user data to packetlist

Source:
Returns:
Type
module:packet.List

(async) update(user, primaryKey) → {Promise.<undefined>}

Update user with new components from specified user

Parameters:
Name Type Description
user module:key.User

Source user to merge

primaryKey module:packet.SecretKey | module:packet.SecretSubkey

primary key used for validation

Source:
Returns:
Type
Promise.<undefined>

(async) verify(primaryKey) → {Promise.<module:enums.keyStatus>}

Verify User. Checks for existence of self signatures, revocation signatures and validity of self signature

Parameters:
Name Type Description
primaryKey module:packet.SecretKey | module:packet.PublicKey

The primary key packet

Source:
Returns:

Status of user

Type
Promise.<module:enums.keyStatus>

(async) verifyAllCertifications(primaryKey, keys) → {Promise.<Array.<{keyid: module:type/keyid, valid: Boolean}>>}

Verifies all user certificates

Parameters:
Name Type Description
primaryKey module:packet.SecretKey | module:packet.PublicKey

The primary key packet

keys Array.<module:key.Key>

Array of keys to verify certificate signatures

Source:
Returns:

List of signer's keyid and validity of signature

Type
Promise.<Array.<{keyid: module:type/keyid, valid: Boolean}>>

(async) verifyCertificate(primaryKey, certificate, keys, date) → {Promise.<module:enums.keyStatus>}

Verifies the user certificate

Parameters:
Name Type Description
primaryKey module:packet.SecretKey | module:packet.PublicKey

The primary key packet

certificate module:packet.Signature

A certificate of this user

keys Array.<module:key.Key>

Array of keys to verify certificate signatures

date Date

Use the given date instead of the current time

Source:
Returns:

status of the certificate

Type
Promise.<module:enums.keyStatus>