Class: PublicSubkeyPacket

PublicSubkeyPacket(date, config)

A Public-Subkey packet (tag 14) has exactly the same format as a Public-Key packet, but denotes a subkey. One or more subkeys may be associated with a top-level key. By convention, the top-level key provides signature services, and the subkeys provide encryption services.

Constructor

new PublicSubkeyPacket(date, config)

Parameters:
Name Type Description
date Date

(optional) creation date

config Object

(optional) full configuration, defaults to openpgp.config

Source:

Extends

Members

algorithm :String

Public key algorithm.

Type:
  • String
Overrides:
Source:

created :Date

Key creation date.

Type:
  • Date
Overrides:
Source:

expirationTimeV3 :Integer

Time until expiration in days (V3 only)

Type:
  • Integer
Overrides:
Source:

fingerprint :String

Fingerprint in lowercase hex

Type:
  • String
Overrides:
Source:

keyid :module:type/keyid~Keyid

Keyid

Type:
Overrides:
Source:

publicParams :Object

Algorithm specific public params

Type:
  • Object
Overrides:
Source:

readPublicKey

Alias of read()

Overrides:
Source:
See:

tag :module:enums.packet

Packet type

Type:
Overrides:
Source:

version :Integer

Packet version

Type:
  • Integer
Overrides:
Source:

writePublicKey

Alias of write()

Overrides:
Source:
See:

Methods

getAlgorithmInfo() → {Object}

Returns algorithm information

Overrides:
Source:
Returns:

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

Type
Object

getCreationTime() → {Date}

Returns the creation time of the key

Overrides:
Source:
Returns:
Type
Date

getFingerprint() → {String}

Calculates the fingerprint of the key

Overrides:
Source:
Returns:

A string containing the fingerprint in lowercase hex

Type
String

getFingerprintBytes() → {Uint8Array}

Calculates the fingerprint of the key

Overrides:
Source:
Returns:

A Uint8Array containing the fingerprint

Type
Uint8Array

getKeyId() → {module:type/keyid~Keyid}

Calculates the key id of the key

Overrides:
Source:
Returns:

A 8 byte key id

Type
module:type/keyid~Keyid

hasSameFingerprintAs() → {Boolean}

Calculates whether two keys have the same fingerprint without actually calculating the fingerprint

Overrides:
Source:
Returns:

Whether the two keys have the same version and public key data

Type
Boolean

isDecrypted() → {Boolean|null}

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

Overrides:
Source:
Returns:
Type
Boolean | null

read(bytes) → {Object}

Internal Parser for public keys as specified in RFC 4880 section 5.5.2 Public-Key Packet Formats called by read_tag<num>

Parameters:
Name Type Description
bytes Uint8Array

Input array to read the packet from

Overrides:
Source:
Returns:

This object with attributes set by the parser

Type
Object

write() → {Uint8Array}

Creates an OpenPGP public key packet for the given key.

Overrides:
Source:
Returns:

Bytes encoding the public key OpenPGP packet

Type
Uint8Array

writeForHash()

Write packet in order to be hashed; either for a signature or a fingerprint.

Overrides:
Source: