# Class: SubKey

## key~ SubKey

Class that represents a subkey packet and the relevant signatures.

#### new SubKey()

  Source:
    - key.js, line 585

### Methods

#### isValidEncryptionKey(primaryKey) → {Boolean}

  Returns true if the subkey can be used for encryption

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `primaryKey` | module:packet/secret_key | module:packet/public_key | The primary key packet

  Source:
    - key.js, line 611

  ##### Returns:

  Type
    Boolean

#### isValidSigningKey(primaryKey) → {Boolean}

  Returns true if the subkey can be used for signing of data

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `primaryKey` | module:packet/secret_key | module:packet/public_key | The primary key packet

  Source:
    - key.js, line 621

  ##### Returns:

  Type
    Boolean

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

  Transforms structured subkey data to packetlist
  Source:
    - key.js, line 598

  ##### Returns:

  Type
    module:packet/packetlist

#### verify() → {module:enums.keyStatus}

  Verify subkey. Checks for revocation signatures, expiration time and valid binding signature
  Source:
    - key.js, line 631

  ##### Returns:

  The status of the subkey
  Type
    module:enums.keyStatus