# Class: User

## key~ User

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

#### new User()

  Source:
    - key.js, line 477

### 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:
    - key.js, line 526

  ##### 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:
    - key.js, line 507

  ##### Returns:

  True if the certificate is revoked
  Type
    Boolean

#### toPacketlist() → {module:packet/packetlist}

  Transforms structured user data to packetlist
  Source:
    - key.js, line 492

  ##### Returns:

  Type
    module:packet/packetlist

#### 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:
    - key.js, line 556

  ##### Returns:

  status of user
  Type
    module:enums.keyStatus