GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Home
  • armor
  • config
  • enums
  • AEADEncryptedDataPacket
  • CleartextMessage
  • CompressedDataPacket
  • Key
  • LiteralDataPacket
  • MarkerPacket
  • Message
  • OnePassSignaturePacket
  • PacketList
  • PaddingPacket

This view

  • Original page
  • New address

GeezerVison is showing docs.openpgpjs.org — JSDoc: Class: SecretKeyPacket

Constructor

new SecretKeyPacket(dateopt, configopt)

Parameters:
Name Type Attributes Description
date Date <optional>

Creation date

config Object <optional>

Full configuration, defaults to openpgp.config

Source:
  • packet/secret_key.js, line 34

Extends

  • PublicKeyPacket

Members

aead :enums.aead

AEAD algorithm to encrypt the key with (if AEAD protection is enabled)

Type:
  • enums.aead
Source:
  • packet/secret_key.js, line 72

algorithm :enums.publicKey

Public key algorithm.

Type:
  • enums.publicKey
Overrides:
  • PublicKeyPacket#algorithm
Source:
  • packet/public_key.js, line 62

created :Date

Key creation date.

Type:
  • Date
Overrides:
  • PublicKeyPacket#created
Source:
  • packet/public_key.js, line 57

expirationTimeV3 :Integer

Time until expiration in days (V3 only)

Type:
  • Integer
Overrides:
  • PublicKeyPacket#expirationTimeV3
Source:
  • packet/public_key.js, line 72

fingerprint :Uint8Array

Fingerprint bytes

Type:
  • Uint8Array
Overrides:
  • PublicKeyPacket#fingerprint
Source:
  • packet/public_key.js, line 77

isEncrypted

Indicates whether secret-key data is encrypted. this.isEncrypted === false means data is available in decrypted form.

Source:
  • packet/secret_key.js, line 52

keyID :module:type/keyid~KeyID

KeyID

Type:
  • module:type/keyid~KeyID
Overrides:
  • PublicKeyPacket#keyID
Source:
  • packet/public_key.js, line 82

keyMaterial

Secret-key data

Source:
  • packet/secret_key.js, line 48

privateParams :Object

Decrypted private parameters, referenced by name

Type:
  • Object
Source:
  • packet/secret_key.js, line 86

publicParams :Object

Algorithm specific public params

Type:
  • Object
Overrides:
  • PublicKeyPacket#publicParams
Source:
  • packet/public_key.js, line 67

readPublicKey

Alias of read()

Overrides:
  • PublicKeyPacket#readPublicKey
Source:
  • packet/public_key.js, line 290
See:
  • PublicKeyPacket#read

s2k :type/s2k

S2K object

Type:
  • type/s2k
Source:
  • packet/secret_key.js, line 62

s2kUsage :number

S2K usage

Type:
  • number
Source:
  • packet/secret_key.js, line 57

symmetric :enums.symmetric

Symmetric algorithm to encrypt the key with

Type:
  • enums.symmetric
Source:
  • packet/secret_key.js, line 67

version :Integer

Packet version

Type:
  • Integer
Overrides:
  • PublicKeyPacket#version
Source:
  • packet/public_key.js, line 52

writePublicKey

Alias of write()

Overrides:
  • PublicKeyPacket#writePublicKey
Source:
  • packet/public_key.js, line 297
See:
  • PublicKeyPacket#write

Methods

clearPrivateParams()

Clear private key parameters

Source:
  • packet/secret_key.js, line 546

(async) computeFingerprint()

Computes and set the fingerprint of the key

Overrides:
  • PublicKeyPacket#computeFingerprint
Source:
  • packet/public_key.js, line 231

(async) computeFingerprintAndKeyID()

Computes and set the key ID and fingerprint of the key

Overrides:
  • PublicKeyPacket#computeFingerprintAndKeyID
Source:
  • packet/public_key.js, line 215

(async) decrypt(passphrase, config)

Decrypts the private key params which are needed to use the key. Successful decryption does not imply key integrity, call validate() to confirm that. SecretKeyPacket.isDecrypted should be false, as otherwise calls to this function will throw an error.

