Class: User

key~User

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

Constructor

new User()

Source:

Methods

getValidSelfCertificate(primaryKey) → {module:packet/signature}

Returns the most significant (latest valid) self signature of the user
Parameters:
Name Type Description
primaryKey module:packet/secret_key | module:packet/public_key The primary key packet
Source:
Returns:
The self signature
Type
module:packet/signature

isRevoked(certificate, primaryKey) → {Boolean}

Checks if a self signature of the user is revoked
Parameters:
Name Type Description
certificate module:packet/signature
primaryKey module:packet/secret_key | module:packet/public_key The primary key packet
Source:
Returns:
True if the certificate is revoked
Type
Boolean

isValidSelfCertificate(primaryKey, selfCertificate) → {Boolean}

Returns true if the self certificate is valid
Parameters:
Name Type Description
primaryKey module:packet/secret_key | module:packet/public_key The primary key packet
selfCertificate module:packet/signature A self certificate of this user
Source:
Returns:
Type
Boolean

sign(primaryKey, privateKeys) → {module:key~Key}

Signs user
Parameters:
Name Type Description
primaryKey module:packet/secret_key | module:packet/public_key The primary key packet
privateKeys Array.<module:key~Key> decrypted private keys for signing
Source:
Returns:
new user with new certificate signatures
Type
module:key~Key

toPacketlist() → {module:packet/packetlist}

Transforms structured user data to packetlist
Source:
Returns:
Type
module:packet/packetlist

update(user, primaryKey)

Update user with new components from specified user
Parameters:
Name Type Description
user module:key~User source user to merge
primaryKey module:packet/signature primary key used for validation
Source:

verify(primaryKey) → {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/secret_key | module:packet/public_key The primary key packet
Source:
Returns:
status of user
Type
module:enums.keyStatus

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

Verifies all user signatures
Parameters:
Name Type Description
primaryKey module:packet/secret_key | module:packet/public_key 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
Array.<({keyid: module:type/keyid, valid: Boolean})>