Class: SubKey

key~SubKey()

Class that represents a subkey packet and the relevant signatures.

Constructor

new SubKey()

Source:

Methods

getAlgorithmInfo() → {Object}

Returns algorithm information

Inherited From:
Source:
Returns:

An object of the form {algorithm: String, bits:int, curve:String}

Type
Object

getCreationTime() → {Date}

Returns the creation time of the key

Inherited From:
Source:
Returns:
Type
Date

getExpirationTime(date) → {Date}

Returns the expiration time of the subkey or Infinity if key does not expire

Parameters:
Name Type Description
date Date

Use the given date instead of the current time

Source:
Returns:
Type
Date

getFingerprint() → {String}

Calculates the fingerprint of the key

Inherited From:
Source:
Returns:

A string containing the fingerprint in lowercase hex

Type
String

getKeyId() → {String}

Calculates the key id of the key

Inherited From:
Source:
Returns:

A 8 byte key id

Type
String

isDecrypted() → {Boolean|null}

Check whether secret-key data is available in decrypted form. Returns null for public keys.

Inherited From:
Source:
Returns:
Type
Boolean | null

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

Checks if a binding signature of a subkey is revoked

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

The primary key packet

signature module:packet.Signature

The binding signature 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 binding signature is revoked

Type
Promise.<Boolean>

(async) revoke(primaryKey, reasonForRevocation, date) → {Promise.<module:key~SubKey>}

Revokes the subkey

Parameters:
Name Type Description
primaryKey module:packet.SecretKey

decrypted private primary key for revocation

reasonForRevocation Object

optional, object indicating the reason for revocation

Properties
Name Type Description
flag module:enums.reasonForRevocation

optional, flag indicating the reason for revocation

string String

optional, string explaining the reason for revocation

date Date

optional, override the creationtime of the revocation signature

Source:
Returns:

new subkey with revocation signature

Type
Promise.<module:key~SubKey>

toPacketlist() → {module:packet.List}

Transforms structured subkey data to packetlist

Source:
Returns:
Type
module:packet.List

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

Update subkey with new components from specified subkey

Parameters:
Name Type Description
subKey module:key~SubKey

Source subkey to merge

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

primary key used for validation

Source:
Returns:
Type
Promise.<undefined>

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

Verify subkey. Checks for revocation signatures, expiration time and valid binding signature

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

The primary key packet

date Date

Use the given date instead of the current time

Source:
Returns:

The status of the subkey

Type
Promise.<module:enums.keyStatus>