Parameters:
Name Type Description
passphrase String

The passphrase for this private key as string

config Object
Source:
  • packet/secret_key.js, line 433
Throws:

if the key is already decrypted, or if decryption was not successful

Type
Error

(async) encrypt(passphrase, configopt)

Encrypt the payload. By default, we use aes256 and iterated, salted string to key specifier. If the key is in a decrypted state (isEncrypted === false) and the passphrase is empty or undefined, the key will be set as not encrypted. This can be used to remove passphrase protection after calling decrypt().

Parameters:
Name Type Attributes Description
passphrase String
config Object <optional>

Full configuration, defaults to openpgp.config

Source:
  • packet/secret_key.js, line 374
Throws:

if encryption was not successful

Type
Error

getAlgorithmInfo() → {Object}

Returns algorithm information

Overrides:
  • PublicKeyPacket#getAlgorithmInfo
Source:
  • packet/public_key.js, line 271
Returns:

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

Type
Object

getCreationTime() → {Date}

Returns the creation time of the key

Overrides:
  • PublicKeyPacket#getCreationTime
Source:
  • packet/public_key.js, line 199
Returns:
Type
Date

getFingerprint() → {String}

Calculates and returns the fingerprint of the key, as a string

Overrides:
  • PublicKeyPacket#getFingerprint
Source:
  • packet/public_key.js, line 255
Returns:

A string containing the fingerprint in lowercase hex

Type
String

getFingerprintBytes() → {Uint8Array}

Returns the fingerprint of the key, as an array of bytes

Overrides:
  • PublicKeyPacket#getFingerprintBytes
Source:
  • packet/public_key.js, line 247
Returns:

A Uint8Array containing the fingerprint

Type
Uint8Array

getKeyID() → {module:type/keyid~KeyID}

Return the key ID of the key

Overrides:
  • PublicKeyPacket#getKeyID
Source:
  • packet/public_key.js, line 207
Returns:

The 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:
  • PublicKeyPacket#hasSameFingerprintAs
Source:
  • packet/public_key.js, line 263
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 false for gnu-dummy keys and null for public keys.

Overrides:
  • PublicKeyPacket#isDecrypted
Source:
  • packet/secret_key.js, line 315
Returns:
Type
Boolean | null

isDummy() → {Boolean}

Check whether this is a gnu-dummy key

Source:
  • packet/secret_key.js, line 335
Returns:
Type
Boolean

isMissingSecretKeyMaterial()

Check whether the key includes secret key material. Some secret keys do not include it, and can thus only be used for public-key operations (encryption and verification). Such keys are:

  • GNU-dummy keys, where the secret material has been stripped away
  • encrypted keys with unsupported S2K or cipher
Source:
  • packet/secret_key.js, line 327

makeDummy(configopt)

Remove private key material, converting the key to a dummy one. The resulting key cannot be used for signing/decrypting but can still verify signatures.

Parameters:
Name Type Attributes Description
config Object <optional>

Full configuration, defaults to openpgp.config

Source:
  • packet/secret_key.js, line 344

(async) read(bytes)

Internal parser for private keys as specified in RFC4880bis-04 section 5.5.3

Parameters:
Name Type Description
bytes Uint8Array

Input string to read the packet from

Overrides:
  • PublicKeyPacket#read
Source:
  • packet/secret_key.js, line 104

(async) validate()

Checks that the key parameters are consistent

Source:
  • packet/secret_key.js, line 502
Throws:

if validation was not successful

Type
Error

write() → {Uint8Array}

Creates an OpenPGP key packet for the given key.

Overrides:
  • PublicKeyPacket#write
Source:
  • packet/secret_key.js, line 242
Returns:

A string of bytes containing the secret key OpenPGP packet.

Type
Uint8Array

writeForHash(version)

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

Parameters:
Name Type Description
version Integer

target version of signature or key

Overrides:
  • PublicKeyPacket#writeForHash
Source:
  • packet/public_key.js, line 179
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.