diff --git a/docs/AEADEncryptedDataPacket.html b/docs/AEADEncryptedDataPacket.html new file mode 100644 index 00000000..7b87d19c --- /dev/null +++ b/docs/AEADEncryptedDataPacket.html @@ -0,0 +1,1122 @@ + + + + + JSDoc: Class: AEADEncryptedDataPacket + + + + + + + + + + +
+ +

Class: AEADEncryptedDataPacket

+ + + + + + +
+ +
+ +

AEADEncryptedDataPacket()

+ +

Implementation of the Symmetrically Encrypted Authenticated Encryption with +Additional Data (AEAD) Protected Data Packet

+

https://tools.ietf.org/html/draft-ford-openpgp-format-00#section-2.1: +AEAD Protected Data Packet

+ + +
+ +
+
+ + + + +

Constructor

+ + + +

new AEADEncryptedDataPacket()

+ + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + +

Methods

+ + + + + + + +

(async) crypt(fn, key, data, streaming) → {Uint8Array|ReadableStream.<Uint8Array>}

+ + + + + + +
+

En/decrypt the payload.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
fn + + +encrypt +| + +decrypt + + + +

Whether to encrypt or decrypt

key + + +Uint8Array + + + +

The session key used to en/decrypt the payload

data + + +Uint8Array +| + +ReadableStream.<Uint8Array> + + + +

The data to en/decrypt

streaming + + +Boolean + + + +

Whether the top-level function will return a stream

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +Uint8Array +| + +ReadableStream.<Uint8Array> + + +
+
+ + + + + + + + + + + + + +

(async) decrypt(sessionKeyAlgorithm, key, streaming)

+ + + + + + +
+

Decrypt the encrypted payload.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
sessionKeyAlgorithm + + +String + + + +

The session key's cipher algorithm e.g. 'aes128'

key + + +Uint8Array + + + +

The session key used to encrypt the payload

streaming + + +Boolean + + + +

Whether the top-level function will return a stream

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Throws:
+ + + +
+
+
+

if decryption was not successful

+
+
+
+
+
+
+ Type +
+
+ +Error + + +
+
+
+
+
+ + + + + + + + + + + + + + + + +

(async) encrypt(sessionKeyAlgorithm, key, streaming, config)

+ + + + + + +
+

Encrypt the packet list payload.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
sessionKeyAlgorithm + + +String + + + +

The session key's cipher algorithm e.g. 'aes128'

key + + +Uint8Array + + + +

The session key used to encrypt the payload

streaming + + +Boolean + + + +

Whether the top-level function will return a stream

config + + +Object + + + +

(optional) full configuration, defaults to openpgp.config

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Throws:
+ + + +
+
+
+

if encryption was not successful

+
+
+
+
+
+
+ Type +
+
+ +Error + + +
+
+
+
+
+ + + + + + + + + + + + + + + + +

(async) read(bytes)

+ + + + + + +
+

Parse an encrypted payload of bytes in the order: version, IV, ciphertext (see specification)

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
bytes + + +Uint8Array +| + +ReadableStream.<Uint8Array> + + + +
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

write() → {Uint8Array|ReadableStream.<Uint8Array>}

+ + + + + + +
+

Write the encrypted payload of bytes in the order: version, IV, ciphertext (see specification)

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

The encrypted payload

+
+ + + +
+
+ Type +
+
+ +Uint8Array +| + +ReadableStream.<Uint8Array> + + +
+
+ + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ + + + + + + \ No newline at end of file diff --git a/docs/CleartextMessage.html b/docs/CleartextMessage.html new file mode 100644 index 00000000..2c119ae3 --- /dev/null +++ b/docs/CleartextMessage.html @@ -0,0 +1,1805 @@ + + + + + JSDoc: Class: CleartextMessage + + + + + + + + + + +
+ +

Class: CleartextMessage

+ + + + + + +
+ +
+ +

CleartextMessage(text, signature)

+ +

Class that represents an OpenPGP cleartext signed message. +See https://tools.ietf.org/html/rfc4880#section-7

+ + +
+ +
+
+ + + + +

Constructor

+ + + +

new CleartextMessage(text, signature)

+ + + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
text + + +String + + + +

The cleartext of the signed message

signature + + +Signature + + + +

The detached signature or an empty signature for unsigned messages

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + +

Classes

+ +
+
CleartextMessage
+
+
+ + + + + + + + + + + +

Methods

+ + + + + + + +

(static) fromText(text)

+ + + + + + +
+

Creates a new CleartextMessage object from text

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
text + + +String + + + +
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

armor(config) → {String|ReadableStream.<String>}

+ + + + + + +
+

Returns ASCII armored text of cleartext signed message

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
config + + +Object + + + +

(optional) full configuration, defaults to openpgp.config

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

ASCII armor

+
+ + + +
+
+ Type +
+
+ +String +| + +ReadableStream.<String> + + +
+
+ + + + + + + + + + + + + +

getSigningKeyIds() → {Array.<module:type/keyid~Keyid>}

+ + + + + + +
+

Returns the key IDs of the keys that signed the cleartext message

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

array of keyid objects

+
+ + + +
+
+ Type +
+
+ +Array.<module:type/keyid~Keyid> + + +
+
+ + + + + + + + + + + + + +

getText() → {String}

+ + + + + + +
+

Get cleartext

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

cleartext of message

+
+ + + +
+
+ Type +
+
+ +String + + +
+
+ + + + + + + + + + + + + +

(async) sign(privateKeys, signature, signingKeyIds, date, userIds, config) → {Promise.<CleartextMessage>}

+ + + + + + +
+

Sign the cleartext message

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDefaultDescription
privateKeys + + +Array.<Key> + + + + + +

private keys with decrypted secret key data for signing

signature + + +Signature + + + + + + null + +

(optional) any existing detached signature

signingKeyIds + + +Array.<module:type/keyid~Keyid> + + + + + +

(optional) array of key IDs to use for signing. Each signingKeyIds[i] corresponds to privateKeys[i]

date + + +Date + + + + + +

(optional) The creation time of the signature that should be created

userIds + + +Array + + + + + +

(optional) user IDs to sign with, e.g. [{ name:'Steve Sender', email:'steve@openpgp.org' }]

config + + +Object + + + + + +

(optional) full configuration, defaults to openpgp.config

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

new cleartext message with signed content

+
+ + + +
+
+ Type +
+
+ +Promise.<CleartextMessage> + + +
+
+ + + + + + + + + + + + + +

(async) signDetached(privateKeys, signature, signingKeyIds, date, userIds, config) → {Promise.<Signature>}

+ + + + + + +
+

Sign the cleartext message

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDefaultDescription
privateKeys + + +Array.<Key> + + + + + +

private keys with decrypted secret key data for signing

signature + + +Signature + + + + + + null + +

(optional) any existing detached signature

signingKeyIds + + +Array.<module:type/keyid~Keyid> + + + + + +

(optional) array of key IDs to use for signing. Each signingKeyIds[i] corresponds to privateKeys[i]

date + + +Date + + + + + +

(optional) The creation time of the signature that should be created

userIds + + +Array + + + + + +

(optional) user IDs to sign with, e.g. [{ name:'Steve Sender', email:'steve@openpgp.org' }]

config + + +Object + + + + + +

(optional) full configuration, defaults to openpgp.config

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

new detached signature of message content

+
+ + + +
+
+ Type +
+
+ +Promise.<Signature> + + +
+
+ + + + + + + + + + + + + +

(async) verify(keys, date, config) → {Promise.<Array.<{keyid: module:type/keyid~Keyid, valid: Boolean}>>}

+ + + + + + +
+

Verify signatures of cleartext signed message

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
keys + + +Array.<Key> + + + +

array of keys to verify signatures

date + + +Date + + + +

(optional) Verify the signature against the given date, i.e. check signature creation time < date < expiration time

config + + +Object + + + +

(optional) full configuration, defaults to openpgp.config

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

list of signer's keyid and validity of signature

+
+ + + +
+
+ Type +
+
+ +Promise.<Array.<{keyid: module:type/keyid~Keyid, valid: Boolean}>> + + +
+
+ + + + + + + + + + + + + +

(async) verifyDetached(keys, date, config) → {Promise.<Array.<{keyid: module:type/keyid~Keyid, valid: Boolean}>>}

+ + + + + + +
+

Verify signatures of cleartext signed message

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
keys + + +Array.<Key> + + + +

array of keys to verify signatures

date + + +Date + + + +

(optional) Verify the signature against the given date, i.e. check signature creation time < date < expiration time

config + + +Object + + + +

(optional) full configuration, defaults to openpgp.config

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

list of signer's keyid and validity of signature

+
+ + + +
+
+ Type +
+
+ +Promise.<Array.<{keyid: module:type/keyid~Keyid, valid: Boolean}>> + + +
+
+ + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ + + + + + + \ No newline at end of file diff --git a/docs/CompressedDataPacket.html b/docs/CompressedDataPacket.html new file mode 100644 index 00000000..ee104c02 --- /dev/null +++ b/docs/CompressedDataPacket.html @@ -0,0 +1,1034 @@ + + + + + JSDoc: Class: CompressedDataPacket + + + + + + + + + + +
+ +

Class: CompressedDataPacket

+ + + + + + +
+ +
+ +

CompressedDataPacket(config)

+ +

Implementation of the Compressed Data Packet (Tag 8)

+

RFC4880 5.6: +The Compressed Data packet contains compressed data. Typically, +this packet is found as the contents of an encrypted packet, or following +a Signature or One-Pass Signature packet, and contains a literal data packet.

+ + +
+ +
+
+ + + + +

Constructor

+ + + +

new CompressedDataPacket(config)

+ + + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
config + + +Object + + + +

(optional) full configuration, defaults to openpgp.config

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + +

Members

+ + + +

algorithm :compression

+ + + + +
+

Compression algorithm

+
+ + + +
Type:
+
    +
  • + +compression + + +
  • +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

compressed :Uint8Array|ReadableStream.<Uint8Array>

+ + + + +
+

Compressed packet data

+
+ + + +
Type:
+
    +
  • + +Uint8Array +| + +ReadableStream.<Uint8Array> + + +
  • +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

deflateLevel

+ + + + +
+

zip/zlib compression level, between 1 and 9

+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

packets :PacketList

+ + + + +
+

List of packets

+
+ + + +
Type:
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

tag :module:enums.packet

+ + + + +
+

Packet type

+
+ + + +
Type:
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + +

Methods

+ + + + + + + +

compress()

+ + + + + + +
+

Compress the packet data (member decompressedData)

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

(async) decompress()

+ + + + + + +
+

Decompression method for decompressing the compressed data +read by read_packet

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

(async) read(bytes)

+ + + + + + +
+

Parsing function for the packet.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
bytes + + +Uint8Array +| + +ReadableStream.<Uint8Array> + + + +

Payload of a tag 8 packet

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

write() → {Uint8Array|ReadableStream.<Uint8Array>}

+ + + + + + +
+

Return the compressed packet.

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

binary compressed packet

+
+ + + +
+
+ Type +
+
+ +Uint8Array +| + +ReadableStream.<Uint8Array> + + +
+
+ + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ + + + + + + \ No newline at end of file diff --git a/docs/HKP.html b/docs/HKP.html new file mode 100644 index 00000000..10282672 --- /dev/null +++ b/docs/HKP.html @@ -0,0 +1,597 @@ + + + + + JSDoc: Class: HKP + + + + + + + + + + +
+ +

Class: HKP

+ + + + + + +
+ +
+ +

HKP(keyServerBaseUrl, config)

+ +

This class implements a client for the OpenPGP HTTP Keyserver Protocol (HKP) +in order to lookup and upload keys on standard public key servers.

+ + +
+ +
+
+ + + + +

Constructor

+ + + +

new HKP(keyServerBaseUrl, config)

+ + + + + + +
+

Initialize the HKP client and configure it with the key server url and fetch function.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
keyServerBaseUrl + + +String + + + +

(optional) The HKP key server base url including +the protocol to use, e.g. 'https://pgp.mit.edu'; defaults to +openpgp.config.keyserver (https://keyserver.ubuntu.com)

config + + +Object + + + +

(optional) full configuration, defaults to openpgp.config

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + +

Methods

+ + + + + + + +

(async) lookup() → {Promise.<String>}

+ + + + + + +
+

Search for a public key on the key server either by key ID or part of the user ID.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
options.keyId + + +String + + + +

The long public key ID.

options.query + + +String + + + +

This can be any part of the key user ID such as name +or email address.

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

The ascii armored public key.

+
+ + + +
+
+ Type +
+
+ +Promise.<String> + + +
+
+ + + + + + + + + + + + + +

(async) upload(publicKeyArmored) → {Promise}

+ + + + + + +
+

Upload a public key to the server.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
publicKeyArmored + + +String + + + +

An ascii armored public key to be uploaded.

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +Promise + + +
+
+ + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ + + + + + + \ No newline at end of file diff --git a/docs/Key.html b/docs/Key.html new file mode 100644 index 00000000..70a79bba --- /dev/null +++ b/docs/Key.html @@ -0,0 +1,7170 @@ + + + + + JSDoc: Class: Key + + + + + + + + + + +
+ +

Class: Key

+ + + + + + +
+ +
+ +

Key(packetlist)

+ +

Class that represents an OpenPGP key. Must contain a primary key. +Can contain additional subkeys, signatures, user ids, user attributes.

+ + +
+ +
+
+ + + + +

Constructor

+ + + +

new Key(packetlist)

+ + + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
packetlist + + +PacketList + + + +

The packets that form this key

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + +

Methods

+ + + + + + + +

(async) addSubkey() → {Promise.<Key>}

+ + + + + + +
+

Generates a new OpenPGP subkey, and returns a clone of the Key object with the new subkey added. +Supports RSA and ECC keys. Defaults to the algorithm and bit size/curve of the primary key. DSA primary keys default to RSA subkeys.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
options.type + + +ecc +| + +rsa + + + +

The subkey algorithm: ECC or RSA

options.curve + + +String + + + +

(optional) Elliptic curve for ECC keys

options.rsaBits + + +Integer + + + +

(optional) Number of bits for RSA subkeys

options.keyExpirationTime + + +Number + + + +

(optional) Number of seconds from the key creation time after which the key expires

options.date + + +Date + + + +

(optional) Override the creation date of the key and the key signatures

options.sign + + +Boolean + + + +

(optional) Indicates whether the subkey should sign rather than encrypt. Defaults to false

options.config + + +Object + + + +

(optional) custom configuration settings to overwrite those in openpgp.config

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +Promise.<Key> + + +
+
+ + + + + + + + + + + + + +

(async) applyRevocationCertificate(revocationCertificate, config) → {Promise.<Key>}

+ + + + + + +
+

Applies a revocation certificate to a key +This adds the first signature packet in the armored text to the key, +if it is a valid revocation signature.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
revocationCertificate + + +String + + + +

armored revocation certificate

config + + +Object + + + +

(optional) full configuration, defaults to openpgp.config

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

new revoked key

+
+ + + +
+
+ Type +
+
+ +Promise.<Key> + + +
+
+ + + + + + + + + + + + + +

armor(config) → {ReadableStream.<String>}

+ + + + + + +
+

Returns ASCII armored text of key

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
config + + +Object + + + +

(optional) full configuration, defaults to openpgp.config

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

ASCII armor

+
+ + + +
+
+ Type +
+
+ +ReadableStream.<String> + + +
+
+ + + + + + + + + + + + + +

clearPrivateParams()

+ + + + + + +
+

Clear private key parameters

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

(async) clone() → {Promise.<Key>}

+ + + + + + +
+

Clones the key object

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

shallow clone of the key

+
+ + + +
+
+ Type +
+
+ +Promise.<Key> + + +
+
+ + + + + + + + + + + + + +

(async) decrypt(passphrases, keyId, config)

+ + + + + + +
+

Decrypts all secret key and subkey packets matching keyId

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDefaultDescription
passphrases + + +String +| + +Array.<String> + + + + + +
keyId + + +module:type/keyid~Keyid + + + + + + null + +
config + + +Object + + + + + +

(optional) full configuration, defaults to openpgp.config

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Throws:
+ + + +
+
+
+

if any matching key or subkey packets did not decrypt successfully

+
+
+
+
+
+
+ Type +
+
+ +Error + + +
+
+
+
+
+ + + + + + + + + + + + + + + + +

(async) encrypt(passphrases, keyId, config)

+ + + + + + +
+

Encrypts all secret key and subkey packets matching keyId

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDefaultDescription
passphrases + + +String +| + +Array.<String> + + + + + +

if multiple passphrases, then should be in same order as packets each should encrypt

keyId + + +module:type/keyid~Keyid + + + + + + null + +
config + + +Object + + + + + +

(optional) full configuration, defaults to openpgp.config

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Throws:
+ + + +
+
+
+

if encryption failed for any key or subkey

+
+
+
+
+
+
+ Type +
+
+ +Error + + +
+
+
+
+
+ + + + + + + + + + + + + + + + +

getAlgorithmInfo() → {Object}

+ + + + + + +
+

Returns algorithm information

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

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

+
+ + + +
+
+ Type +
+
+ +Object + + +
+
+ + + + + + + + + + + + + +

getAlgorithmInfo() → {Object}

+ + + + + + +
+

Returns algorithm information

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

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

+
+ + + +
+
+ Type +
+
+ +Object + + +
+
+ + + + + + + + + + + + + +

getCreationTime() → {Date}

+ + + + + + +
+

Returns the creation time of the key

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +Date + + +
+
+ + + + + + + + + + + + + +

getCreationTime() → {Date}

+ + + + + + +
+

Returns the creation time of the key

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +Date + + +
+
+ + + + + + + + + + + + + +

(async) getDecryptionKeys(keyId,, date,, userId,, config) → {Promise.<Array.<(Key|SubKey)>>}

+ + + + + + +
+

Returns all keys that are available for decryption, matching the keyId when given +This is useful to retrieve keys for session key decryption

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
keyId, + + +module:type/keyid~Keyid + + + +

optional

date, + + +Date + + + +

optional

userId, + + +String + + + +

optional

config + + +Object + + + +

(optional) full configuration, defaults to openpgp.config

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

array of decryption keys

+
+ + + +
+
+ Type +
+
+ +Promise.<Array.<(Key|SubKey)>> + + +
+
+ + + + + + + + + + + + + +

(async) getEncryptionKey(keyId,, date,, userId,, config) → {Promise.<(Key|SubKey|null)>}

+ + + + + + +
+

Returns last created key or key by given keyId that is available for encryption or decryption

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
keyId, + + +module:type/keyid~Keyid + + + +

optional

date, + + +Date + + + +

optional

userId, + + +String + + + +

optional

config + + +Object + + + +

(optional) full configuration, defaults to openpgp.config

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

key or null if no encryption key has been found

+
+ + + +
+
+ Type +
+
+ +Promise.<(Key|SubKey|null)> + + +
+
+ + + + + + + + + + + + + +

(async) getExpirationTime(capabilities,, keyId,, userId,, config) → {Promise.<(Date|Infinity|null)>}

+ + + + + + +
+

Returns the latest date when the key can be used for encrypting, signing, or both, depending on the capabilities paramater. +When capabilities is null, defaults to returning the expiry date of the primary key. +Returns null if capabilities is passed and the key does not have the specified capabilities or is revoked or invalid. +Returns Infinity if the key doesn't expire.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
capabilities, + + +encrypt +| + +sign +| + +encrypt_sign + + + +

optional

keyId, + + +module:type/keyid~Keyid + + + +

optional

userId, + + +Object + + + +

optional user ID

config + + +Object + + + +

(optional) full configuration, defaults to openpgp.config

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +Promise.<(Date|Infinity|null)> + + +
+
+ + + + + + + + + + + + + +

getFingerprint() → {String}

+ + + + + + +
+

Calculates the fingerprint of the key

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

A string containing the fingerprint in lowercase hex

+
+ + + +
+
+ Type +
+
+ +String + + +
+
+ + + + + + + + + + + + + +

getFingerprint() → {String}

+ + + + + + +
+

Calculates the fingerprint of the key

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

A string containing the fingerprint in lowercase hex

+
+ + + +
+
+ Type +
+
+ +String + + +
+
+ + + + + + + + + + + + + +

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

+ + + + + + +
+

Calculates the key id of the key

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

A 8 byte key id

+
+ + + +
+
+ Type +
+
+ +module:type/keyid~Keyid + + +
+
+ + + + + + + + + + + + + +

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

+ + + + + + +
+

Calculates the key id of the key

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

A 8 byte key id

+
+ + + +
+
+ Type +
+
+ +module:type/keyid~Keyid + + +
+
+ + + + + + + + + + + + + +

getKeyIds() → {Array.<module:type/keyid~Keyid>}

+ + + + + + +
+

Returns key IDs of all keys

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +Array.<module:type/keyid~Keyid> + + +
+
+ + + + + + + + + + + + + +

getKeys(keyId) → {Array.<(Key|SubKey)>}

+ + + + + + +
+

Returns an array containing all public or private keys matching keyId. +If keyId is not present, returns all keys starting with the primary key.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDefaultDescription
keyId + + +type/keyid + + + + + + null + +
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +Array.<(Key|SubKey)> + + +
+
+ + + + + + + + + + + + + +

(async) getPrimaryUser(date, userId, config) → {Promise.<{user: User, selfCertification: SignaturePacket}>}

+ + + + + + +
+

Returns primary user and most significant (latest valid) self signature

+
    +
  • if multiple primary users exist, returns the one with the latest self signature
  • +
  • otherwise, returns the user with the latest self signature
  • +
+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
date + + +Date + + + +

(optional) use the given date for verification instead of the current time

userId + + +Object + + + +

(optional) user ID to get instead of the primary user, if it exists

config + + +Object + + + +

(optional) full configuration, defaults to openpgp.config

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

The primary user and the self signature

+
+ + + +
+
+ Type +
+
+ +Promise.<{user: User, selfCertification: SignaturePacket}> + + +
+
+ + + + + + + + + + + + + +

(async) getRevocationCertificate(date, config) → {Promise.<String>}

+ + + + + + +
+

Get revocation certificate from a revoked key. +(To get a revocation certificate for an unrevoked key, call revoke() first.)

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
date + + +Date + + + +

Use the given date instead of the current time

config + + +Object + + + +

(optional) full configuration, defaults to openpgp.config

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

armored revocation certificate

+
+ + + +
+
+ Type +
+
+ +Promise.<String> + + +
+
+ + + + + + + + + + + + + +

(async) getSigningKey(keyId,, date, userId,, config) → {Promise.<(Key|SubKey|null)>}

+ + + + + + +
+

Returns last created key or key by given keyId that is available for signing and verification

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
keyId, + + +module:type/keyid~Keyid + + + +

optional

date + + +Date + + + +

(optional) use the given date for verification instead of the current time

userId, + + +Object + + + +

optional user ID

config + + +Object + + + +

(optional) full configuration, defaults to openpgp.config

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

key or null if no signing key has been found

+
+ + + +
+
+ Type +
+
+ +Promise.<(Key|SubKey|null)> + + +
+
+ + + + + + + + + + + + + +

getSubkeys(keyId) → {Array.<SubKey>}

+ + + + + + +
+

Returns an array containing all public or private subkeys matching keyId; +If keyId is not present, returns all subkeys.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDefaultDescription
keyId + + +type/keyid + + + + + + null + +
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +Array.<SubKey> + + +
+
+ + + + + + + + + + + + + +

getUserIds() → {Array.<string>}

+ + + + + + +
+

Returns userids

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

array of userids

+
+ + + +
+
+ Type +
+
+ +Array.<string> + + +
+
+ + + + + + + + + + + + + +

hasSameFingerprintAs() → {Boolean}

+ + + + + + +
+

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

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

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

+
+ + + +
+
+ Type +
+
+ +Boolean + + +
+
+ + + + + + + + + + + + + +

hasSameFingerprintAs() → {Boolean}

+ + + + + + +
+

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

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

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

+
+ + + +
+
+ Type +
+
+ +Boolean + + +
+
+ + + + + + + + + + + + + +

isDecrypted()

+ + + + + + +
+

Returns true if the primary key or any subkey is decrypted. +A dummy key is considered encrypted.

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

isPrivate() → {Boolean}

+ + + + + + +
+

Returns true if this is a private key

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +Boolean + + +
+
+ + + + + + + + + + + + + +

isPublic() → {Boolean}

+ + + + + + +
+

Returns true if this is a public key

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +Boolean + + +
+
+ + + + + + + + + + + + + +

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

+ + + + + + +
+

Checks if a signature on a key is revoked

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
signature + + +SignaturePacket + + + +

The signature to verify

key, + + +PublicSubkeyPacket +| + +SecretSubkeyPacket +| + +PublicKeyPacket +| + +SecretKeyPacket + + + +

optional The key to verify the signature

date + + +Date + + + +

Use the given date instead of the current time

config + + +Object + + + +

(optional) full configuration, defaults to openpgp.config

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

True if the certificate is revoked

+
+ + + +
+
+ Type +
+
+ +Promise.<Boolean> + + +
+
+ + + + + + + + + + + + + +

packetlist2structure(packetlist)

+ + + + + + +
+

Transforms packetlist to structured key data

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
packetlist + + +PacketList + + + +

The packets that form a key

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

(async) revoke(reasonForRevocation, date, config) → {Promise.<Key>}

+ + + + + + +
+

Revokes the key

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
reasonForRevocation + + +Object + + + +

optional, object indicating the reason for revocation

+
Properties
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
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

config + + +Object + + + +

(optional) full configuration, defaults to openpgp.config

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

new key with revocation signature

+
+ + + +
+
+ Type +
+
+ +Promise.<Key> + + +
+
+ + + + + + + + + + + + + +

(async) signAllUsers(privateKeys, config) → {Promise.<Key>}

+ + + + + + +
+

Signs all users of key

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
privateKeys + + +Array.<Key> + + + +

decrypted private keys for signing

config + + +Object + + + +

(optional) full configuration, defaults to openpgp.config

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

new public key with new certificate signature

+
+ + + +
+
+ Type +
+
+ +Promise.<Key> + + +
+
+ + + + + + + + + + + + + +

(async) signPrimaryUser(privateKeys, date, userId, config) → {Promise.<Key>}

+ + + + + + +
+

Signs primary user of key

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
privateKeys + + +Array.<Key> + + + +

decrypted private keys for signing

date + + +Date + + + +

(optional) use the given date for verification instead of the current time

userId + + +Object + + + +

(optional) user ID to get instead of the primary user, if it exists

config + + +Object + + + +

(optional) full configuration, defaults to openpgp.config

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

new public key with new certificate signature

+
+ + + +
+
+ Type +
+
+ +Promise.<Key> + + +
+
+ + + + + + + + + + + + + +

toPacketlist() → {PacketList}

+ + + + + + +
+

Transforms structured key data to packetlist

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

The packets that form a key

+
+ + + +
+
+ Type +
+
+ +PacketList + + +
+
+ + + + + + + + + + + + + +

toPublic(config) → {Key}

+ + + + + + +
+

Returns key as public key (shallow copy)

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
config + + +Object + + + +

(optional) full configuration, defaults to openpgp.config

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

new public Key

+
+ + + +
+
+ Type +
+
+ +Key + + +
+
+ + + + + + + + + + + + + +

(async) update(key, config) → {Promise.<undefined>}

+ + + + + + +
+

Update key with new components from specified key with same key ID: +users, subkeys, certificates are merged into the destination key, +duplicates and expired signatures are ignored.

+

If the specified key is a private key and the destination key is public, +the destination key is transformed to a private key.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
key + + +Key + + + +

Source key to merge

config + + +Object + + + +

(optional) full configuration, defaults to openpgp.config

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +Promise.<undefined> + + +
+
+ + + + + + + + + + + + + +

(async) validate(config)

+ + + + + + +
+

Check whether the private and public primary key parameters correspond +Together with verification of binding signatures, this guarantees key integrity +In case of gnu-dummy primary key, it is enough to validate any signing subkeys +otherwise all encryption subkeys are validated +If only gnu-dummy keys are found, we cannot properly validate so we throw an error

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
config + + +Object + + + +

(optional) full configuration, defaults to openpgp.config

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Throws:
+ + + +
+
+
+

if validation was not successful and the key cannot be trusted

+
+
+
+
+
+
+ Type +
+
+ +Error + + +
+
+
+
+
+ + + + + + + + + + + + + + + + +

(async) verifyAllUsers(keys, config) → {Promise.<Array.<{userid: String, keyid: module:type/keyid~Keyid, valid: Boolean}>>}

+ + + + + + +
+

Verifies all users of key

+
    +
  • if no arguments are given, verifies the self certificates;
  • +
  • otherwise, verifies all certificates signed with given keys.
  • +
+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
keys + + +Array.<Key> + + + +

array of keys to verify certificate signatures

config + + +Object + + + +

(optional) full configuration, defaults to openpgp.config

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

list of userid, signer's keyid and validity of signature

+
+ + + +
+
+ Type +
+
+ +Promise.<Array.<{userid: String, keyid: module:type/keyid~Keyid, valid: Boolean}>> + + +
+
+ + + + + + + + + + + + + +

(async) verifyPrimaryKey(date, userId, config)

+ + + + + + +
+

Verify primary key. Checks for revocation signatures, expiration time +and valid self signature. Throws if the primary key is invalid.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
date + + +Date + + + +

(optional) use the given date for verification instead of the current time

userId + + +Object + + + +

(optional) user ID

config + + +Object + + + +

(optional) full configuration, defaults to openpgp.config

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Throws:
+ + + +
+
+
+

If key verification failed

+
+
+
+
+
+
+ Type +
+
+ +Error + + +
+
+
+
+
+ + + + + + + + + + + + + + + + +

(async) verifyPrimaryUser(keys, date, userId, config) → {Promise.<Array.<{keyid: module:type/keyid~Keyid, valid: Boolean}>>}

+ + + + + + +
+

Verifies primary user of key

+
    +
  • if no arguments are given, verifies the self certificates;
  • +
  • otherwise, verifies all certificates signed with given keys.
  • +
+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
keys + + +Array.<Key> + + + +

array of keys to verify certificate signatures

date + + +Date + + + +

(optional) use the given date for verification instead of the current time

userId + + +Object + + + +

(optional) user ID to get instead of the primary user, if it exists

config + + +Object + + + +

(optional) full configuration, defaults to openpgp.config

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

List of signer's keyid and validity of signature

+
+ + + +
+
+ Type +
+
+ +Promise.<Array.<{keyid: module:type/keyid~Keyid, valid: Boolean}>> + + +
+
+ + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ + + + + + + \ No newline at end of file diff --git a/docs/KeyArray.html b/docs/KeyArray.html new file mode 100644 index 00000000..722be969 --- /dev/null +++ b/docs/KeyArray.html @@ -0,0 +1,1062 @@ + + + + + JSDoc: Class: KeyArray + + + + + + + + + + +
+ +

Class: KeyArray

+ + + + + + +
+ +
+ +

KeyArray(keys)

+ +

Array of keys

+ + +
+ +
+
+ + + + +

Constructor

+ + + +

new KeyArray(keys)

+ + + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
keys + + +Array.<Key> + + + +

The keys to store in this array

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + +

Methods

+ + + + + + + +

getForAddress(email) → {Array.<Key>}

+ + + + + + +
+

Searches all keys in the KeyArray matching the address or address part of the user ids

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
email + + +String + + + +

email address to search for

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

The public keys associated with provided email address.

+
+ + + +
+
+ Type +
+
+ +Array.<Key> + + +
+
+ + + + + + + + + + + + + +

getForId(keyId, deep) → {Key|null}

+ + + + + + +
+

Searches the KeyArray for a key having the specified key id

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
keyId + + +String + + + +

provided as string of lowercase hex number +withouth 0x prefix (can be 16-character key ID or fingerprint)

deep + + +Boolean + + + +

if true search also in subkeys

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

key found or null

+
+ + + +
+
+ Type +
+
+ +Key +| + +null + + +
+
+ + + + + + + + + + + + + +

(async) importKey(armored, config)

+ + + + + + +
+

Imports a key from an ascii armored message

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
armored + + +String + + + +

message to read the keys/key from

config + + +Object + + + +

(optional) full configuration, defaults to openpgp.config

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

push(key) → {Number}

+ + + + + + +
+

Add key to KeyArray

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
key + + +Key + + + +

The key that will be added to the keyring

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

The new length of the KeyArray

+
+ + + +
+
+ Type +
+
+ +Number + + +
+
+ + + + + + + + + + + + + +

removeForId(keyId) → {Key|null}

+ + + + + + +
+

Removes a key with the specified keyid from the keyring

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
keyId + + +String + + + +

provided as string of lowercase hex number +withouth 0x prefix (can be 16-character key ID or fingerprint)

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

The key object which has been removed or null

+
+ + + +
+
+ Type +
+
+ +Key +| + +null + + +
+
+ + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ + + + + + + \ No newline at end of file diff --git a/docs/Keyring.html b/docs/Keyring.html new file mode 100644 index 00000000..f3ccdf41 --- /dev/null +++ b/docs/Keyring.html @@ -0,0 +1,1003 @@ + + + + + JSDoc: Class: Keyring + + + + + + + + + + +
+ +

Class: Keyring

+ + + + + + +
+ +
+ +

Keyring(storeHandleropt, config)

+ + +
+ +
+
+ + + + + + +

new Keyring(storeHandleropt, config)

+ + + + + + +
+

Initialization routine for the keyring.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
storeHandler + + +keyring/localstore + + + + + + <optional>
+ + + + + +

class implementing loadPublic(), loadPrivate(), storePublic(), and storePrivate() methods

config + + +Object + + + + + + + + + +

(optional) full configuration, defaults to openpgp.config

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + +

Methods

+ + + + + + + +

clear()

+ + + + + + +
+

Clear the keyring - erase all the keys

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

getAllKeys() → {Array.<Key>}

+ + + + + + +
+

Get all public and private keys

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

all keys

+
+ + + +
+
+ Type +
+
+ +Array.<Key> + + +
+
+ + + + + + + + + + + + + +

getKeysForId(keyId, deep) → {Array.<Key>|null}

+ + + + + + +
+

Searches the keyring for keys having the specified key id

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
keyId + + +String + + + +

provided as string of lowercase hex number +withouth 0x prefix (can be 16-character key ID or fingerprint)

deep + + +Boolean + + + +

if true search also in subkeys

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

keys found or null

+
+ + + +
+
+ Type +
+
+ +Array.<Key> +| + +null + + +
+
+ + + + + + + + + + + + + +

(async) load()

+ + + + + + +
+

Calls the storeHandler to load the keys

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

removeKeysForId(keyId) → {Array.<Key>|null}

+ + + + + + +
+

Removes keys having the specified key id from the keyring

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
keyId + + +String + + + +

provided as string of lowercase hex number +withouth 0x prefix (can be 16-character key ID or fingerprint)

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

keys found or null

+
+ + + +
+
+ Type +
+
+ +Array.<Key> +| + +null + + +
+
+ + + + + + + + + + + + + +

(async) store()

+ + + + + + +
+

Calls the storeHandler to save the keys

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ + + + + + + \ No newline at end of file diff --git a/docs/LiteralDataPacket.html b/docs/LiteralDataPacket.html new file mode 100644 index 00000000..1400c3b0 --- /dev/null +++ b/docs/LiteralDataPacket.html @@ -0,0 +1,1576 @@ + + + + + JSDoc: Class: LiteralDataPacket + + + + + + + + + + +
+ +

Class: LiteralDataPacket

+ + + + + + +
+ +
+ +

LiteralDataPacket(date)

+ +

Implementation of the Literal Data Packet (Tag 11)

+

RFC4880 5.9: +A Literal Data packet contains the body of a message; data that is not to be +further interpreted.

+ + +
+ +
+
+ + + + +

Constructor

+ + + +

new LiteralDataPacket(date)

+ + + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
date + + +Date + + + +

the creation date of the literal package

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + +

Methods

+ + + + + + + +

getBytes(clone) → {Uint8Array|ReadableStream.<Uint8Array>}

+ + + + + + +
+

Get the byte sequence representing the literal packet data

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDefaultDescription
clone + + +Boolean + + + + + + false + +

(optional) Whether to return a clone so that getBytes/getText can be called again

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

A sequence of bytes

+
+ + + +
+
+ Type +
+
+ +Uint8Array +| + +ReadableStream.<Uint8Array> + + +
+
+ + + + + + + + + + + + + +

getFilename() → {String}

+ + + + + + +
+

Get the filename of the literal packet data

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

filename

+
+ + + +
+
+ Type +
+
+ +String + + +
+
+ + + + + + + + + + + + + +

getText(clone) → {String|ReadableStream.<String>}

+ + + + + + +
+

Returns literal data packets as native JavaScript string +with normalized end of line to \n

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDefaultDescription
clone + + +Boolean + + + + + + false + +

(optional) Whether to return a clone so that getBytes/getText can be called again

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

literal data as text

+
+ + + +
+
+ Type +
+
+ +String +| + +ReadableStream.<String> + + +
+
+ + + + + + + + + + + + + +

(async) read(input) → {LiteralDataPacket}

+ + + + + + +
+

Parsing function for a literal data packet (tag 11).

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
input + + +Uint8Array +| + +ReadableStream.<Uint8Array> + + + +

Payload of a tag 11 packet

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

object representation

+
+ + + +
+
+ Type +
+
+ +LiteralDataPacket + + +
+
+ + + + + + + + + + + + + +

setBytes(bytes, format)

+ + + + + + +
+

Set the packet data to value represented by the provided string of bytes.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
bytes + + +Uint8Array +| + +ReadableStream.<Uint8Array> + + + +

The string of bytes

format + + +utf8 +| + +binary +| + +text +| + +mime + + + +

The format of the string of bytes

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

setFilename(filename)

+ + + + + + +
+

Sets the filename of the literal packet data

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
filename + + +String + + + +

Any native javascript string

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

setText(text, format)

+ + + + + + +
+

Set the packet data to a javascript native string, end of line +will be normalized to \r\n and by default text is converted to UTF8

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDefaultDescription
text + + +String +| + +ReadableStream.<String> + + + + + +

Any native javascript string

format + + +utf8 +| + +binary +| + +text +| + +mime + + + + + + utf8 + +

(optional) The format of the string of bytes

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

write() → {Uint8Array|ReadableStream.<Uint8Array>}

+ + + + + + +
+

Creates a Uint8Array representation of the packet

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

Uint8Array representation of the packet

+
+ + + +
+
+ Type +
+
+ +Uint8Array +| + +ReadableStream.<Uint8Array> + + +
+
+ + + + + + + + + + + + + +

writeHeader() → {Uint8Array}

+ + + + + + +
+

Creates a Uint8Array representation of the packet, excluding the data

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

Uint8Array representation of the packet

+
+ + + +
+
+ Type +
+
+ +Uint8Array + + +
+
+ + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ + + + + + + \ No newline at end of file diff --git a/docs/MarkerPacket.html b/docs/MarkerPacket.html new file mode 100644 index 00000000..fee90d58 --- /dev/null +++ b/docs/MarkerPacket.html @@ -0,0 +1,390 @@ + + + + + JSDoc: Class: MarkerPacket + + + + + + + + + + +
+ +

Class: MarkerPacket

+ + + + + + +
+ +
+ +

MarkerPacket()

+ +

Implementation of the strange "Marker packet" (Tag 10)

+

RFC4880 5.8: +An experimental version of PGP used this packet as the Literal +packet, but no released version of PGP generated Literal packets with this +tag. With PGP 5.x, this packet has been reassigned and is reserved for use as +the Marker packet.

+

Such a packet MUST be ignored when received.

+ + +
+ +
+
+ + + + +

Constructor

+ + + +

new MarkerPacket()

+ + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + +

Methods

+ + + + + + + +

read(input, position, len) → {MarkerPacket}

+ + + + + + +
+

Parsing function for a literal data packet (tag 10).

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
input + + +String + + + +

Payload of a tag 10 packet

position + + +Integer + + + +

Position to start reading from the input string

len + + +Integer + + + +

Length of the packet or the remaining length of +input at position

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

Object representation

+
+ + + +
+
+ Type +
+
+ +MarkerPacket + + +
+
+ + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ + + + + + + \ No newline at end of file diff --git a/docs/Message.html b/docs/Message.html new file mode 100644 index 00000000..8967dee0 --- /dev/null +++ b/docs/Message.html @@ -0,0 +1,4628 @@ + + + + + JSDoc: Class: Message + + + + + + + + + + +
+ +

Class: Message

+ + + + + + +
+ +
+ +

Message(packetlist)

+ +

Class that represents an OpenPGP message. +Can be an encrypted message, signed message, compressed message or literal message +See https://tools.ietf.org/html/rfc4880#section-11.3

+ + +
+ +
+
+ + + + +

Constructor

+ + + +

new Message(packetlist)

+ + + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
packetlist + + +PacketList + + + +

The packets that form this message

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + +

Classes

+ +
+
Message
+
+
+ + + + + + + + + + + +

Methods

+ + + + + + + +

(async, static) encryptSessionKey(sessionKey, algorithm, aeadAlgorithm, publicKeys, passwords, wildcard, encryptionKeyIds, date, userIds, config) → {Promise.<Message>}

+ + + + + + +
+

Encrypt a session key either with public keys, passwords, or both at once.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDefaultDescription
sessionKey + + +Uint8Array + + + + + +

session key for encryption

algorithm + + +String + + + + + +

session key algorithm

aeadAlgorithm + + +String + + + + + +

(optional) aead algorithm, e.g. 'eax' or 'ocb'

publicKeys + + +Array.<Key> + + + + + +

(optional) public key(s) for message encryption

passwords + + +Array.<String> + + + + + +

(optional) for message encryption

wildcard + + +Boolean + + + + + + false + +

(optional) use a key ID of 0 instead of the public key IDs

encryptionKeyIds + + +Array.<module:type/keyid~Keyid> + + + + + +

(optional) array of key IDs to use for encryption. Each encryptionKeyIds[i] corresponds to publicKeys[i]

date + + +Date + + + + + +

(optional) override the date

userIds + + +Array + + + + + +

(optional) user IDs to encrypt for, e.g. [{ name:'Robert Receiver', email:'robert@openpgp.org' }]

config + + +Object + + + + + +

(optional) full configuration, defaults to openpgp.config

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

new message with encrypted content

+
+ + + +
+
+ Type +
+
+ +Promise.<Message> + + +
+
+ + + + + + + + + + + + + +

(static) fromBinary(bytes, filename, date, type) → {Message}

+ + + + + + +
+

creates new message object from binary data

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDefaultDescription
bytes + + +Uint8Array +| + +ReadableStream.<Uint8Array> + + + + + +
filename + + +String + + + + + +

(optional)

date + + +Date + + + + + +

(optional)

type + + +utf8 +| + +binary +| + +text +| + +mime + + + + + + binary + +

(optional) data packet type

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

new message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + + + + +

(static) fromText(text, filename, date, type) → {Message}

+ + + + + + +
+

creates new message object from text

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDefaultDescription
text + + +String +| + +ReadableStream.<String> + + + + + +
filename + + +String + + + + + +

(optional)

date + + +Date + + + + + +

(optional)

type + + +utf8 +| + +binary +| + +text +| + +mime + + + + + + utf8 + +

(optional) data packet type

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

new message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + + + + +

(async, static) generateSessionKey(keys, date, userIds, config) → {Promise.<{data: Uint8Array, algorithm: String}>}

+ + + + + + +
+

Generate a new session key object, taking the algorithm preferences of the passed public keys into account, if any.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
keys + + +Array.<Key> + + + +

(optional) public key(s) to select algorithm preferences for

date + + +Date + + + +

(optional) date to select algorithm preferences at

userIds + + +Array.<Object> + + + +

(optional) user IDs to select algorithm preferences for

config + + +Object + + + +

(optional) full configuration, defaults to openpgp.config

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

object with session key data and algorithm

+
+ + + +
+
+ Type +
+
+ +Promise.<{data: Uint8Array, algorithm: String}> + + +
+
+ + + + + + + + + + + + + +

(async) appendSignature(detachedSignature)

+ + + + + + +
+

Append signature to unencrypted message object

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
detachedSignature + + +String +| + +Uint8Array + + + +

The detached ASCII-armored or Uint8Array PGP signature

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

armor(config) → {ReadableStream.<String>}

+ + + + + + +
+

Returns ASCII armored text of message

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
config + + +Object + + + +

(optional) full configuration, defaults to openpgp.config

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

ASCII armor

+
+ + + +
+
+ Type +
+
+ +ReadableStream.<String> + + +
+
+ + + + + + + + + + + + + +

compress(config) → {Message}

+ + + + + + +
+

Compresses the message (the literal and -if signed- signature data packets of the message)

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
config + + +Object + + + +

(optional) full configuration, defaults to openpgp.config

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

new message with compressed content

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + + + + +

(async) decrypt(privateKeys, passwords, sessionKeys, streaming, config) → {Promise.<Message>}

+ + + + + + +
+

Decrypt the message. Either a private key, a session key, or a password must be specified.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
privateKeys + + +Array.<Key> + + + +

(optional) private keys with decrypted secret data

passwords + + +Array.<String> + + + +

(optional) passwords used to decrypt

sessionKeys + + +Array.<Object> + + + +

(optional) session keys in the form: { data:Uint8Array, algorithm:String, [aeadAlgorithm:String] }

streaming + + +Boolean + + + +

(optional) whether to process data as a stream

config + + +Object + + + +

(optional) full configuration, defaults to openpgp.config

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

new message with decrypted content

+
+ + + +
+
+ Type +
+
+ +Promise.<Message> + + +
+
+ + + + + + + + + + + + + +

(async) decryptSessionKeys(privateKeys, passwords, config) → {Promise.<Array.<{data: Uint8Array, algorithm: String}>>}

+ + + + + + +
+

Decrypt encrypted session keys either with private keys or passwords.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
privateKeys + + +Array.<Key> + + + +

(optional) private keys with decrypted secret data

passwords + + +Array.<String> + + + +

(optional) passwords used to decrypt

config + + +Object + + + +

(optional) full configuration, defaults to openpgp.config

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

array of object with potential sessionKey, algorithm pairs

+
+ + + +
+
+ Type +
+
+ +Promise.<Array.<{data: Uint8Array, algorithm: String}>> + + +
+
+ + + + + + + + + + + + + +

(async) encrypt(keys, passwords, sessionKey, wildcard, encryptionKeyIds, date, userIds, streaming, config) → {Promise.<Message>}

+ + + + + + +
+

Encrypt the message either with public keys, passwords, or both at once.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDefaultDescription
keys + + +Array.<Key> + + + + + +

(optional) public key(s) for message encryption

passwords + + +Array.<String> + + + + + +

(optional) password(s) for message encryption

sessionKey + + +Object + + + + + +

(optional) session key in the form: { data:Uint8Array, algorithm:String, [aeadAlgorithm:String] }

wildcard + + +Boolean + + + + + + false + +

(optional) use a key ID of 0 instead of the public key IDs

encryptionKeyIds + + +Array.<module:type/keyid~Keyid> + + + + + +

(optional) array of key IDs to use for encryption. Each encryptionKeyIds[i] corresponds to publicKeys[i]

date + + +Date + + + + + +

(optional) override the creation date of the literal package

userIds + + +Array.<Object> + + + + + +

(optional) user IDs to encrypt for, e.g. [{ name:'Robert Receiver', email:'robert@openpgp.org' }]

streaming + + +Boolean + + + + + +

(optional) whether to process data as a stream

config + + +Object + + + + + +

(optional) full configuration, defaults to openpgp.config

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

new message with encrypted content

+
+ + + +
+
+ Type +
+
+ +Promise.<Message> + + +
+
+ + + + + + + + + + + + + +

getEncryptionKeyIds() → {Array.<module:type/keyid~Keyid>}

+ + + + + + +
+

Returns the key IDs of the keys to which the session key is encrypted

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

array of keyid objects

+
+ + + +
+
+ Type +
+
+ +Array.<module:type/keyid~Keyid> + + +
+
+ + + + + + + + + + + + + +

getFilename() → {String|null}

+ + + + + + +
+

Get filename from literal data packet

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

filename of literal data packet as string

+
+ + + +
+
+ Type +
+
+ +String +| + +null + + +
+
+ + + + + + + + + + + + + +

getLiteralData() → {Uint8Array|null}

+ + + + + + +
+

Get literal data that is the body of the message

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

literal body of the message as Uint8Array

+
+ + + +
+
+ Type +
+
+ +Uint8Array +| + +null + + +
+
+ + + + + + + + + + + + + +

getSigningKeyIds() → {Array.<module:type/keyid~Keyid>}

+ + + + + + +
+

Returns the key IDs of the keys that signed the message

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

array of keyid objects

+
+ + + +
+
+ Type +
+
+ +Array.<module:type/keyid~Keyid> + + +
+
+ + + + + + + + + + + + + +

getText() → {String|null}

+ + + + + + +
+

Get literal data as text

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

literal body of the message interpreted as text

+
+ + + +
+
+ Type +
+
+ +String +| + +null + + +
+
+ + + + + + + + + + + + + +

(async) sign(privateKeys, signature, signingKeyIds, date, userIds, streaming, config) → {Promise.<Message>}

+ + + + + + +
+

Sign the message (the literal data packet of the message)

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDefaultDescription
privateKeys + + +Array.<Key> + + + + + +

private keys with decrypted secret key data for signing

signature + + +Signature + + + + + + null + +

(optional) any existing detached signature to add to the message

signingKeyIds + + +Array.<module:type/keyid~Keyid> + + + + + +

(optional) array of key IDs to use for signing. Each signingKeyIds[i] corresponds to privateKeys[i]

date + + +Date + + + + + +

(optional) override the creation time of the signature

userIds + + +Array + + + + + +

(optional) user IDs to sign with, e.g. [{ name:'Steve Sender', email:'steve@openpgp.org' }]

streaming + + +Boolean + + + + + + false + +

(optional) whether to process data as a stream

config + + +Object + + + + + +

(optional) full configuration, defaults to openpgp.config

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

new message with signed content

+
+ + + +
+
+ Type +
+
+ +Promise.<Message> + + +
+
+ + + + + + + + + + + + + +

(async) signDetached(privateKeys, signature, signingKeyIds, date, userIds, streaming, config) → {Promise.<Signature>}

+ + + + + + +
+

Create a detached signature for the message (the literal data packet of the message)

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDefaultDescription
privateKeys + + +Array.<Key> + + + + + +

private keys with decrypted secret key data for signing

signature + + +Signature + + + + + + null + +

(optional) any existing detached signature

signingKeyIds + + +Array.<module:type/keyid~Keyid> + + + + + +

(optional) array of key IDs to use for signing. Each signingKeyIds[i] corresponds to privateKeys[i]

date + + +Date + + + + + +

(optional) override the creation time of the signature

userIds + + +Array + + + + + +

(optional) user IDs to sign with, e.g. [{ name:'Steve Sender', email:'steve@openpgp.org' }]

streaming + + +Boolean + + + + + + false + +

(optional) whether to process data as a stream

config + + +Object + + + + + +

(optional) full configuration, defaults to openpgp.config

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

new detached signature of message content

+
+ + + +
+
+ Type +
+
+ +Promise.<Signature> + + +
+
+ + + + + + + + + + + + + +

unwrapCompressed() → {Message}

+ + + + + + +
+

Unwrap compressed message

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

message Content of compressed message

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + + + + +

(async) verify(keys, date, streaming, config) → {Promise.<Array.<({keyid: module:type/keyid~Keyid, valid: Boolean})>>}

+ + + + + + +
+

Verify message signatures

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
keys + + +Array.<Key> + + + +

array of keys to verify signatures

date + + +Date + + + +

(optional) Verify the signature against the given date, i.e. check signature creation time < date < expiration time

streaming + + +Boolean + + + +

(optional) whether to process data as a stream

config + + +Object + + + +

(optional) full configuration, defaults to openpgp.config

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

list of signer's keyid and validity of signature

+
+ + + +
+
+ Type +
+
+ +Promise.<Array.<({keyid: module:type/keyid~Keyid, valid: Boolean})>> + + +
+
+ + + + + + + + + + + + + +

(async) verifyDetached(keys, signature, date, config) → {Promise.<Array.<({keyid: module:type/keyid~Keyid, valid: Boolean})>>}

+ + + + + + +
+

Verify detached message signature

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
keys + + +Array.<Key> + + + +

array of keys to verify signatures

signature + + +Signature + + + +
date + + +Date + + + +

Verify the signature against the given date, i.e. check signature creation time < date < expiration time

config + + +Object + + + +

(optional) full configuration, defaults to openpgp.config

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

list of signer's keyid and validity of signature

+
+ + + +
+
+ Type +
+
+ +Promise.<Array.<({keyid: module:type/keyid~Keyid, valid: Boolean})>> + + +
+
+ + + + + + + + + + + + + +

write() → {ReadableStream.<Uint8Array>}

+ + + + + + +
+

Returns binary encoded message

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

binary message

+
+ + + +
+
+ Type +
+
+ +ReadableStream.<Uint8Array> + + +
+
+ + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ + + + + + + \ No newline at end of file diff --git a/docs/OnePassSignaturePacket.html b/docs/OnePassSignaturePacket.html new file mode 100644 index 00000000..328e2245 --- /dev/null +++ b/docs/OnePassSignaturePacket.html @@ -0,0 +1,935 @@ + + + + + JSDoc: Class: OnePassSignaturePacket + + + + + + + + + + +
+ +

Class: OnePassSignaturePacket

+ + + + + + +
+ +
+ +

OnePassSignaturePacket()

+ +

Implementation of the One-Pass Signature Packets (Tag 4)

+

RFC4880 5.4: +The One-Pass Signature packet precedes the signed data and contains +enough information to allow the receiver to begin calculating any +hashes needed to verify the signature. It allows the Signature +packet to be placed at the end of the message, so that the signer +can compute the entire signed message in one pass.

+ + +
+ +
+
+ + + + +

Constructor

+ + + +

new OnePassSignaturePacket()

+ + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + +

Members

+ + + +

flags

+ + + + +
+

A one-octet number holding a flag showing whether the signature is nested. +A zero value indicates that the next packet is another One-Pass Signature packet +that describes another signature to be applied to the same message data.

+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

hashAlgorithm

+ + + + +
+

A one-octet number describing the hash algorithm used.

+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + +
See:
+
+ +
+ + + +
+ + + + + + + + +

issuerKeyId

+ + + + +
+

An eight-octet number holding the Key ID of the signing key.

+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

publicKeyAlgorithm

+ + + + +
+

A one-octet number describing the public-key algorithm used.

+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + +
See:
+
+ +
+ + + +
+ + + + + + + + +

signatureType

+ + + + +
+

A one-octet signature type. +Signature types are described in +RFC4880 Section 5.2.1.

+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

tag :module:enums.packet

+ + + + +
+

Packet type

+
+ + + +
Type:
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

version

+ + + + +
+

A one-octet version number. The current version is 3.

+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + +

Methods

+ + + + + + + +

read(bytes) → {OnePassSignaturePacket}

+ + + + + + +
+

parsing function for a one-pass signature packet (tag 4).

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
bytes + + +Uint8Array + + + +

payload of a tag 4 packet

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

object representation

+
+ + + +
+
+ Type +
+
+ +OnePassSignaturePacket + + +
+
+ + + + + + + + + + + + + +

write() → {Uint8Array}

+ + + + + + +
+

creates a string representation of a one-pass signature packet

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

a Uint8Array representation of a one-pass signature packet

+
+ + + +
+
+ Type +
+
+ +Uint8Array + + +
+
+ + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ + + + + + + \ No newline at end of file diff --git a/docs/PacketList.html b/docs/PacketList.html new file mode 100644 index 00000000..894adea5 --- /dev/null +++ b/docs/PacketList.html @@ -0,0 +1,1014 @@ + + + + + JSDoc: Class: PacketList + + + + + + + + + + +
+ +

Class: PacketList

+ + + + + + +
+ +
+ +

PacketList()

+ +

This class represents a list of openpgp packets. +Take care when iterating over it - the packets themselves +are stored as numerical indices.

+ + +
+ +
+
+ + + + +

Constructor

+ + + +

new PacketList()

+ + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + +
    +
  • Array
  • +
+ + + + + + + + + + + + + + + + + +

Methods

+ + + + + + + +

concat()

+ + + + + + +
+

Concatenates packetlist or array of packets

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

filterByTag()

+ + + + + + +
+

Creates a new PacketList with all packets from the given types

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

findPacket(type) → {Packet|undefined}

+ + + + + + +
+

Traverses packet tree and returns first matching packet

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
type + + +module:enums.packet + + + +

The packet type

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +Packet +| + +undefined + + +
+
+ + + + + + + + + + + + + +

indexOfTag()

+ + + + + + +
+

Returns array of found indices by tag

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

push(packet)

+ + + + + + +
+

Adds a packet to the list. This is the only supported method of doing so; +writing to packetlist[i] directly will result in an error.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
packet + + +Object + + + +

Packet to push

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

(async) read(bytes)

+ + + + + + +
+

Reads a stream of binary data and interprets it as a list of packets.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
bytes + + +Uint8Array +| + +ReadableStream.<Uint8Array> + + + +

A Uint8Array of bytes.

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

write() → {Uint8Array}

+ + + + + + +
+

Creates a binary representation of openpgp objects contained within the +class instance.

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

A Uint8Array containing valid openpgp packets.

+
+ + + +
+
+ Type +
+
+ +Uint8Array + + +
+
+ + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ + + + + + + \ No newline at end of file diff --git a/docs/PublicKeyEncryptedSessionKeyPacket.html b/docs/PublicKeyEncryptedSessionKeyPacket.html new file mode 100644 index 00000000..391a03d1 --- /dev/null +++ b/docs/PublicKeyEncryptedSessionKeyPacket.html @@ -0,0 +1,828 @@ + + + + + JSDoc: Class: PublicKeyEncryptedSessionKeyPacket + + + + + + + + + + +
+ +

Class: PublicKeyEncryptedSessionKeyPacket

+ + + + + + +
+ +
+ +

PublicKeyEncryptedSessionKeyPacket()

+ +

Public-Key Encrypted Session Key Packets (Tag 1)

+

RFC4880 5.1: +A Public-Key Encrypted Session Key packet holds the session key +used to encrypt a message. Zero or more Public-Key Encrypted Session Key +packets and/or Symmetric-Key Encrypted Session Key packets may precede a +Symmetrically Encrypted Data Packet, which holds an encrypted message. The +message is encrypted with the session key, and the session key is itself +encrypted and stored in the Encrypted Session Key packet(s). The +Symmetrically Encrypted Data Packet is preceded by one Public-Key Encrypted +Session Key packet for each OpenPGP key to which the message is encrypted. +The recipient of the message finds a session key that is encrypted to their +public key, decrypts the session key, and then uses the session key to +decrypt the message.

+ + +
+ +
+
+ + + + +

Constructor

+ + + +

new PublicKeyEncryptedSessionKeyPacket()

+ + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + +

Members

+ + + +

encrypted :Object

+ + + + + + +
Type:
+
    +
  • + +Object + + +
  • +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + +

Methods

+ + + + + + + +

(async) decrypt(key) → {Promise.<Boolean>}

+ + + + + + +
+

Decrypts the session key (only for public key encrypted session key +packets (tag 1)

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
key + + +SecretKeyPacket + + + +

Private key with secret params unlocked

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +Promise.<Boolean> + + +
+
+ + + + + + + + + + + + + +

(async) encrypt(key) → {Promise.<Boolean>}

+ + + + + + +
+

Encrypt session key packet

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
key + + +PublicKeyPacket + + + +

Public key

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +Promise.<Boolean> + + +
+
+ + + + + + + + + + + + + +

read(bytes)

+ + + + + + +
+

Parsing function for a publickey encrypted session key packet (tag 1).

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
bytes + + +Uint8Array + + + +

Payload of a tag 1 packet

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

write() → {Uint8Array}

+ + + + + + +
+

Create a binary representation of a tag 1 packet

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

The Uint8Array representation

+
+ + + +
+
+ Type +
+
+ +Uint8Array + + +
+
+ + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ + + + + + + \ No newline at end of file diff --git a/docs/PublicKeyPacket.html b/docs/PublicKeyPacket.html new file mode 100644 index 00000000..5fa63108 --- /dev/null +++ b/docs/PublicKeyPacket.html @@ -0,0 +1,2135 @@ + + + + + JSDoc: Class: PublicKeyPacket + + + + + + + + + + +
+ +

Class: PublicKeyPacket

+ + + + + + +
+ +
+ +

PublicKeyPacket(date, config)

+ +

Implementation of the Key Material Packet (Tag 5,6,7,14)

+

RFC4480 5.5: +A key material packet contains all the information about a public or +private key. There are four variants of this packet type, and two +major versions.

+

A Public-Key packet starts a series of packets that forms an OpenPGP +key (sometimes called an OpenPGP certificate).

+ + +
+ +
+
+ + + + +

Constructor

+ + + +

new PublicKeyPacket(date, config)

+ + + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
date + + +Date + + + +

(optional) creation date

config + + +Object + + + +

(optional) full configuration, defaults to openpgp.config

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + +

Members

+ + + +

algorithm :String

+ + + + +
+

Public key algorithm.

+
+ + + +
Type:
+
    +
  • + +String + + +
  • +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

created :Date

+ + + + +
+

Key creation date.

+
+ + + +
Type:
+
    +
  • + +Date + + +
  • +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

expirationTimeV3 :Integer

+ + + + +
+

Time until expiration in days (V3 only)

+
+ + + +
Type:
+
    +
  • + +Integer + + +
  • +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

fingerprint :String

+ + + + +
+

Fingerprint in lowercase hex

+
+ + + +
Type:
+
    +
  • + +String + + +
  • +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

keyid :module:type/keyid~Keyid

+ + + + +
+

Keyid

+
+ + + +
Type:
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

publicParams :Object

+ + + + +
+

Algorithm specific public params

+
+ + + +
Type:
+
    +
  • + +Object + + +
  • +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

readPublicKey

+ + + + +
+

Alias of read()

+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + +
See:
+
+ +
+ + + +
+ + + + + + + + +

tag :module:enums.packet

+ + + + +
+

Packet type

+
+ + + +
Type:
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

version :Integer

+ + + + +
+

Packet version

+
+ + + +
Type:
+
    +
  • + +Integer + + +
  • +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

writePublicKey

+ + + + +
+

Alias of write()

+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + +
See:
+
+ +
+ + + +
+ + + + + + + + + + +

Methods

+ + + + + + + +

getAlgorithmInfo() → {Object}

+ + + + + + +
+

Returns algorithm information

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

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

+
+ + + +
+
+ Type +
+
+ +Object + + +
+
+ + + + + + + + + + + + + +

getCreationTime() → {Date}

+ + + + + + +
+

Returns the creation time of the key

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +Date + + +
+
+ + + + + + + + + + + + + +

getFingerprint() → {String}

+ + + + + + +
+

Calculates the fingerprint of the key

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

A string containing the fingerprint in lowercase hex

+
+ + + +
+
+ Type +
+
+ +String + + +
+
+ + + + + + + + + + + + + +

getFingerprintBytes() → {Uint8Array}

+ + + + + + +
+

Calculates the fingerprint of the key

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

A Uint8Array containing the fingerprint

+
+ + + +
+
+ Type +
+
+ +Uint8Array + + +
+
+ + + + + + + + + + + + + +

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

+ + + + + + +
+

Calculates the key id of the key

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
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

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
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.

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
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:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
bytes + + +Uint8Array + + + +

Input array to read the packet from

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

This object with attributes set by the parser

+
+ + + +
+
+ Type +
+
+ +Object + + +
+
+ + + + + + + + + + + + + +

write() → {Uint8Array}

+ + + + + + +
+

Creates an OpenPGP public key packet for the given key.

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
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.

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ + + + + + + \ No newline at end of file diff --git a/docs/PublicSubkeyPacket.html b/docs/PublicSubkeyPacket.html new file mode 100644 index 00000000..699e6991 --- /dev/null +++ b/docs/PublicSubkeyPacket.html @@ -0,0 +1,2244 @@ + + + + + JSDoc: Class: PublicSubkeyPacket + + + + + + + + + + +
+ +

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:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
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:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
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:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ + + + + + + \ No newline at end of file diff --git a/docs/SecretKeyPacket.html b/docs/SecretKeyPacket.html new file mode 100644 index 00000000..ce031db9 --- /dev/null +++ b/docs/SecretKeyPacket.html @@ -0,0 +1,3540 @@ + + + + + JSDoc: Class: SecretKeyPacket + + + + + + + + + + +
+ +

Class: SecretKeyPacket

+ + + + + + +
+ +
+ +

SecretKeyPacket(date, config)

+ +

A Secret-Key packet contains all the information that is found in a +Public-Key packet, including the public-key material, but also +includes the secret-key material after all the public-key fields.

+ + +
+ +
+
+ + + + +

Constructor

+ + + +

new SecretKeyPacket(date, config)

+ + + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
date + + +Date + + + +

(optional) creation date

config + + +Object + + + +

(optional) full configuration, defaults to openpgp.config

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + + + +

Members

+ + + +

aead :String

+ + + + +
+

AEAD algorithm

+
+ + + +
Type:
+
    +
  • + +String + + +
  • +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

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:
+
+ + + + + + + +
+ + + + + + + + +

isEncrypted

+ + + + +
+

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

+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

keyid :module:type/keyid~Keyid

+ + + + +
+

Keyid

+
+ + + +
Type:
+ + + + + + +
+ + + + + + + + +
Overrides:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

keyMaterial

+ + + + +
+

Secret-key data

+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

privateParams :Object

+ + + + +
+

Decrypted private parameters, referenced by name

+
+ + + +
Type:
+
    +
  • + +Object + + +
  • +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

publicParams :Object

+ + + + +
+

Algorithm specific public params

+
+ + + +
Type:
+
    +
  • + +Object + + +
  • +
+ + + + + +
+ + + + + + + + +
Overrides:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

readPublicKey

+ + + + +
+

Alias of read()

+
+ + + + + + + +
+ + + + + + + + +
Overrides:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + +
See:
+
+ +
+ + + +
+ + + + + + + + +

s2k :type/s2k

+ + + + +
+

S2K object

+
+ + + +
Type:
+
    +
  • + +type/s2k + + +
  • +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

s2k_usage :Integer

+ + + + +
+

S2K usage

+
+ + + +
Type:
+
    +
  • + +Integer + + +
  • +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

symmetric :String

+ + + + +
+

Symmetric algorithm

+
+ + + +
Type:
+
    +
  • + +String + + +
  • +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

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

+ + + + + + + +

clearPrivateParams()

+ + + + + + +
+

Clear private key parameters

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

(async) decrypt(passphrase)

+ + + + + + +
+

Decrypts the private key params which are needed to use the key. +SecretKeyPacket.isDecrypted should be false, as +otherwise calls to this function will throw an error.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
passphrase + + +String + + + +

The passphrase for this private key as string

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Throws:
+ + + +
+
+
+

if decryption was not successful

+
+
+
+
+
+
+ Type +
+
+ +Error + + +
+
+
+
+
+ + + + + + + + + + + + + + + + +

(async) encrypt(passphrase, config)

+ + + + + + +
+

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:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
passphrase + + +String + + + +
config + + +Object + + + +

(optional) full configuration, defaults to openpgp.config

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Throws:
+ + + +
+
+
+

if encryption was not successful

+
+
+
+
+
+
+ Type +
+
+ +Error + + +
+
+
+
+
+ + + + + + + + + + + + + + + + +

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 false for gnu-dummy keys and null for public keys.

+
+ + + + + + + + + + + + + +
+ + + + + + + + +
Overrides:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +Boolean +| + +null + + +
+
+ + + + + + + + + + + + + +

isDummy() → {Boolean}

+ + + + + + +
+

Check whether this is a gnu-dummy key

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +Boolean + + +
+
+ + + + + + + + + + + + + +

makeDummy(config)

+ + + + + + +
+

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:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
config + + +Object + + + +

(optional) full configuration, defaults to openpgp.config

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

read(bytes)

+ + + + + + +
+

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

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
bytes + + +String + + + +

Input string to read the packet from

+ + + + + + +
+ + + + + + + + +
Overrides:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

(async) validate()

+ + + + + + +
+

Checks that the key parameters are consistent

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Throws:
+ + + +
+
+
+

if validation was not successful

+
+
+
+
+
+
+ Type +
+
+ +Error + + +
+
+
+
+
+ + + + + + + + + + + + + + + + +

write() → {Uint8Array}

+ + + + + + +
+

Creates an OpenPGP key packet for the given key.

+
+ + + + + + + + + + + + + +
+ + + + + + + + +
Overrides:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

A string of bytes containing the secret key OpenPGP packet

+
+ + + +
+
+ Type +
+
+ +Uint8Array + + +
+
+ + + + + + + + + + + + + +

writeForHash()

+ + + + + + +
+

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

+
+ + + + + + + + + + + + + +
+ + + + + + + + +
Overrides:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ + + + + + + \ No newline at end of file diff --git a/docs/SecretSubkeyPacket.html b/docs/SecretSubkeyPacket.html new file mode 100644 index 00000000..e537fbf9 --- /dev/null +++ b/docs/SecretSubkeyPacket.html @@ -0,0 +1,3604 @@ + + + + + JSDoc: Class: SecretSubkeyPacket + + + + + + + + + + +
+ +

Class: SecretSubkeyPacket

+ + + + + + +
+ +
+ +

SecretSubkeyPacket(date, config)

+ +

A Secret-Subkey packet (tag 7) is the subkey analog of the Secret +Key packet and has exactly the same format.

+ + +
+ +
+
+ + + + +

Constructor

+ + + +

new SecretSubkeyPacket(date, config)

+ + + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
date + + +Date + + + +

(optional) creation date

config + + +Object + + + +

(optional) full configuration, defaults to openpgp.config

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + + + +

Members

+ + + +

aead :String

+ + + + +
+

AEAD algorithm

+
+ + + +
Type:
+
    +
  • + +String + + +
  • +
+ + + + + +
+ + + + + + + + +
Overrides:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

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:
+
+ + + + + + + +
+ + + + + + + + +

isEncrypted

+ + + + +
+

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

+
+ + + + + + + +
+ + + + + + + + +
Overrides:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

keyid :module:type/keyid~Keyid

+ + + + +
+

Keyid

+
+ + + +
Type:
+ + + + + + +
+ + + + + + + + +
Overrides:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

keyMaterial

+ + + + +
+

Secret-key data

+
+ + + + + + + +
+ + + + + + + + +
Overrides:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

privateParams :Object

+ + + + +
+

Decrypted private parameters, referenced by name

+
+ + + +
Type:
+
    +
  • + +Object + + +
  • +
+ + + + + +
+ + + + + + + + +
Overrides:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

publicParams :Object

+ + + + +
+

Algorithm specific public params

+
+ + + +
Type:
+
    +
  • + +Object + + +
  • +
+ + + + + +
+ + + + + + + + +
Overrides:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

readPublicKey

+ + + + +
+

Alias of read()

+
+ + + + + + + +
+ + + + + + + + +
Overrides:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + +
See:
+
+ +
+ + + +
+ + + + + + + + +

s2k :type/s2k

+ + + + +
+

S2K object

+
+ + + +
Type:
+
    +
  • + +type/s2k + + +
  • +
+ + + + + +
+ + + + + + + + +
Overrides:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

s2k_usage :Integer

+ + + + +
+

S2K usage

+
+ + + +
Type:
+
    +
  • + +Integer + + +
  • +
+ + + + + +
+ + + + + + + + +
Overrides:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

symmetric :String

+ + + + +
+

Symmetric algorithm

+
+ + + +
Type:
+
    +
  • + +String + + +
  • +
+ + + + + +
+ + + + + + + + +
Overrides:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

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

+ + + + + + + +

clearPrivateParams()

+ + + + + + +
+

Clear private key parameters

+
+ + + + + + + + + + + + + +
+ + + + + + + + +
Overrides:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

(async) decrypt(passphrase)

+ + + + + + +
+

Decrypts the private key params which are needed to use the key. +SecretKeyPacket.isDecrypted should be false, as +otherwise calls to this function will throw an error.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
passphrase + + +String + + + +

The passphrase for this private key as string

+ + + + + + +
+ + + + + + + + +
Overrides:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Throws:
+ + + +
+
+
+

if decryption was not successful

+
+
+
+
+
+
+ Type +
+
+ +Error + + +
+
+
+
+
+ + + + + + + + + + + + + + + + +

(async) encrypt(passphrase, config)

+ + + + + + +
+

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:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
passphrase + + +String + + + +
config + + +Object + + + +

(optional) full configuration, defaults to openpgp.config

+ + + + + + +
+ + + + + + + + +
Overrides:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Throws:
+ + + +
+
+
+

if encryption was not successful

+
+
+
+
+
+
+ Type +
+
+ +Error + + +
+
+
+
+
+ + + + + + + + + + + + + + + + +

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 false for gnu-dummy keys and null for public keys.

+
+ + + + + + + + + + + + + +
+ + + + + + + + +
Overrides:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +Boolean +| + +null + + +
+
+ + + + + + + + + + + + + +

isDummy() → {Boolean}

+ + + + + + +
+

Check whether this is a gnu-dummy key

+
+ + + + + + + + + + + + + +
+ + + + + + + + +
Overrides:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +Boolean + + +
+
+ + + + + + + + + + + + + +

makeDummy(config)

+ + + + + + +
+

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:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
config + + +Object + + + +

(optional) full configuration, defaults to openpgp.config

+ + + + + + +
+ + + + + + + + +
Overrides:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

read(bytes)

+ + + + + + +
+

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

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
bytes + + +String + + + +

Input string to read the packet from

+ + + + + + +
+ + + + + + + + +
Overrides:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

(async) validate()

+ + + + + + +
+

Checks that the key parameters are consistent

+
+ + + + + + + + + + + + + +
+ + + + + + + + +
Overrides:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Throws:
+ + + +
+
+
+

if validation was not successful

+
+
+
+
+
+
+ Type +
+
+ +Error + + +
+
+
+
+
+ + + + + + + + + + + + + + + + +

write() → {Uint8Array}

+ + + + + + +
+

Creates an OpenPGP key packet for the given key.

+
+ + + + + + + + + + + + + +
+ + + + + + + + +
Overrides:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

A string of bytes containing the secret key OpenPGP packet

+
+ + + +
+
+ Type +
+
+ +Uint8Array + + +
+
+ + + + + + + + + + + + + +

writeForHash()

+ + + + + + +
+

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

+
+ + + + + + + + + + + + + +
+ + + + + + + + +
Overrides:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ + + + + + + \ No newline at end of file diff --git a/docs/Signature.html b/docs/Signature.html new file mode 100644 index 00000000..156659cf --- /dev/null +++ b/docs/Signature.html @@ -0,0 +1,505 @@ + + + + + JSDoc: Class: Signature + + + + + + + + + + +
+ +

Class: Signature

+ + + + + + +
+ +
+ +

Signature(packetlist)

+ +

Class that represents an OpenPGP signature.

+ + +
+ +
+
+ + + + +

Constructor

+ + + +

new Signature(packetlist)

+ + + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
packetlist + + +PacketList + + + +

The signature packets

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + +

Classes

+ +
+
Signature
+
+
+ + + + + + + + + + + +

Methods

+ + + + + + + +

armor(config) → {ReadableStream.<String>}

+ + + + + + +
+

Returns ASCII armored text of signature

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
config + + +Object + + + +

(optional) full configuration, defaults to openpgp.config

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

ASCII armor

+
+ + + +
+
+ Type +
+
+ +ReadableStream.<String> + + +
+
+ + + + + + + + + + + + + +

write() → {ReadableStream.<Uint8Array>}

+ + + + + + +
+

Returns binary encoded signature

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

binary signature

+
+ + + +
+
+ Type +
+
+ +ReadableStream.<Uint8Array> + + +
+
+ + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ + + + + + + \ No newline at end of file diff --git a/docs/SignaturePacket.html b/docs/SignaturePacket.html new file mode 100644 index 00000000..759da8ae --- /dev/null +++ b/docs/SignaturePacket.html @@ -0,0 +1,1601 @@ + + + + + JSDoc: Class: SignaturePacket + + + + + + + + + + +
+ +

Class: SignaturePacket

+ + + + + + +
+ +
+ +

SignaturePacket(date)

+ +

Implementation of the Signature Packet (Tag 2)

+

RFC4480 5.2: +A Signature packet describes a binding between some public key and +some data. The most common signatures are a signature of a file or a +block of text, and a signature that is a certification of a User ID.

+ + +
+ +
+
+ + + + +

Constructor

+ + + +

new SignaturePacket(date)

+ + + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
date + + +Date + + + +

the creation date of the signature

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + +

Methods

+ + + + + + + +

getExpirationTime() → {Date}

+ + + + + + +
+

Returns the expiration time of the signature or Infinity if signature does not expire

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

expiration time

+
+ + + +
+
+ Type +
+
+ +Date + + +
+
+ + + + + + + + + + + + + +

isExpired(date) → {Boolean}

+ + + + + + +
+

Verifies signature expiration date

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
date + + +Date + + + +

(optional) use the given date for verification instead of the current time

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

true if expired

+
+ + + +
+
+ Type +
+
+ +Boolean + + +
+
+ + + + + + + + + + + + + +

read(bytes, config) → {SignaturePacket}

+ + + + + + +
+

parsing function for a signature packet (tag 2).

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
bytes + + +String + + + +

payload of a tag 2 packet

config + + +Object + + + +

(optional) full configuration, defaults to openpgp.config

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

object representation

+
+ + + +
+
+ Type +
+
+ +SignaturePacket + + +
+
+ + + + + + + + + + + + + +

(async) sign(key, data, detached, streaming)

+ + + + + + +
+

Signs provided data. This needs to be done prior to serialization.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDefaultDescription
key + + +SecretKeyPacket + + + + + +

private key used to sign the message.

data + + +Object + + + + + +

Contains packets to be signed.

detached + + +Boolean + + + + + + false + +

(optional) whether to create a detached signature

streaming + + +Boolean + + + + + + false + +

(optional) whether to process data as a stream

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Throws:
+ + + +
+
+
+

if signing failed

+
+
+
+
+
+
+ Type +
+
+ +Error + + +
+
+
+
+
+ + + + + + + + + + + + + + + + +

(async) verify(key, signatureType, data, detached, streaming, config)

+ + + + + + +
+

verifies the signature packet. Note: not all signature types are implemented

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDefaultDescription
key + + +PublicSubkeyPacket +| + +PublicKeyPacket +| + +SecretSubkeyPacket +| + +SecretKeyPacket + + + + + +

the public key to verify the signature

signatureType + + +module:enums.signature + + + + + +

expected signature type

data + + +String +| + +Object + + + + + +

data which on the signature applies

detached + + +Boolean + + + + + + false + +

(optional) whether to verify a detached signature

streaming + + +Boolean + + + + + + false + +

(optional) whether to process data as a stream

config + + +Object + + + + + +

(optional) full configuration, defaults to openpgp.config

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Throws:
+ + + +
+
+
+

if signature validation failed

+
+
+
+
+
+
+ Type +
+
+ +Error + + +
+
+
+
+
+ + + + + + + + + + + + + + + + +

write_hashed_sub_packets() → {Uint8Array}

+ + + + + + +
+

Creates Uint8Array of bytes of all subpacket data except Issuer and Embedded Signature subpackets

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

subpacket data

+
+ + + +
+
+ Type +
+
+ +Uint8Array + + +
+
+ + + + + + + + + + + + + +

write_params() → {Uint8Array|ReadableStream.<Uint8Array>}

+ + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +Uint8Array +| + +ReadableStream.<Uint8Array> + + +
+
+ + + + + + + + + + + + + +

write_unhashed_sub_packets() → {Uint8Array}

+ + + + + + +
+

Creates Uint8Array of bytes of Issuer and Embedded Signature subpackets

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

subpacket data

+
+ + + +
+
+ Type +
+
+ +Uint8Array + + +
+
+ + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ + + + + + + \ No newline at end of file diff --git a/docs/SymEncryptedIntegrityProtectedDataPacket.html b/docs/SymEncryptedIntegrityProtectedDataPacket.html new file mode 100644 index 00000000..048a9ee1 --- /dev/null +++ b/docs/SymEncryptedIntegrityProtectedDataPacket.html @@ -0,0 +1,778 @@ + + + + + JSDoc: Class: SymEncryptedIntegrityProtectedDataPacket + + + + + + + + + + +
+ +

Class: SymEncryptedIntegrityProtectedDataPacket

+ + + + + + +
+ +
+ +

SymEncryptedIntegrityProtectedDataPacket()

+ +

Implementation of the Sym. Encrypted Integrity Protected Data Packet (Tag 18)

+

RFC4880 5.13: +The Symmetrically Encrypted Integrity Protected Data packet is +a variant of the Symmetrically Encrypted Data packet. It is a new feature +created for OpenPGP that addresses the problem of detecting a modification to +encrypted data. It is used in combination with a Modification Detection Code +packet.

+ + +
+ +
+
+ + + + +

Constructor

+ + + +

new SymEncryptedIntegrityProtectedDataPacket()

+ + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + +

Members

+ + + +

encrypted

+ + + + +
+

The encrypted payload.

+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

modification :Boolean

+ + + + +
+

If after decrypting the packet this is set to true, +a modification has been detected and thus the contents +should be discarded.

+
+ + + +
Type:
+
    +
  • + +Boolean + + +
  • +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + +

Methods

+ + + + + + + +

(async) decrypt(sessionKeyAlgorithm, key, streaming, config) → {Promise.<Boolean>}

+ + + + + + +
+

Decrypts the encrypted data contained in the packet.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
sessionKeyAlgorithm + + +String + + + +

The selected symmetric encryption algorithm to be used e.g. 'aes128'

key + + +Uint8Array + + + +

The key of cipher blocksize length to be used

streaming + + +Boolean + + + +

Whether to read this.encrypted as a stream

config + + +Object + + + +

(optional) full configuration, defaults to openpgp.config

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +Promise.<Boolean> + + +
+
+ + + + + + + + + + + + + +

(async) encrypt(sessionKeyAlgorithm, key, streaming, config) → {Promise.<Boolean>}

+ + + + + + +
+

Encrypt the payload in the packet.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
sessionKeyAlgorithm + + +String + + + +

The selected symmetric encryption algorithm to be used e.g. 'aes128'

key + + +Uint8Array + + + +

The key of cipher blocksize length to be used

streaming + + +Boolean + + + +

Whether to set this.encrypted to a stream

config + + +Object + + + +

(optional) full configuration, defaults to openpgp.config

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +Promise.<Boolean> + + +
+
+ + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ + + + + + + \ No newline at end of file diff --git a/docs/SymEncryptedSessionKeyPacket.html b/docs/SymEncryptedSessionKeyPacket.html new file mode 100644 index 00000000..75a62c59 --- /dev/null +++ b/docs/SymEncryptedSessionKeyPacket.html @@ -0,0 +1,844 @@ + + + + + JSDoc: Class: SymEncryptedSessionKeyPacket + + + + + + + + + + +
+ +

Class: SymEncryptedSessionKeyPacket

+ + + + + + +
+ +
+ +

SymEncryptedSessionKeyPacket(config)

+ +

Symmetric-Key Encrypted Session Key Packets (Tag 3)

+

RFC4880 5.3: +The Symmetric-Key Encrypted Session Key packet holds the +symmetric-key encryption of a session key used to encrypt a message. +Zero or more Public-Key Encrypted Session Key packets and/or +Symmetric-Key Encrypted Session Key packets may precede a +Symmetrically Encrypted Data packet that holds an encrypted message. +The message is encrypted with a session key, and the session key is +itself encrypted and stored in the Encrypted Session Key packet or +the Symmetric-Key Encrypted Session Key packet.

+ + +
+ +
+
+ + + + +

Constructor

+ + + +

new SymEncryptedSessionKeyPacket(config)

+ + + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
config + + +Object + + + +

(optional) full configuration, defaults to openpgp.config

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + +

Methods

+ + + + + + + +

(async) decrypt(passphrase)

+ + + + + + +
+

Decrypts the session key

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
passphrase + + +String + + + +

The passphrase in string form

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Throws:
+ + + +
+
+
+

if decryption was not successful

+
+
+
+
+
+
+ Type +
+
+ +Error + + +
+
+
+
+
+ + + + + + + + + + + + + + + + +

(async) encrypt(passphrase, config)

+ + + + + + +
+

Encrypts the session key

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
passphrase + + +String + + + +

The passphrase in string form

config + + +Object + + + +

(optional) full configuration, defaults to openpgp.config

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Throws:
+ + + +
+
+
+

if encryption was not successful

+
+
+
+
+
+
+ Type +
+
+ +Error + + +
+
+
+
+
+ + + + + + + + + + + + + + + + +

read(bytes)

+ + + + + + +
+

Parsing function for a symmetric encrypted session key packet (tag 3).

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
bytes + + +Uint8Array + + + +

Payload of a tag 3 packet

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

write() → {Uint8Array}

+ + + + + + +
+

Create a binary representation of a tag 3 packet

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

The Uint8Array representation

+
+ + + +
+
+ Type +
+
+ +Uint8Array + + +
+
+ + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ + + + + + + \ No newline at end of file diff --git a/docs/SymmetricallyEncryptedDataPacket.html b/docs/SymmetricallyEncryptedDataPacket.html new file mode 100644 index 00000000..699cedf5 --- /dev/null +++ b/docs/SymmetricallyEncryptedDataPacket.html @@ -0,0 +1,828 @@ + + + + + JSDoc: Class: SymmetricallyEncryptedDataPacket + + + + + + + + + + +
+ +

Class: SymmetricallyEncryptedDataPacket

+ + + + + + +
+ +
+ +

SymmetricallyEncryptedDataPacket()

+ +

Implementation of the Symmetrically Encrypted Data Packet (Tag 9)

+

RFC4880 5.7: +The Symmetrically Encrypted Data packet contains data encrypted with a +symmetric-key algorithm. When it has been decrypted, it contains other +packets (usually a literal data packet or compressed data packet, but in +theory other Symmetrically Encrypted Data packets or sequences of packets +that form whole OpenPGP messages).

+ + +
+ +
+
+ + + + +

Constructor

+ + + +

new SymmetricallyEncryptedDataPacket()

+ + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + +

Members

+ + + +

encrypted

+ + + + +
+

Encrypted secret-key data

+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

packets :PacketList

+ + + + +
+

Decrypted packets contained within.

+
+ + + +
Type:
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

tag :module:enums.packet

+ + + + +
+

Packet type

+
+ + + +
Type:
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + +

Methods

+ + + + + + + +

(async) decrypt(sessionKeyAlgorithm, key, config)

+ + + + + + +
+

Decrypt the symmetrically-encrypted packet data +See RFC 4880 9.2 for algorithms.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
sessionKeyAlgorithm + + +module:enums.symmetric + + + +

Symmetric key algorithm to use

key + + +Uint8Array + + + +

The key of cipher blocksize length to be used

config + + +Object + + + +

(optional) full configuration, defaults to openpgp.config

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Throws:
+ + + +
+
+
+

if decryption was not successful

+
+
+
+
+
+
+ Type +
+
+ +Error + + +
+
+
+
+
+ + + + + + + + + + + + + + + + +

(async) encrypt(sessionKeyAlgorithm, key, config)

+ + + + + + +
+

Encrypt the symmetrically-encrypted packet data +See RFC 4880 9.2 for algorithms.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
sessionKeyAlgorithm + + +module:enums.symmetric + + + +

Symmetric key algorithm to use

key + + +Uint8Array + + + +

The key of cipher blocksize length to be used

config + + +Object + + + +

(optional) full configuration, defaults to openpgp.config

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Throws:
+ + + +
+
+
+

if encryption was not successful

+
+
+
+
+
+
+ Type +
+
+ +Error + + +
+
+
+
+
+ + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ + + + + + + \ No newline at end of file diff --git a/docs/TrustPacket.html b/docs/TrustPacket.html new file mode 100644 index 00000000..8ccf323d --- /dev/null +++ b/docs/TrustPacket.html @@ -0,0 +1,326 @@ + + + + + JSDoc: Class: TrustPacket + + + + + + + + + + +
+ +

Class: TrustPacket

+ + + + + + +
+ +
+ +

TrustPacket()

+ +

Implementation of the Trust Packet (Tag 12)

+

RFC4880 5.10: +The Trust packet is used only within keyrings and is not normally +exported. Trust packets contain data that record the user's +specifications of which key holders are trustworthy introducers, +along with other information that implementing software uses for +trust information. The format of Trust packets is defined by a given +implementation.

+

Trust packets SHOULD NOT be emitted to output streams that are +transferred to other users, and they SHOULD be ignored on any input +other than local keyring files.

+ + +
+ +
+
+ + + + +

Constructor

+ + + +

new TrustPacket()

+ + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + +

Methods

+ + + + + + + +

read(byptes)

+ + + + + + +
+

Parsing function for a trust packet (tag 12). +Currently not implemented as we ignore trust packets

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
byptes + + +String + + + +

payload of a tag 12 packet

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ + + + + + + \ No newline at end of file diff --git a/docs/UserAttributePacket.html b/docs/UserAttributePacket.html new file mode 100644 index 00000000..9d7c76e2 --- /dev/null +++ b/docs/UserAttributePacket.html @@ -0,0 +1,600 @@ + + + + + JSDoc: Class: UserAttributePacket + + + + + + + + + + +
+ +

Class: UserAttributePacket

+ + + + + + +
+ +
+ +

UserAttributePacket()

+ +

Implementation of the User Attribute Packet (Tag 17)

+

The User Attribute packet is a variation of the User ID packet. It +is capable of storing more types of data than the User ID packet, +which is limited to text. Like the User ID packet, a User Attribute +packet may be certified by the key owner ("self-signed") or any other +key owner who cares to certify it. Except as noted, a User Attribute +packet may be used anywhere that a User ID packet may be used.

+

While User Attribute packets are not a required part of the OpenPGP +standard, implementations SHOULD provide at least enough +compatibility to properly handle a certification signature on the +User Attribute packet. A simple way to do this is by treating the +User Attribute packet as a User ID packet with opaque contents, but +an implementation may use any method desired.

+ + +
+ +
+
+ + + + +

Constructor

+ + + +

new UserAttributePacket()

+ + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + +

Methods

+ + + + + + + +

equals(usrAttr) → {Boolean}

+ + + + + + +
+

Compare for equality

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
usrAttr + + +UserAttributePacket + + + +
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

true if equal

+
+ + + +
+
+ Type +
+
+ +Boolean + + +
+
+ + + + + + + + + + + + + +

read(input)

+ + + + + + +
+

parsing function for a user attribute packet (tag 17).

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
input + + +Uint8Array + + + +

payload of a tag 17 packet

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

write() → {Uint8Array}

+ + + + + + +
+

Creates a binary representation of the user attribute packet

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

string representation

+
+ + + +
+
+ Type +
+
+ +Uint8Array + + +
+
+ + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ + + + + + + \ No newline at end of file diff --git a/docs/UserIDPacket.html b/docs/UserIDPacket.html new file mode 100644 index 00000000..ee68a052 --- /dev/null +++ b/docs/UserIDPacket.html @@ -0,0 +1,668 @@ + + + + + JSDoc: Class: UserIDPacket + + + + + + + + + + +
+ +

Class: UserIDPacket

+ + + + + + +
+ +
+ +

UserIDPacket()

+ +

Implementation of the User ID Packet (Tag 13)

+

A User ID packet consists of UTF-8 text that is intended to represent +the name and email address of the key holder. By convention, it +includes an RFC 2822 [RFC2822] mail name-addr, but there are no +restrictions on its content. The packet length in the header +specifies the length of the User ID.

+ + +
+ +
+
+ + + + +

Constructor

+ + + +

new UserIDPacket()

+ + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + +

Members

+ + + +

userid :String

+ + + + +
+

A string containing the user id. Usually in the form +John Doe john@example.com

+
+ + + +
Type:
+
    +
  • + +String + + +
  • +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + +

Methods

+ + + + + + + +

(static) fromObject(userId) → {UserIDPacket}

+ + + + + + +
+

Create UserIDPacket instance from object

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
userId + + +Object + + + +

object specifying userId name, email and comment

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +UserIDPacket + + +
+
+ + + + + + + + + + + + + +

read(input)

+ + + + + + +
+

Parsing function for a user id packet (tag 13).

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
input + + +Uint8Array + + + +

payload of a tag 13 packet

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

write() → {Uint8Array}

+ + + + + + +
+

Creates a binary representation of the user id packet

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

binary representation

+
+ + + +
+
+ Type +
+
+ +Uint8Array + + +
+
+ + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ + + + + + + \ No newline at end of file diff --git a/docs/WKD.html b/docs/WKD.html new file mode 100644 index 00000000..f8f1b30d --- /dev/null +++ b/docs/WKD.html @@ -0,0 +1,372 @@ + + + + + JSDoc: Class: WKD + + + + + + + + + + +
+ +

Class: WKD

+ + + + + + +
+ +
+ +

WKD()

+ +

This class implements a client for the Web Key Directory (WKD) protocol +in order to lookup keys on designated servers.

+ + +
+ +
+
+ + + + +

Constructor

+ + + +

new WKD()

+ + + + + + +
+

Initialize the WKD client

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + +
See:
+
+ +
+ + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + +

Methods

+ + + + + + + +

(async) lookup() → {Promise.<(Uint8Array|{keys: Array.<Key>, err: (Array.<Error>|null)})>}

+ + + + + + +
+

Search for a public key using Web Key Directory protocol.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
options.email + + +String + + + +

User's email.

options.rawBytes + + +Boolean + + + +

Returns Uint8Array instead of parsed key.

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

The public key.

+
+ + + +
+
+ Type +
+
+ +Promise.<(Uint8Array|{keys: Array.<Key>, err: (Array.<Error>|null)})> + + +
+
+ + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ + + + + + + \ No newline at end of file diff --git a/docs/fonts/OpenSans-Bold-webfont.eot b/docs/fonts/OpenSans-Bold-webfont.eot new file mode 100644 index 00000000..5d20d916 Binary files /dev/null and b/docs/fonts/OpenSans-Bold-webfont.eot differ diff --git a/docs/fonts/OpenSans-Bold-webfont.svg b/docs/fonts/OpenSans-Bold-webfont.svg new file mode 100644 index 00000000..3ed7be4b --- /dev/null +++ b/docs/fonts/OpenSans-Bold-webfont.svg @@ -0,0 +1,1830 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/fonts/OpenSans-Bold-webfont.woff b/docs/fonts/OpenSans-Bold-webfont.woff new file mode 100644 index 00000000..1205787b Binary files /dev/null and b/docs/fonts/OpenSans-Bold-webfont.woff differ diff --git a/docs/fonts/OpenSans-BoldItalic-webfont.eot b/docs/fonts/OpenSans-BoldItalic-webfont.eot new file mode 100644 index 00000000..1f639a15 Binary files /dev/null and b/docs/fonts/OpenSans-BoldItalic-webfont.eot differ diff --git a/docs/fonts/OpenSans-BoldItalic-webfont.svg b/docs/fonts/OpenSans-BoldItalic-webfont.svg new file mode 100644 index 00000000..6a2607b9 --- /dev/null +++ b/docs/fonts/OpenSans-BoldItalic-webfont.svg @@ -0,0 +1,1830 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/fonts/OpenSans-BoldItalic-webfont.woff b/docs/fonts/OpenSans-BoldItalic-webfont.woff new file mode 100644 index 00000000..ed760c06 Binary files /dev/null and b/docs/fonts/OpenSans-BoldItalic-webfont.woff differ diff --git a/docs/fonts/OpenSans-Italic-webfont.eot b/docs/fonts/OpenSans-Italic-webfont.eot new file mode 100644 index 00000000..0c8a0ae0 Binary files /dev/null and b/docs/fonts/OpenSans-Italic-webfont.eot differ diff --git a/docs/fonts/OpenSans-Italic-webfont.svg b/docs/fonts/OpenSans-Italic-webfont.svg new file mode 100644 index 00000000..e1075dcc --- /dev/null +++ b/docs/fonts/OpenSans-Italic-webfont.svg @@ -0,0 +1,1830 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/fonts/OpenSans-Italic-webfont.woff b/docs/fonts/OpenSans-Italic-webfont.woff new file mode 100644 index 00000000..ff652e64 Binary files /dev/null and b/docs/fonts/OpenSans-Italic-webfont.woff differ diff --git a/docs/fonts/OpenSans-Light-webfont.eot b/docs/fonts/OpenSans-Light-webfont.eot new file mode 100644 index 00000000..14868406 Binary files /dev/null and b/docs/fonts/OpenSans-Light-webfont.eot differ diff --git a/docs/fonts/OpenSans-Light-webfont.svg b/docs/fonts/OpenSans-Light-webfont.svg new file mode 100644 index 00000000..11a472ca --- /dev/null +++ b/docs/fonts/OpenSans-Light-webfont.svg @@ -0,0 +1,1831 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/fonts/OpenSans-Light-webfont.woff b/docs/fonts/OpenSans-Light-webfont.woff new file mode 100644 index 00000000..e7860748 Binary files /dev/null and b/docs/fonts/OpenSans-Light-webfont.woff differ diff --git a/docs/fonts/OpenSans-LightItalic-webfont.eot b/docs/fonts/OpenSans-LightItalic-webfont.eot new file mode 100644 index 00000000..8f445929 Binary files /dev/null and b/docs/fonts/OpenSans-LightItalic-webfont.eot differ diff --git a/docs/fonts/OpenSans-LightItalic-webfont.svg b/docs/fonts/OpenSans-LightItalic-webfont.svg new file mode 100644 index 00000000..431d7e35 --- /dev/null +++ b/docs/fonts/OpenSans-LightItalic-webfont.svg @@ -0,0 +1,1835 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/fonts/OpenSans-LightItalic-webfont.woff b/docs/fonts/OpenSans-LightItalic-webfont.woff new file mode 100644 index 00000000..43e8b9e6 Binary files /dev/null and b/docs/fonts/OpenSans-LightItalic-webfont.woff differ diff --git a/docs/fonts/OpenSans-Regular-webfont.eot b/docs/fonts/OpenSans-Regular-webfont.eot new file mode 100644 index 00000000..6bbc3cf5 Binary files /dev/null and b/docs/fonts/OpenSans-Regular-webfont.eot differ diff --git a/docs/fonts/OpenSans-Regular-webfont.svg b/docs/fonts/OpenSans-Regular-webfont.svg new file mode 100644 index 00000000..25a39523 --- /dev/null +++ b/docs/fonts/OpenSans-Regular-webfont.svg @@ -0,0 +1,1831 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/fonts/OpenSans-Regular-webfont.woff b/docs/fonts/OpenSans-Regular-webfont.woff new file mode 100644 index 00000000..e231183d Binary files /dev/null and b/docs/fonts/OpenSans-Regular-webfont.woff differ diff --git a/docs/global.html b/docs/global.html new file mode 100644 index 00000000..0bff1acd --- /dev/null +++ b/docs/global.html @@ -0,0 +1,5382 @@ + + + + + JSDoc: Global + + + + + + + + + + +
+ +

Global

+ + + + + + +
+ +
+ +

+ + +
+ +
+
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + +

Methods

+ + + + + + + +

armor(messagetype, body, partindex, parttotal, customComment) → {String|ReadableStream.<String>}

+ + + + + + +
+

Armor an OpenPGP binary packet block

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
messagetype + + +Integer + + + +

type of the message

body + +
partindex + + +Integer + + + +
parttotal + + +Integer + + + +
customComment + + +String + + + +

(optional) additional comment to add to the armored string

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

Armored text

+
+ + + +
+
+ Type +
+
+ +String +| + +ReadableStream.<String> + + +
+
+ + + + + + + + + + + + + +

(async) decrypt(message, privateKeys, passwords, sessionKeys, publicKeys, format, streaming, signature, date, config) → {Promise.<Object>}

+ + + + + + +
+

Decrypts a message with the user's private key, a session key or a password. Either a private key, +a session key or a password must be specified.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
message + + +Message + + + +

the message object with the encrypted data

privateKeys + + +Key +| + +Array.<Key> + + + +

(optional) private keys with decrypted secret key data or session key

passwords + + +String +| + +Array.<String> + + + +

(optional) passwords to decrypt the message

sessionKeys + + +Object +| + +Array.<Object> + + + +

(optional) session keys in the form: { data:Uint8Array, algorithm:String }

publicKeys + + +Key +| + +Array.<Key> + + + +

(optional) array of public keys or single key, to verify signatures

format + + +'utf8' +| + +'binary' + + + +

(optional) whether to return data as a string(Stream) or Uint8Array(Stream). If 'utf8' (the default), also normalize newlines.

streaming + + +'web' +| + +'ponyfill' +| + +'node' +| + +false + + + +

(optional) whether to return data as a stream. Defaults to the type of stream message was created from, if any.

signature + + +Signature + + + +

(optional) detached signature for verification

date + + +Date + + + +

(optional) use the given date for verification instead of the current time

config + + +Object + + + +

(optional) custom configuration settings to overwrite those in openpgp.config

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

Object containing decrypted and verified message in the form:

+
{
+  data: String|ReadableStream<String>|NodeStream, (if format was 'utf8', the default)
+  data: Uint8Array|ReadableStream<Uint8Array>|NodeStream, (if format was 'binary')
+  filename: String,
+  signatures: [
+    {
+      keyid: module:type/keyid~Keyid,
+      verified: Promise<Boolean>,
+      valid: Boolean (if streaming was false)
+    }, ...
+  ]
+}
+
+ + + +
+
+ Type +
+
+ +Promise.<Object> + + +
+
+ + + + + + + + + + + + + +

(async) decryptKey(privateKey, passphrase, config) → {Promise.<Key>}

+ + + + + + +
+

Unlock a private key with the given passphrase. +This method does not change the original key.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
privateKey + + +Key + + + +

the private key to decrypt

passphrase + + +String +| + +Array.<String> + + + +

the user's passphrase(s)

config + + +Object + + + +

(optional) custom configuration settings to overwrite those in openpgp.config

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

the unlocked key object

+
+ + + +
+
+ Type +
+
+ +Promise.<Key> + + +
+
+ + + + + + + + + + + + + +

(async) decryptSessionKeys(message, privateKeys, passwords, config) → {Promise.<(Object|undefined)>}

+ + + + + + +
+

Decrypt symmetric session keys with a private key or password. Either a private key or +a password must be specified.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
message + + +Message + + + +

a message object containing the encrypted session key packets

privateKeys + + +Key +| + +Array.<Key> + + + +

(optional) private keys with decrypted secret key data

passwords + + +String +| + +Array.<String> + + + +

(optional) passwords to decrypt the session key

config + + +Object + + + +

(optional) custom configuration settings to overwrite those in openpgp.config

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

Array of decrypted session key, algorithm pairs in form: +{ data:Uint8Array, algorithm:String } +or 'undefined' if no key packets found

+
+ + + +
+
+ Type +
+
+ +Promise.<(Object|undefined)> + + +
+
+ + + + + + + + + + + + + +

(async) encrypt(message, publicKeys, privateKeys, passwords, sessionKey, armor, streaming, signature, wildcard, signingKeyIds, encryptionKeyIds, date, fromUserIds, toUserIds, config) → {Promise.<(String|ReadableStream.<String>|NodeStream.<String>|Uint8Array|ReadableStream.<Uint8Array>|NodeStream.<Uint8Array>)>}

+ + + + + + +
+

Encrypts message text/data with public keys, passwords or both at once. At least either public keys or passwords +must be specified. If private keys are specified, those will be used to sign the message.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
message + + +Message + + + +

message to be encrypted as created by openpgp.Message.fromText or openpgp.Message.fromBinary

publicKeys + + +Key +| + +Array.<Key> + + + +

(optional) array of keys or single key, used to encrypt the message

privateKeys + + +Key +| + +Array.<Key> + + + +

(optional) private keys for signing. If omitted message will not be signed

passwords + + +String +| + +Array.<String> + + + +

(optional) array of passwords or a single password to encrypt the message

sessionKey + + +Object + + + +

(optional) session key in the form: { data:Uint8Array, algorithm:String }

armor + + +Boolean + + + +

(optional) whether the return values should be ascii armored (true, the default) or binary (false)

streaming + + +'web' +| + +'ponyfill' +| + +'node' +| + +false + + + +

(optional) whether to return data as a stream. Defaults to the type of stream message was created from, if any.

signature + + +Signature + + + +

(optional) a detached signature to add to the encrypted message

wildcard + + +Boolean + + + +

(optional) use a key ID of 0 instead of the public key IDs

signingKeyIds + + +Array.<module:type/keyid~Keyid> + + + +

(optional) array of key IDs to use for signing. Each signingKeyIds[i] corresponds to privateKeys[i]

encryptionKeyIds + + +Array.<module:type/keyid~Keyid> + + + +

(optional) array of key IDs to use for encryption. Each encryptionKeyIds[i] corresponds to publicKeys[i]

date + + +Date + + + +

(optional) override the creation date of the message signature

fromUserIds + + +Array.<Object> + + + +

(optional) array of user IDs to sign with, one per key in privateKeys, e.g. [{ name:'Steve Sender', email:'steve@openpgp.org' }]

toUserIds + + +Array.<Object> + + + +

(optional) array of user IDs to encrypt for, one per key in publicKeys, e.g. [{ name:'Robert Receiver', email:'robert@openpgp.org' }]

config + + +Object + + + +

(optional) custom configuration settings to overwrite those in openpgp.config

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

(String if armor was true, the default; Uint8Array if armor was false)

+
+ + + +
+
+ Type +
+
+ +Promise.<(String|ReadableStream.<String>|NodeStream.<String>|Uint8Array|ReadableStream.<Uint8Array>|NodeStream.<Uint8Array>)> + + +
+
+ + + + + + + + + + + + + +

(async) encryptKey(privateKey, passphrase, config) → {Promise.<Key>}

+ + + + + + +
+

Lock a private key with the given passphrase. +This method does not change the original key.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
privateKey + + +Key + + + +

the private key to encrypt

passphrase + + +String +| + +Array.<String> + + + +

if multiple passphrases, they should be in the same order as the packets each should encrypt

config + + +Object + + + +

(optional) custom configuration settings to overwrite those in openpgp.config

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

the locked key object

+
+ + + +
+
+ Type +
+
+ +Promise.<Key> + + +
+
+ + + + + + + + + + + + + +

(async) encryptSessionKey(data, algorithm, aeadAlgorithm, publicKeys, passwords, armor, wildcard, encryptionKeyIds, date, toUserIds, config) → {Promise.<(String|Uint8Array)>}

+ + + + + + +
+

Encrypt a symmetric session key with public keys, passwords, or both at once. At least either public keys +or passwords must be specified.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
data + + +Uint8Array + + + +

the session key to be encrypted e.g. 16 random bytes (for aes128)

algorithm + + +String + + + +

algorithm of the symmetric session key e.g. 'aes128' or 'aes256'

aeadAlgorithm + + +String + + + +

(optional) aead algorithm, e.g. 'eax' or 'ocb'

publicKeys + + +Key +| + +Array.<Key> + + + +

(optional) array of public keys or single key, used to encrypt the key

passwords + + +String +| + +Array.<String> + + + +

(optional) passwords for the message

armor + + +Boolean + + + +

(optional) whether the return values should be ascii armored (true, the default) or binary (false)

wildcard + + +Boolean + + + +

(optional) use a key ID of 0 instead of the public key IDs

encryptionKeyIds + + +Array.<module:type/keyid~Keyid> + + + +

(optional) array of key IDs to use for encryption. Each encryptionKeyIds[i] corresponds to publicKeys[i]

date + + +Date + + + +

(optional) override the date

toUserIds + + +Array + + + +

(optional) array of user IDs to encrypt for, one per key in publicKeys, e.g. [{ name:'Phil Zimmermann', email:'phil@openpgp.org' }]

config + + +Object + + + +

(optional) custom configuration settings to overwrite those in openpgp.config

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

(String if armor was true, the default; Uint8Array if armor was false)

+
+ + + +
+
+ Type +
+
+ +Promise.<(String|Uint8Array)> + + +
+
+ + + + + + + + + + + + + +

(async) generateKey(type, userIds, passphrase, rsaBits, curve, date, keyExpirationTime, subkeys, config) → {Promise.<Object>}

+ + + + + + +
+

Generates a new OpenPGP key pair. Supports RSA and ECC keys. By default, primary and subkeys will be of same type.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
type + + +ecc +| + +rsa + + + +

(optional) The primary key algorithm type: ECC (default) or RSA

userIds + + +Object +| + +Array.<Object> + + + +

User IDs as objects: { name:'Jo Doe', email:'info@jo.com' }

passphrase + + +String + + + +

(optional) The passphrase used to encrypt the resulting private key

rsaBits + + +Number + + + +

(optional) Number of bits for RSA keys, defaults to 4096

curve + + +String + + + +

(optional) Elliptic curve for ECC keys: +curve25519 (default), p256, p384, p521, secp256k1, +brainpoolP256r1, brainpoolP384r1, or brainpoolP512r1

date + + +Date + + + +

(optional) Override the creation date of the key and the key signatures

keyExpirationTime + + +Number + + + +

(optional) Number of seconds from the key creation time after which the key expires

subkeys + + +Array.<Object> + + + +

(optional) Options for each subkey, default to main key options. e.g. [{sign: true, passphrase: '123'}] +sign parameter defaults to false, and indicates whether the subkey should sign rather than encrypt

config + + +Object + + + +

(optional) custom configuration settings to overwrite those in openpgp.config

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

The generated key object in the form: +{ key:Key, privateKeyArmored:String, publicKeyArmored:String, revocationCertificate:String }

+
+ + + +
+
+ Type +
+
+ +Promise.<Object> + + +
+
+ + + + + + + + + + + + + +

(async) generateSessionKey(publicKeys, date, toUserIds, config) → {Promise.<{data: Uint8Array, algorithm: String}>}

+ + + + + + +
+

Generate a new session key object, taking the algorithm preferences of the passed public keys into account.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
publicKeys + + +Key +| + +Array.<Key> + + + +

array of public keys or single key used to select algorithm preferences for

date + + +Date + + + +

(optional) date to select algorithm preferences at

toUserIds + + +Array + + + +

(optional) user IDs to select algorithm preferences for

config + + +Object + + + +

(optional) custom configuration settings to overwrite those in openpgp.config

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

object with session key data and algorithm

+
+ + + +
+
+ Type +
+
+ +Promise.<{data: Uint8Array, algorithm: String}> + + +
+
+ + + + + + + + + + + + + +

(async) readCleartextMessage(cleartextMessage, config) → {CleartextMessage}

+ + + + + + +
+

Reads an OpenPGP cleartext signed message and returns a CleartextMessage object

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
cleartextMessage + + +String +| + +ReadableStream.<String> + + + +

text to be parsed

config + + +Object + + + +

(optional) custom configuration settings to overwrite those in openpgp.config

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

new cleartext message object

+
+ + + +
+
+ Type +
+
+ +CleartextMessage + + +
+
+ + + + + + + + + + + + + +

(async) readKey(armoredKey, binaryKey, config) → {Promise.<Key>}

+ + + + + + +
+

Reads an (optionally armored) OpenPGP key and returns a key object

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
armoredKey + + +String + + + +

armored key to be parsed

binaryKey + + +Uint8Array + + + +

binary key to be parsed

config + + +Object + + + +

(optional) custom configuration settings to overwrite those in openpgp.config

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

key object

+
+ + + +
+
+ Type +
+
+ +Promise.<Key> + + +
+
+ + + + + + + + + + + + + +

(async) readKeys(armoredKeys, binaryKeys, config) → {Promise.<Array.<Key>>}

+ + + + + + +
+

Reads an (optionally armored) OpenPGP key block and returns a list of key objects

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
armoredKeys + + +String +| + +ReadableStream.<String> + + + +

armored keys to be parsed

binaryKeys + + +Uint8Array +| + +ReadableStream.<Uint8Array> + + + +

binary keys to be parsed

config + + +Object + + + +

(optional) custom configuration settings to overwrite those in openpgp.config

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

key objects

+
+ + + +
+
+ Type +
+
+ +Promise.<Array.<Key>> + + +
+
+ + + + + + + + + + + + + +

(async) readMessage(armoredMessage, binaryMessage, config) → {Promise.<Message>}

+ + + + + + +
+

Reads an (optionally armored) OpenPGP message and returns a Message object

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
armoredMessage + + +String +| + +ReadableStream.<String> + + + +

armored message to be parsed

binaryMessage + + +Uint8Array +| + +ReadableStream.<Uint8Array> + + + +

binary to be parsed

config + + +Object + + + +

(optional) custom configuration settings to overwrite those in openpgp.config

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

new message object

+
+ + + +
+
+ Type +
+
+ +Promise.<Message> + + +
+
+ + + + + + + + + + + + + +

(async) readSignature(armoredSignature, binarySignature, config) → {Signature}

+ + + + + + +
+

reads an (optionally armored) OpenPGP signature and returns a signature object

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
armoredSignature + + +String +| + +ReadableStream.<String> + + + +

armored signature to be parsed

binarySignature + + +Uint8Array +| + +ReadableStream.<Uint8Array> + + + +

binary signature to be parsed

config + + +Object + + + +

(optional) custom configuration settings to overwrite those in openpgp.config

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

new signature object

+
+ + + +
+
+ Type +
+
+ +Signature + + +
+
+ + + + + + + + + + + + + +

(async) reformatKey(privateKey, userIds, passphrase, keyExpirationTime, config) → {Promise.<Object>}

+ + + + + + +
+

Reformats signature packets for a key and rewraps key object.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
privateKey + + +Key + + + +

Private key to reformat

userIds + + +Object +| + +Array.<Object> + + + +

User IDs as objects: { name:'Jo Doe', email:'info@jo.com' }

passphrase + + +String + + + +

(optional) The passphrase used to encrypt the resulting private key

keyExpirationTime + + +Number + + + +

(optional) Number of seconds from the key creation time after which the key expires

config + + +Object + + + +

(optional) custom configuration settings to overwrite those in openpgp.config

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

The generated key object in the form: +{ key:Key, privateKeyArmored:String, publicKeyArmored:String, revocationCertificate:String }

+
+ + + +
+
+ Type +
+
+ +Promise.<Object> + + +
+
+ + + + + + + + + + + + + +

(async) revokeKey(key, revocationCertificate, reasonForRevocation, config) → {Promise.<Object>}

+ + + + + + +
+

Revokes a key. Requires either a private key or a revocation certificate. +If a revocation certificate is passed, the reasonForRevocation parameters will be ignored.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
key + + +Key + + + +

(optional) public or private key to revoke

revocationCertificate + + +String + + + +

(optional) revocation certificate to revoke the key with

reasonForRevocation + + +Object + + + +

(optional) object indicating the reason for revocation

+
Properties
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
flag + + +module:enums.reasonForRevocation + + + +

(optional) flag indicating the reason for revocation

string + + +String + + + +

(optional) string explaining the reason for revocation

+ +
config + + +Object + + + +

(optional) custom configuration settings to overwrite those in openpgp.config

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

The revoked key object in the form: +{ privateKey:Key, privateKeyArmored:String, publicKey:Key, publicKeyArmored:String } +(if private key is passed) or { publicKey:Key, publicKeyArmored:String } (otherwise)

+
+ + + +
+
+ Type +
+
+ +Promise.<Object> + + +
+
+ + + + + + + + + + + + + +

(async) sign(message, privateKeys, armor, streaming, detached, signingKeyIds, date, fromUserIds, config) → {Promise.<(String|ReadableStream.<String>|NodeStream.<String>|Uint8Array|ReadableStream.<Uint8Array>|NodeStream.<Uint8Array>)>}

+ + + + + + +
+

Signs a message.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
message + + +CleartextMessage +| + +Message + + + +

(cleartext) message to be signed

privateKeys + + +Key +| + +Array.<Key> + + + +

array of keys or single key with decrypted secret key data to sign cleartext

armor + + +Boolean + + + +

(optional) whether the return values should be ascii armored (true, the default) or binary (false)

streaming + + +'web' +| + +'ponyfill' +| + +'node' +| + +false + + + +

(optional) whether to return data as a stream. Defaults to the type of stream message was created from, if any.

detached + + +Boolean + + + +

(optional) if the return value should contain a detached signature

signingKeyIds + + +Array.<module:type/keyid~Keyid> + + + +

(optional) array of key IDs to use for signing. Each signingKeyIds[i] corresponds to privateKeys[i]

date + + +Date + + + +

(optional) override the creation date of the signature

fromUserIds + + +Array.<Object> + + + +

(optional) array of user IDs to sign with, one per key in privateKeys, e.g. [{ name:'Steve Sender', email:'steve@openpgp.org' }]

config + + +Object + + + +

(optional) custom configuration settings to overwrite those in openpgp.config

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

(String if armor was true, the default; Uint8Array if armor was false)

+
+ + + +
+
+ Type +
+
+ +Promise.<(String|ReadableStream.<String>|NodeStream.<String>|Uint8Array|ReadableStream.<Uint8Array>|NodeStream.<Uint8Array>)> + + +
+
+ + + + + + + + + + + + + +

(async) unarmor(text) → {Promise.<Object>}

+ + + + + + +
+

DeArmor an OpenPGP armored message; verify the checksum and return +the encoded bytes

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
text + + +String + + + +

OpenPGP armored message

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

An object with attribute "text" containing the message text, +an attribute "data" containing a stream of bytes and "type" for the ASCII armor type

+
+ + + +
+
+ Type +
+
+ +Promise.<Object> + + +
+
+ + + + + + + + + + + + + +

(async) verify(publicKeys, message, format, streaming, signature, date, config) → {Promise.<Object>}

+ + + + + + +
+

Verifies signatures of cleartext signed message

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
publicKeys + + +Key +| + +Array.<Key> + + + +

array of publicKeys or single key, to verify signatures

message + + +CleartextMessage +| + +Message + + + +

(cleartext) message object with signatures

format + + +'utf8' +| + +'binary' + + + +

(optional) whether to return data as a string(Stream) or Uint8Array(Stream). If 'utf8' (the default), also normalize newlines.

streaming + + +'web' +| + +'ponyfill' +| + +'node' +| + +false + + + +

(optional) whether to return data as a stream. Defaults to the type of stream message was created from, if any.

signature + + +Signature + + + +

(optional) detached signature for verification

date + + +Date + + + +

(optional) use the given date for verification instead of the current time

config + + +Object + + + +

(optional) custom configuration settings to overwrite those in openpgp.config

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

Object containing verified message in the form:

+
{
+  data: String|ReadableStream<String>|NodeStream, (if `message` was a CleartextMessage)
+  data: Uint8Array|ReadableStream<Uint8Array>|NodeStream, (if `message` was a Message)
+  signatures: [
+    {
+      keyid: module:type/keyid~Keyid,
+      verified: Promise<Boolean>,
+      valid: Boolean (if `streaming` was false)
+    }, ...
+  ]
+}
+
+ + + +
+
+ Type +
+
+ +Promise.<Object> + + +
+
+ + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ + + + + + + \ No newline at end of file diff --git a/docs/index.html b/docs/index.html new file mode 100644 index 00000000..85d3504c --- /dev/null +++ b/docs/index.html @@ -0,0 +1,676 @@ + + + + + JSDoc: Home + + + + + + + + + + +
+ +

Home

+ + + + + + + + +

+ + + + + + + + + + + + + + + +
+

OpenPGP.js BrowserStack Status Join the chat on Gitter

+

OpenPGP.js is a JavaScript implementation of the OpenPGP protocol. It implements RFC4880 and parts of RFC4880bis.

+

Table of Contents

+ +

Platform Support

+
    +
  • +

    The dist/openpgp.min.js bundle works well with recent versions of Chrome, Firefox, Safari and Edge.

    +
  • +
  • +

    The dist/node/openpgp.min.js bundle works well in Node.js. It is used by default when you require('openpgp') in Node.js.

    +
  • +
  • +

    Currently, Chrome, Safari and Edge have partial implementations of the +Streams specification, and Firefox +has a partial implementation behind feature flags. Chrome is the only +browser that implements TransformStreams, which we need, so we include +a polyfill for +all other browsers. Please note that in those browsers, the global +ReadableStream property gets overwritten with the polyfill version if +it exists. In some edge cases, you might need to use the native +ReadableStream (for example when using it to create a Response +object), in which case you should store a reference to it before loading +OpenPGP.js. There is also the +web-streams-adapter +library to convert back and forth between them.

    +
  • +
+

Performance

+
    +
  • +

    Version 3.0.0 of the library introduces support for public-key cryptography using elliptic curves. We use native implementations on browsers and Node.js when available. Elliptic curve cryptography provides stronger security per bits of key, which allows for much faster operations. Currently the following curves are supported:

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    CurveEncryptionSignatureNodeCryptoWebCryptoConstant-Time
    curve25519ECDHN/ANoNoAlgorithmically**
    ed25519N/AEdDSANoNoAlgorithmically**
    p256ECDHECDSAYes*Yes*If native***
    p384ECDHECDSAYes*Yes*If native***
    p521ECDHECDSAYes*Yes*If native***
    brainpoolP256r1ECDHECDSAYes*NoIf native***
    brainpoolP384r1ECDHECDSAYes*NoIf native***
    brainpoolP512r1ECDHECDSAYes*NoIf native***
    secp256k1ECDHECDSAYes*NoIf native***
    +

    * when available
    +** the curve25519 and ed25519 implementations are algorithmically constant-time, but may not be constant-time after optimizations of the JavaScript compiler
    +*** these curves are only constant-time if the underlying native implementation is available and constant-time

    +
  • +
  • +

    Version 2.x of the library has been built from the ground up with Uint8Arrays. This allows for much better performance and memory usage than strings.

    +
  • +
  • +

    If the user's browser supports native WebCrypto via the window.crypto.subtle API, this will be used. Under Node.js the native crypto module is used.

    +
  • +
  • +

    The library implements the IETF proposal for authenticated encryption using native AES-EAX, OCB, or GCM. This makes symmetric encryption up to 30x faster on supported platforms. Since the specification has not been finalized and other OpenPGP implementations haven't adopted it yet, the feature is currently behind a flag. Note: activating this setting can break compatibility with other OpenPGP implementations, and also with future versions of OpenPGP.js. Don't use it with messages you want to store on disk or in a database. You can enable it by setting openpgp.config.aeadProtect = true.

    +

    You can change the AEAD mode by setting one of the following options:

    +
    openpgp.config.aeadMode = openpgp.enums.aead.eax // Default, native
    +openpgp.config.aeadMode = openpgp.enums.aead.ocb // Non-native
    +openpgp.config.aeadMode = openpgp.enums.aead.experimentalGcm // **Non-standard**, fastest
    +
    +
  • +
  • +

    For environments that don't provide native crypto, the library falls back to asm.js implementations of AES, SHA-1, and SHA-256.

    +
  • +
+

Getting started

+

Node.js

+

Install OpenPGP.js using npm and save it in your dependencies:

+
npm install --save openpgp
+
+

And import it as a CommonJS module:

+
const openpgp = require('openpgp');
+
+

Or as an ES6 module, from an .mjs file:

+
import * as openpgp from 'openpgp';
+
+

Browser (webpack)

+

Install OpenPGP.js using npm and save it in your devDependencies:

+
npm install --save-dev openpgp
+
+

And import it as an ES6 module:

+
import * as openpgp from 'openpgp';
+
+

You can also only import the functions you need, as follows:

+
import { readMessage, decrypt } from 'openpgp';
+
+

Or, if you want to use the lightweight build (which is smaller, and lazily loads non-default curves on demand):

+
import * as openpgp from 'openpgp/lightweight';
+
+

To test whether the lazy loading works, try to generate a key with a non-standard curve:

+
import { generateKey } from 'openpgp/lightweight';
+await generateKey({ curve: 'brainpoolP512r1',  userIds: [{ name: 'Test', email: 'test@test.com' }] });
+
+

For more examples of how to generate a key, see Generate new key pair. It is recommended to use curve25519 instead of brainpoolP512r1 by default.

+

Browser (plain files)

+

Grab openpgp.min.js from unpkg.com/openpgp/dist, and load it in a script tag:

+
<script src="openpgp.min.js"></script>
+
+

Or, to load OpenPGP.js as an ES6 module, grab openpgp.min.mjs from unpkg.com/openpgp/dist, and import it as follows:

+
<script type="module">
+import * as openpgp from './openpgp.min.mjs';
+</script>
+
+

To offload cryptographic operations off the main thread, you can implement a Web Worker in your application and load OpenPGP.js from there. For an example Worker implementation, see test/worker/worker_example.js.

+

Examples

+

Here are some examples of how to use OpenPGP.js v5. For more elaborate examples and working code, please check out the public API unit tests. If you're upgrading from v4 it might help to check out the changelog and documentation.

+

Encrypt and decrypt Uint8Array data with a password

+

Encryption will use the algorithm specified in config.encryptionCipher (defaults to aes256), and decryption will use the algorithm used for encryption.

+
(async () => {
+    const message = openpgp.Message.fromBinary(new Uint8Array([0x01, 0x01, 0x01]));
+    const encrypted = await openpgp.encrypt({
+        message, // input as Message object
+        passwords: ['secret stuff'], // multiple passwords possible
+        armor: false // don't ASCII armor (for Uint8Array output)
+    });
+    console.log(encrypted); // Uint8Array
+
+    const encryptedMessage = await openpgp.readMessage({
+        binaryMessage: encrypted // parse encrypted bytes
+    });
+    const { data: decrypted } = await openpgp.decrypt({
+        message: encryptedMessage,
+        passwords: ['secret stuff'], // decrypt with password
+        format: 'binary' // output as Uint8Array
+    });
+    console.log(decrypted); // Uint8Array([0x01, 0x01, 0x01])
+})();
+
+

Encrypt and decrypt String data with PGP keys

+

Encryption will use the algorithm preferred by the public key (defaults to aes256 for keys generated in OpenPGP.js), and decryption will use the algorithm used for encryption.

+
const openpgp = require('openpgp'); // use as CommonJS, AMD, ES6 module or via window.openpgp
+
+(async () => {
+    // put keys in backtick (``) to avoid errors caused by spaces or tabs
+    const publicKeyArmored = `-----BEGIN PGP PUBLIC KEY BLOCK-----
+...
+-----END PGP PUBLIC KEY BLOCK-----`;
+    const privateKeyArmored = `-----BEGIN PGP PRIVATE KEY BLOCK-----
+...
+-----END PGP PRIVATE KEY BLOCK-----`; // encrypted private key
+    const passphrase = `yourPassphrase`; // what the private key is encrypted with
+
+    const publicKey = await openpgp.readKey({ armoredKey: publicKeyArmored });
+
+    const privateKey = await openpgp.readKey({ armoredKey: privateKeyArmored });
+    await privateKey.decrypt(passphrase);
+
+    const encrypted = await openpgp.encrypt({
+        message: openpgp.Message.fromText('Hello, World!'), // input as Message object
+        publicKeys: publicKey, // for encryption
+        privateKeys: privateKey // for signing (optional)
+    });
+    console.log(encrypted); // '-----BEGIN PGP MESSAGE ... END PGP MESSAGE-----'
+
+    const message = await openpgp.readMessage({
+        armoredMessage: encrypted // parse armored message
+    });
+    const { data: decrypted } = await openpgp.decrypt({
+        message,
+        publicKeys: publicKey, // for verification (optional)
+        privateKeys: privateKey // for decryption
+    });
+    console.log(decrypted); // 'Hello, World!'
+})();
+
+

Encrypt with multiple public keys:

+
(async () => {
+    const publicKeysArmored = [
+        `-----BEGIN PGP PUBLIC KEY BLOCK-----
+...
+-----END PGP PUBLIC KEY BLOCK-----`,
+        `-----BEGIN PGP PUBLIC KEY BLOCK-----
+...
+-----END PGP PUBLIC KEY BLOCK-----`
+    ];
+    const privateKeyArmored = `-----BEGIN PGP PRIVATE KEY BLOCK-----
+...
+-----END PGP PRIVATE KEY BLOCK-----`;    // encrypted private key
+    const passphrase = `yourPassphrase`; // what the private key is encrypted with
+    const message = 'Hello, World!';
+
+    const publicKeys = await Promise.all(publicKeysArmored.map(armoredKey => openpgp.readKey({ armoredKey })));
+
+    const privateKey = await openpgp.readKey({ armoredKey: privateKeyArmored });
+    await privateKey.decrypt(passphrase)
+
+    const message = openpgp.Message.fromText(message);
+    const encrypted = await openpgp.encrypt({
+        message:, // input as Message object
+        publicKeys, // for encryption
+        privateKeys: privateKey // for signing (optional)
+    });
+    console.log(encrypted); // '-----BEGIN PGP MESSAGE ... END PGP MESSAGE-----'
+})();
+
+

Encrypt with compression

+

By default, encrypt will not use any compression. It's possible to override that behavior in two ways:

+

Either set the compression parameter in the options object when calling encrypt.

+
(async () => {
+    const message = openpgp.Message.fromBinary(new Uint8Array([0x01, 0x02, 0x03])); // or .fromText('string')
+    const encrypted = await openpgp.encrypt({
+        message,
+        passwords: ['secret stuff'], // multiple passwords possible
+        compression: openpgp.enums.compression.zip // compress the data with zip
+    });
+})();
+
+

Or, override the config to enable compression:

+
openpgp.config.compression = openpgp.enums.compression.zlib;
+
+

Where the value can be any of:

+
    +
  • openpgp.enums.compression.zip
  • +
  • openpgp.enums.compression.zlib
  • +
+

Streaming encrypt Uint8Array data with a password

+
(async () => {
+    const readableStream = new openpgp.stream.ReadableStream({
+        start(controller) {
+            controller.enqueue(new Uint8Array([0x01, 0x02, 0x03]));
+            controller.close();
+        }
+    });
+
+    const message = openpgp.Message.fromBinary(readableStream);
+    const encrypted = await openpgp.encrypt({
+        message, // input as Message object
+        passwords: ['secret stuff'], // multiple passwords possible
+        armor: false // don't ASCII armor (for Uint8Array output)
+    });
+    console.log(encrypted); // raw encrypted packets as ReadableStream<Uint8Array>
+
+    // Either pipe the above stream somewhere, pass it to another function,
+    // or read it manually as follows:
+    const reader = openpgp.stream.getReader(encrypted);
+    while (true) {
+        const { done, value } = await reader.read();
+        if (done) break;
+        console.log('new chunk:', value); // Uint8Array
+    }
+
+    // Or, in Node.js, you can pipe the above stream as follows:
+    const nodeStream = openpgp.stream.webToNode(encrypted);
+    nodeStream.pipe(nodeWritableStream);
+})();
+
+

For more information on creating ReadableStreams, see the MDN Documentation on new ReadableStream(). +For more information on reading streams using openpgp.stream, see the documentation of +the web-stream-tools dependency, particularly +its Reader class.

+

Streaming encrypt and decrypt String data with PGP keys

+
(async () => {
+    const publicKeyArmored = `-----BEGIN PGP PUBLIC KEY BLOCK-----
+...
+-----END PGP PUBLIC KEY BLOCK-----`; // Public key
+    const [privateKeyArmored] = `-----BEGIN PGP PRIVATE KEY BLOCK-----
+...
+-----END PGP PRIVATE KEY BLOCK-----`; // Encrypted private key
+    const passphrase = `yourPassphrase`; // Password that private key is encrypted with
+
+    const publicKey = await openpgp.readKey({ armoredKey: publicKeyArmored });
+
+    const privateKey = await openpgp.readKey({ armoredKey: privateKeyArmored });
+    await privateKey.decrypt(passphrase);
+
+    const readableStream = new openpgp.stream.ReadableStream({
+        start(controller) {
+            controller.enqueue('Hello, world!');
+            controller.close();
+        }
+    });
+
+    const encrypted = await openpgp.encrypt({
+        message: openpgp.Message.fromText(readableStream), // input as Message object
+        publicKeys: publicKey, // for encryption
+        privateKeys: privateKey // for signing (optional)
+    });
+    console.log(encrypted); // ReadableStream containing '-----BEGIN PGP MESSAGE ... END PGP MESSAGE-----'
+
+    const message = await openpgp.readMessage({
+        armoredMessage: encrypted // parse armored message
+    });
+    const decrypted = await openpgp.decrypt({
+        message,
+        publicKeys: publicKey, // for verification (optional)
+        privateKeys: privateKey // for decryption
+    });
+    const plaintext = await openpgp.stream.readToEnd(decrypted.data);
+    console.log(plaintext); // 'Hello, World!'
+})();
+
+

Generate new key pair

+

ECC keys (smaller and faster to generate):

+

Possible values for curve are: curve25519, ed25519, p256, p384, p521, +brainpoolP256r1, brainpoolP384r1, brainpoolP512r1, and secp256k1. +Note that both the curve25519 and ed25519 options generate a primary key for signing using Ed25519 +and a subkey for encryption using Curve25519.

+
(async () => {
+    const { privateKeyArmored, publicKeyArmored, revocationCertificate } = await openpgp.generateKey({
+        type: 'ecc', // Type of the key, defaults to ECC
+        curve: 'curve25519', // ECC curve name, defaults to curve25519
+        userIds: [{ name: 'Jon Smith', email: 'jon@example.com' }], // you can pass multiple user IDs
+        passphrase: 'super long and hard to guess secret' // protects the private key
+    });
+
+    console.log(privateKeyArmored);     // '-----BEGIN PGP PRIVATE KEY BLOCK ... '
+    console.log(publicKeyArmored);      // '-----BEGIN PGP PUBLIC KEY BLOCK ... '
+    console.log(revocationCertificate); // '-----BEGIN PGP PUBLIC KEY BLOCK ... '
+})();
+
+

RSA keys (increased compatibility):

+
(async () => {
+    const key = await openpgp.generateKey({
+        type: 'rsa', // Type of the key
+        rsaBits: 4096, // RSA key size (defaults to 4096 bits)
+        userIds: [{ name: 'Jon Smith', email: 'jon@example.com' }], // you can pass multiple user IDs
+        passphrase: 'super long and hard to guess secret' // protects the private key
+    });
+})();
+
+

Revoke a key

+

Using a revocation certificate:

+
(async () => {
+    const { publicKeyArmored: revokedKeyArmored } = await openpgp.revokeKey({
+        key: await openpgp.readKey({ armoredKey: publicKeyArmored }),
+        revocationCertificate
+    });
+    console.log(revokedKeyArmored); // '-----BEGIN PGP PUBLIC KEY BLOCK ... '
+})();
+
+

Using the private key:

+
(async () => {
+    const { publicKeyArmored, publicKey } = await openpgp.revokeKey({
+        key: await openpgp.readKey({ armoredKey: privateKeyArmored })
+    });
+})();
+
+

Lookup public key on HKP server

+
(async () => {
+    var hkp = new openpgp.HKP(); // Defaults to https://keyserver.ubuntu.com, or pass another keyserver URL as a string
+
+    let publicKeyArmored = await hkp.lookup({
+        query: 'alice@example.com'
+    });
+    let publicKey = await openpgp.readKey({ armoredKey: publicKeyArmored });
+})();
+
+

Upload public key to HKP server

+
(async () => {
+    var hkp = new openpgp.HKP('https://pgp.mit.edu');
+
+    var publicKeyArmored = `-----BEGIN PGP PUBLIC KEY BLOCK-----
+...
+-----END PGP PUBLIC KEY BLOCK-----`;
+
+    await hkp.upload(publicKeyArmored);
+})();
+
+

Sign and verify cleartext messages

+
(async () => {
+    const publicKeyArmored = `-----BEGIN PGP PUBLIC KEY BLOCK-----
+...
+-----END PGP PUBLIC KEY BLOCK-----`;
+    const privateKeyArmored = `-----BEGIN PGP PRIVATE KEY BLOCK-----
+...
+-----END PGP PRIVATE KEY BLOCK-----`; // encrypted private key
+    const passphrase = `yourPassphrase`; // what the private key is encrypted with
+
+    const publicKey = await openpgp.readKey({ armoredKey: publicKeyArmored });
+
+    const privateKey = await openpgp.readKey({ armoredKey: privateKeyArmored });
+    await privateKey.decrypt(passphrase);
+
+    const unsignedMessage = openpgp.CleartextMessage.fromText('Hello, World!');
+    const cleartextMessage = await openpgp.sign({
+        message: unsignedMessage, // CleartextMessage or Message object
+        privateKeys: privateKey // for signing
+    });
+    console.log(cleartextMessage); // '-----BEGIN PGP SIGNED MESSAGE ... END PGP SIGNATURE-----'
+
+    const signedMessage = await openpgp.readCleartextMessage({
+        cleartextMessage // parse armored message
+    });
+    const verified = await openpgp.verify({
+        message: signedMessage,
+        publicKeys: publicKey // for verification
+    });
+    const { valid } = verified.signatures[0];
+    if (valid) {
+        console.log('signed by key id ' + verified.signatures[0].keyid.toHex());
+    } else {
+        throw new Error('signature could not be verified');
+    }
+})();
+
+

Create and verify detached signatures

+
(async () => {
+    const publicKeyArmored = `-----BEGIN PGP PUBLIC KEY BLOCK-----
+...
+-----END PGP PUBLIC KEY BLOCK-----`;
+    const privateKeyArmored = `-----BEGIN PGP PRIVATE KEY BLOCK-----
+...
+-----END PGP PRIVATE KEY BLOCK-----`; // encrypted private key
+    const passphrase = `yourPassphrase`; // what the private key is encrypted with
+
+    const publicKey = await openpgp.readKey({ armoredKey: publicKeyArmored });
+
+    const privateKey = await openpgp.readKey({ armoredKey: privateKeyArmored });
+    await privateKey.decrypt(passphrase);
+
+    const cleartextMessage = openpgp.CleartextMessage.fromText('Hello, World!');
+    const detachedSignature = await openpgp.sign({
+        message: cleartextMessage, // CleartextMessage or Message object
+        privateKeys: privateKey, // for signing
+        detached: true
+    });
+    console.log(detachedSignature);
+
+    const signature = await openpgp.readSignature({
+        armoredSignature: detachedSignature // parse detached signature
+    });
+    const verified = await openpgp.verify({
+        message: cleartextMessage, // CleartextMessage or Message object
+        signature,
+        publicKeys: publicKey // for verification
+    });
+    const { valid } = verified.signatures[0];
+    if (valid) {
+        console.log('signed by key id ' + verified.signatures[0].keyid.toHex());
+    } else {
+        throw new Error('signature could not be verified');
+    }
+})();
+
+

Streaming sign and verify Uint8Array data

+
(async () => {
+    var readableStream = new openpgp.stream.ReadableStream({
+        start(controller) {
+            controller.enqueue(new Uint8Array([0x01, 0x02, 0x03]));
+            controller.close();
+        }
+    });
+
+    const publicKeyArmored = `-----BEGIN PGP PUBLIC KEY BLOCK-----
+...
+-----END PGP PUBLIC KEY BLOCK-----`;
+    const privateKeyArmored = `-----BEGIN PGP PRIVATE KEY BLOCK-----
+...
+-----END PGP PRIVATE KEY BLOCK-----`; // encrypted private key
+    const passphrase = `yourPassphrase`; // what the private key is encrypted with
+
+    const privateKey = await openpgp.readKey({ armoredKey: privateKeyArmored });
+    await privateKey.decrypt(passphrase);
+
+    const message = openpgp.Message.fromBinary(readableStream); // or .fromText(readableStream: ReadableStream<String>)
+    const signatureArmored = await openpgp.sign({
+        message,
+        privateKeys: privateKey // for signing
+    });
+    console.log(signatureArmored); // ReadableStream containing '-----BEGIN PGP MESSAGE ... END PGP MESSAGE-----'
+
+    const verified = await openpgp.verify({
+        message: await openpgp.readMessage({ armoredMessage: signatureArmored }), // parse armored signature
+        publicKeys: await openpgp.readKey({ armoredKey: publicKeyArmored })   // for verification
+    });
+
+    await openpgp.stream.readToEnd(verified.data);
+    // Note: you *have* to read `verified.data` in some way or other,
+    // even if you don't need it, as that is what triggers the
+    // verification of the data.
+
+    const { valid } = verified.signatures[0];
+    if (valid) {
+        console.log('signed by key id ' + verified.signatures[0].keyid.toHex());
+    } else {
+        throw new Error('signature could not be verified');
+    }
+})();
+
+

Documentation

+

The full documentation is available at openpgpjs.org.

+

Security Audit

+

To date the OpenPGP.js code base has undergone two complete security audits from Cure53. The first audit's report has been published here.

+

Security recommendations

+

It should be noted that js crypto apps deployed via regular web hosting (a.k.a. host-based security) provide users with less security than installable apps with auditable static versions. Installable apps can be deployed as a Firefox or Chrome packaged app. These apps are basically signed zip files and their runtimes typically enforce a strict Content Security Policy (CSP) to protect users against XSS. This blogpost explains the trust model of the web quite well.

+

It is also recommended to set a strong passphrase that protects the user's private key on disk.

+

Development

+

To create your own build of the library, just run the following command after cloning the git repo. This will download all dependencies, run the tests and create a minified bundle under dist/openpgp.min.js to use in your project:

+
npm install && npm test
+
+

For debugging browser errors, you can run npm start and open http://localhost:8080/test/unittests.html in a browser, or run the following command:

+
npm run browsertest
+
+

How do I get involved?

+

You want to help, great! It's probably best to send us a message on Gitter before you start your undertaking, to make sure nobody else is working on it, and so we can discuss the best course of action. Other than that, just go ahead and fork our repo, make your changes and send us a pull request! :)

+

License

+

GNU Lesser General Public License (3.0 or any later version). Please take a look at the LICENSE file for more information.

+
+ + + + + + +
+ + + +
+ + + + + + + \ No newline at end of file diff --git a/docs/module-config.html b/docs/module-config.html new file mode 100644 index 00000000..ad9b83d7 --- /dev/null +++ b/docs/module-config.html @@ -0,0 +1,3597 @@ + + + + + JSDoc: Module: config + + + + + + + + + + +
+ +

Module: config

+ + + + + + +
+ +
+ + + + + +
+ +
+
+ + +

This object contains global configuration values.

+ + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + +
See:
+
+
    +
  • module:config/config
  • +
+
+ + + +
+ + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + +

Members

+ + + +

(static) aeadChunkSizeByte

+ + + + +
+

Chunk Size Byte for Authenticated Encryption with Additional Data (AEAD) mode +Only has an effect when aeadProtect is set to true. +Must be an integer value from 0 to 56.

+
+ + + + + + + +
Properties:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
aeadChunkSizeByte + + +Integer + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

(static) aeadMode

+ + + + +
+

Default Authenticated Encryption with Additional Data (AEAD) encryption mode +Only has an effect when aeadProtect is set to true.

+
+ + + + + + + +
Properties:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
aeadMode + + +Integer + + + +

Default AEAD mode module:enums.aead

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

(static) aeadProtect

+ + + + +
+

Use Authenticated Encryption with Additional Data (AEAD) protection for symmetric encryption. +Note: not all OpenPGP implementations are compatible with this option. +FUTURE OPENPGP.JS VERSIONS MAY BREAK COMPATIBILITY WHEN USING THIS OPTION

+
+ + + + + + + +
Properties:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
aeadProtect + + +Boolean + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + +
See:
+
+ +
+ + + +
+ + + + + + + + +

(static) allowInsecureDecryptionWithSigningKeys

+ + + + +
+

Allow decryption using RSA keys without encrypt flag. +This setting is potentially insecure, but it is needed to get around an old openpgpjs bug +where key flags were ignored when selecting a key for encryption.

+
+ + + + + + + +
Properties:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
allowInsecureDecryptionWithSigningKeys + + +Boolean + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

(static) allowUnauthenticatedStream

+ + + + + + + + + + +
Properties:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
allowUnauthenticatedStream + + +Boolean + + + +

Stream unauthenticated data before integrity has been checked

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

(static) checksumRequired

+ + + + + + + + + + +
Properties:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
checksumRequired + + +Boolean + + + +

Do not throw error when armor is missing a checksum

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

(static) commentString

+ + + + + + + + + + +
Properties:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
commentString + + +String + + + +

A comment string to be included in armored messages

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

(static) compression

+ + + + + + + + + + +
Properties:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
compression + + +Integer + + + +

Default compression algorithm module:enums.compression

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

(static) deflateLevel

+ + + + + + + + + + +
Properties:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
deflateLevel + + +Integer + + + +

Default zip/zlib compression level, between 1 and 9

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

(static) encryptionCipher

+ + + + + + + + + + +
Properties:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
encryptionCipher + + +Integer + + + +

Default encryption cipher module:enums.symmetric

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

(static) ignoreMdcError

+ + + + + + + + + + +
Properties:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
ignoreMdcError + + +Boolean + + + +

Fail on decrypt if message is not integrity protected

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

(static) integrityProtect

+ + + + +
+

Use integrity protection for symmetric encryption

+
+ + + + + + + +
Properties:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
integrityProtect + + +Boolean + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

(static) keyserver

+ + + + + + + + + + +
Properties:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
keyserver + + +String + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

(static) knownNotations

+ + + + +
+

Contains notatations that are considered "known". Known notations do not trigger +validation error when the notation is marked as critical.

+
+ + + + + + + +
Properties:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
knownNotations + + +Array + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

(static) maxUseridLength

+ + + + +
+

Max userid string length (used for parsing)

+
+ + + + + + + +
Properties:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
maxUseridLength + + +Integer + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

(static) minBytesForWebCrypto

+ + + + + + + + + + +
Properties:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
minBytesForWebCrypto + + +Integer + + + +

The minimum amount of bytes for which to use native WebCrypto APIs when available

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

(static) minRsaBits

+ + + + + + + + + + +
Properties:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
minRsaBits + + +Number + + + +

Minimum RSA key size allowed for key generation

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

(static) nodeStore

+ + + + + + + + + + +
Properties:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
nodeStore + + +String + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

(static) passwordCollisionCheck

+ + + + +
+

Work-around for rare GPG decryption bug when encrypting with multiple passwords. +Slower and slightly less secure

+
+ + + + + + + +
Properties:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
passwordCollisionCheck + + +Boolean + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

(static) preferHashAlgorithm

+ + + + + + + + + + +
Properties:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
preferHashAlgorithm + + +Integer + + + +

Default hash algorithm module:enums.hash

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

(static) rejectHashAlgorithms

+ + + + + + + + + + +
Properties:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
reject_hash_algorithms + + +Set.<Integer> + + + +

Reject insecure hash algorithms module:enums.hash

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

(static) rejectMessageHashAlgorithms

+ + + + + + + + + + +
Properties:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
reject_message_hash_algorithms + + +Set.<Integer> + + + +

Reject insecure message hash algorithms module:enums.hash

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

(static) revocationsExpire

+ + + + + + + + + + +
Properties:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
revocationsExpire + + +Boolean + + + +

If true, expired revocation signatures are ignored

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

(static) s2kIterationCountByte

+ + + + +
+

RFC4880 3.7.1.3: +Iteration Count Byte for S2K (String to Key)

+
+ + + + + + + +
Properties:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
s2kIterationCountByte + + +Integer + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

(static) showComment

+ + + + + + + + + + +
Properties:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
showComment + + +Boolean + + + +

Whether to include module:config/config.commentString in armored messages

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

(static) showVersion

+ + + + + + + + + + +
Properties:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
showVersion + + +Boolean + + + +

Whether to include module:config/config.versionString in armored messages

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

(static) tolerant

+ + + + + + + + + + +
Properties:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
tolerant + + +Boolean + + + +

Ignore unsupported/unrecognizable packets instead of throwing an error

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

(static) useIndutnyElliptic

+ + + + + + + + + + +
Properties:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
useIndutnyElliptic + + +Boolean + + + +

Whether to use the indutny/elliptic library. When false, certain curves will not be supported.

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

(static) v5Keys

+ + + + +
+

Use V5 keys. +Note: not all OpenPGP implementations are compatible with this option. +FUTURE OPENPGP.JS VERSIONS MAY BREAK COMPATIBILITY WHEN USING THIS OPTION

+
+ + + + + + + +
Properties:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
v5Keys + + +Boolean + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

(static) versionString

+ + + + + + + + + + +
Properties:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
versionString + + +String + + + +

A version string to be included in armored messages

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ + + + + + + \ No newline at end of file diff --git a/docs/module-crypto_random-RandomBuffer.html b/docs/module-crypto_random-RandomBuffer.html new file mode 100644 index 00000000..0dd7c6d4 --- /dev/null +++ b/docs/module-crypto_random-RandomBuffer.html @@ -0,0 +1,593 @@ + + + + + JSDoc: Class: RandomBuffer + + + + + + + + + + +
+ +

Class: RandomBuffer

+ + + + + + +
+ +
+ +

RandomBuffer()

+ +

Buffer for secure random numbers

+ + +
+ +
+
+ + + + +

Constructor

+ + + +

new RandomBuffer()

+ + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + +

Methods

+ + + + + + + +

(async) get(buf)

+ + + + + + +
+

Take numbers out of buffer and copy to array

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
buf + + +Uint8Array + + + +

the destination array

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

init(size)

+ + + + + + +
+

Initialize buffer

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
size + + +Integer + + + +

size of buffer

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

set(buf)

+ + + + + + +
+

Concat array of secure random numbers to buffer

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
buf + + +Uint8Array + + + +
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ + + + + + + \ No newline at end of file diff --git a/docs/module-enums.html b/docs/module-enums.html new file mode 100644 index 00000000..2674fc21 --- /dev/null +++ b/docs/module-enums.html @@ -0,0 +1,6005 @@ + + + + + JSDoc: Module: enums + + + + + + + + + + +
+ +

Module: enums

+ + + + + + +
+ +
+ + + +
+ +
+
+ + + + + +
+ + + + + + + + + + + + + + +

Members

+ + + +

(static, readonly) aead :Integer

+ + + + + + + + +
Type:
+
    +
  • + +Integer + + +
  • +
+ + + + + +
Properties:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
eax + + +Integer + + + +
ocb + + +Integer + + + +
experimentalGcm + + +Integer + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

(static, readonly) armor :Integer

+ + + + +
+

Armor type

+
+ + + +
Type:
+
    +
  • + +Integer + + +
  • +
+ + + + + +
Properties:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
multipartSection + + +Integer + + + +
multipartLast + + +Integer + + + +
signed + + +Integer + + + +
message + + +Integer + + + +
publicKey + + +Integer + + + +
privateKey + + +Integer + + + +
signature + + +Integer + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

(static, readonly) compression :Integer

+ + + + + + + + +
Type:
+
    +
  • + +Integer + + +
  • +
+ + + + + +
Properties:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
uncompressed + + +Integer + + + +
zip + + +Integer + + + +

RFC1951

zlib + + +Integer + + + +

RFC1950

bzip2 + + +Integer + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

(static, readonly) curve :String

+ + + + +
+

Maps curve names under various standards to one

+
+ + + +
Type:
+
    +
  • + +String + + +
  • +
+ + + + + +
Properties:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
p256 + + +String + + + +

NIST P-256 Curve

"P-256" + + +String + + + +
secp256r1 + + +String + + + +
prime256v1 + + +String + + + +
"1.2.840.10045.3.1.7" + + +String + + + +
2a8648ce3d030107 + + +String + + + +
2A8648CE3D030107 + + +String + + + +
p384 + + +String + + + +

NIST P-384 Curve

"P-384" + + +String + + + +
secp384r1 + + +String + + + +
"1.3.132.0.34" + + +String + + + +
2b81040022 + + +String + + + +
2B81040022 + + +String + + + +
p521 + + +String + + + +

NIST P-521 Curve

"P-521" + + +String + + + +
secp521r1 + + +String + + + +
"1.3.132.0.35" + + +String + + + +
2b81040023 + + +String + + + +
2B81040023 + + +String + + + +
secp256k1 + + +String + + + +

SECG SECP256k1 Curve

"1.3.132.0.10" + + +String + + + +
2b8104000a + + +String + + + +
2B8104000A + + +String + + + +
ED25519 + + +String + + + +

Ed25519

ed25519 + + +String + + + +
Ed25519 + + +String + + + +
"1.3.6.1.4.1.11591.15.1" + + +String + + + +
2b06010401da470f01 + + +String + + + +
2B06010401DA470F01 + + +String + + + +
X25519 + + +String + + + +

Curve25519

cv25519 + + +String + + + +
curve25519 + + +String + + + +
Curve25519 + + +String + + + +
"1.3.6.1.4.1.3029.1.5.1" + + +String + + + +
2b060104019755010501 + + +String + + + +
2B060104019755010501 + + +String + + + +
brainpoolP256r1 + + +String + + + +

BrainpoolP256r1 Curve

"1.3.36.3.3.2.8.1.1.7" + + +String + + + +
2b2403030208010107 + + +String + + + +
2B2403030208010107 + + +String + + + +
brainpoolP384r1 + + +String + + + +

BrainpoolP384r1 Curve

"1.3.36.3.3.2.8.1.1.11" + + +String + + + +
2b240303020801010b + + +String + + + +
2B240303020801010B + + +String + + + +
brainpoolP512r1 + + +String + + + +

BrainpoolP512r1 Curve

"1.3.36.3.3.2.8.1.1.13" + + +String + + + +
2b240303020801010d + + +String + + + +
2B240303020801010D + + +String + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + +
See:
+
+ +
+ + + +
+ + + + + + + + +

(static, readonly) features :Integer

+ + + + + + + + +
Type:
+
    +
  • + +Integer + + +
  • +
+ + + + + +
Properties:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
modificationDetection + + +Integer + + + +

0x01 - Modification Detection (packets 18 and 19)

aead + + +Integer + + + +

0x02 - AEAD Encrypted Data Packet (packet 20) and version 5 +Symmetric-Key Encrypted Session Key Packets (packet 3)

v5Keys + + +Integer + + + +

0x04 - Version 5 Public-Key Packet format and corresponding new +fingerprint format

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

(static, readonly) hash :Integer

+ + + + + + + + +
Type:
+
    +
  • + +Integer + + +
  • +
+ + + + + +
Properties:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
md5 + + +Integer + + + +
sha1 + + +Integer + + + +
ripemd + + +Integer + + + +
sha256 + + +Integer + + + +
sha384 + + +Integer + + + +
sha512 + + +Integer + + + +
sha224 + + +Integer + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

(static, readonly) keyFlags :Integer

+ + + + +
+

Key flags

+
+ + + +
Type:
+
    +
  • + +Integer + + +
  • +
+ + + + + +
Properties:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
certifyKeys + + +Integer + + + +

0x01 - This key may be used to certify other keys.

signData + + +Integer + + + +

0x02 - This key may be used to sign data.

encryptCommunication + + +Integer + + + +

0x04 - This key may be used to encrypt communications.

encryptStorage + + +Integer + + + +

0x08 - This key may be used to encrypt storage.

splitPrivateKey + + +Integer + + + +

0x10 - The private component of this key may have been split +by a secret-sharing mechanism.

authentication + + +Integer + + + +

0x20 - This key may be used for authentication.

sharedPrivateKey + + +Integer + + + +

0x80 - The private component of this key may be in the +possession of more than one person.

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

(static, readonly) literal :Integer

+ + + + +
+

Data types in the literal packet

+
+ + + +
Type:
+
    +
  • + +Integer + + +
  • +
+ + + + + +
Properties:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
binary + + +Integer + + + +

Binary data 'b'

text + + +Integer + + + +

Text data 't'

utf8 + + +Integer + + + +

Utf8 data 'u'

mime + + +Integer + + + +

MIME message body part 'm'

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

(static, readonly) packet :Integer

+ + + + +
+

A list of packet types and numeric tags associated with them.

+
+ + + +
Type:
+
    +
  • + +Integer + + +
  • +
+ + + + + +
Properties:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
publicKeyEncryptedSessionKey + + +Integer + + + +
signature + + +Integer + + + +
symEncryptedSessionKey + + +Integer + + + +
onePassSignature + + +Integer + + + +
secretKey + + +Integer + + + +
publicKey + + +Integer + + + +
secretSubkey + + +Integer + + + +
compressedData + + +Integer + + + +
symmetricallyEncryptedData + + +Integer + + + +
marker + + +Integer + + + +
literalData + + +Integer + + + +
trust + + +Integer + + + +
userID + + +Integer + + + +
publicSubkey + + +Integer + + + +
userAttribute + + +Integer + + + +
symEncryptedIntegrityProtectedData + + +Integer + + + +
modificationDetectionCode + + +Integer + + + +
AEADEncryptedData + + +Integer + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

(static, readonly) publicKey :Integer

+ + + + + + + + +
Type:
+
    +
  • + +Integer + + +
  • +
+ + + + + +
Properties:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
rsaEncryptSign + + +Integer + + + +

RSA (Encrypt or Sign) [HAC]

rsaEncrypt + + +Integer + + + +

RSA (Encrypt only) [HAC]

rsaSign + + +Integer + + + +

RSA (Sign only) [HAC]

elgamal + + +Integer + + + +

Elgamal (Encrypt only) [ELGAMAL] [HAC]

dsa + + +Integer + + + +

DSA (Sign only) [FIPS186] [HAC]

ecdh + + +Integer + + + +

ECDH (Encrypt only) [RFC6637]

ecdsa + + +Integer + + + +

ECDSA (Sign only) [RFC6637]

eddsa + + +Integer + + + +

EdDSA (Sign only) +[Draft RFC]

aedh + + +Integer + + + +

Reserved for AEDH

aedsa + + +Integer + + + +

Reserved for AEDSA

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

(static, readonly) reasonForRevocation :Integer

+ + + + + + + + +
Type:
+
    +
  • + +Integer + + +
  • +
+ + + + + +
Properties:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
noReason + + +Integer + + + +

No reason specified (key revocations or cert revocations)

keySuperseded + + +Integer + + + +

Key is superseded (key revocations)

keyCompromised + + +Integer + + + +

Key material has been compromised (key revocations)

keyRetired + + +Integer + + + +

Key is retired and no longer used (key revocations)

userIdInvalid + + +Integer + + + +

User ID information is no longer valid (cert revocations)

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

(static, readonly) s2k :Integer

+ + + + +
+

A string to key specifier type

+
+ + + +
Type:
+
    +
  • + +Integer + + +
  • +
+ + + + + +
Properties:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
simple + + +Integer + + + +
salted + + +Integer + + + +
iterated + + +Integer + + + +
gnu + + +Integer + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

(static, readonly) signature :Integer

+ + + + +
+

One pass signature packet type

+
+ + + +
Type:
+
    +
  • + +Integer + + +
  • +
+ + + + + +
Properties:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
binary + + +Integer + + + +

0x00: Signature of a binary document.

text + + +Integer + + + +

0x01: Signature of a canonical text document.

+

Canonicalyzing the document by converting line endings.

standalone + + +Integer + + + +

0x02: Standalone signature.

+

This signature is a signature of only its own subpacket contents. +It is calculated identically to a signature over a zero-lengh +binary document. Note that it doesn't make sense to have a V3 +standalone signature.

certGeneric + + +Integer + + + +

0x10: Generic certification of a User ID and Public-Key packet.

+

The issuer of this certification does not make any particular +assertion as to how well the certifier has checked that the owner +of the key is in fact the person described by the User ID.

certPersona + + +Integer + + + +

0x11: Persona certification of a User ID and Public-Key packet.

+

The issuer of this certification has not done any verification of +the claim that the owner of this key is the User ID specified.

certCasual + + +Integer + + + +

0x12: Casual certification of a User ID and Public-Key packet.

+

The issuer of this certification has done some casual +verification of the claim of identity.

certPositive + + +Integer + + + +

0x13: Positive certification of a User ID and Public-Key packet.

+

The issuer of this certification has done substantial +verification of the claim of identity.

+

Most OpenPGP implementations make their "key signatures" as 0x10 +certifications. Some implementations can issue 0x11-0x13 +certifications, but few differentiate between the types.

certRevocation + + +Integer + + + +

0x30: Certification revocation signature

+

This signature revokes an earlier User ID certification signature +(signature class 0x10 through 0x13) or direct-key signature +(0x1F). It should be issued by the same key that issued the +revoked signature or an authorized revocation key. The signature +is computed over the same data as the certificate that it +revokes, and should have a later creation date than that +certificate.

subkeyBinding + + +Integer + + + +

0x18: Subkey Binding Signature

+

This signature is a statement by the top-level signing key that +indicates that it owns the subkey. This signature is calculated +directly on the primary key and subkey, and not on any User ID or +other packets. A signature that binds a signing subkey MUST have +an Embedded Signature subpacket in this binding signature that +contains a 0x19 signature made by the signing subkey on the +primary key and subkey.

keyBinding + + +Integer + + + +

0x19: Primary Key Binding Signature

+

This signature is a statement by a signing subkey, indicating +that it is owned by the primary key and subkey. This signature +is calculated the same way as a 0x18 signature: directly on the +primary key and subkey, and not on any User ID or other packets.

+

When a signature is made over a key, the hash data starts with the +octet 0x99, followed by a two-octet length of the key, and then body +of the key packet. (Note that this is an old-style packet header for +a key packet with two-octet length.) A subkey binding signature +(type 0x18) or primary key binding signature (type 0x19) then hashes +the subkey using the same format as the main key (also using 0x99 as +the first octet).

key + + +Integer + + + +

0x1F: Signature directly on a key

+

This signature is calculated directly on a key. It binds the +information in the Signature subpackets to the key, and is +appropriate to be used for subpackets that provide information +about the key, such as the Revocation Key subpacket. It is also +appropriate for statements that non-self certifiers want to make +about the key itself, rather than the binding between a key and a +name.

keyRevocation + + +Integer + + + +

0x20: Key revocation signature

+

The signature is calculated directly on the key being revoked. A +revoked key is not to be used. Only revocation signatures by the +key being revoked, or by an authorized revocation key, should be +considered valid revocation signatures.a

subkeyRevocation + + +Integer + + + +

0x28: Subkey revocation signature

+

The signature is calculated directly on the subkey being revoked. +A revoked subkey is not to be used. Only revocation signatures +by the top-level signature key that is bound to this subkey, or +by an authorized revocation key, should be considered valid +revocation signatures.

+

Key revocation signatures (types 0x20 and 0x28) +hash only the key being revoked.

timestamp + + +Integer + + + +

0x40: Timestamp signature. +This signature is only meaningful for the timestamp contained in +it.

thirdParty + + +Integer + + + +

0x50: Third-Party Confirmation signature.

+

This signature is a signature over some other OpenPGP Signature +packet(s). It is analogous to a notary seal on the signed data. +A third-party signature SHOULD include Signature Target +subpacket(s) to give easy identification. Note that we really do +mean SHOULD. There are plausible uses for this (such as a blind +party that only sees the signature, not the key or source +document) that cannot include a target subpacket.

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

(static, readonly) signatureSubpacket :Integer

+ + + + +
+

Signature subpacket type

+
+ + + +
Type:
+
    +
  • + +Integer + + +
  • +
+ + + + + +
Properties:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
signatureCreationTime + + +Integer + + + +
signatureExpirationTime + + +Integer + + + +
exportableCertification + + +Integer + + + +
trustSignature + + +Integer + + + +
regularExpression + + +Integer + + + +
revocable + + +Integer + + + +
keyExpirationTime + + +Integer + + + +
placeholderBackwardsCompatibility + + +Integer + + + +
preferredSymmetricAlgorithms + + +Integer + + + +
revocationKey + + +Integer + + + +
issuer + + +Integer + + + +
notationData + + +Integer + + + +
preferredHashAlgorithms + + +Integer + + + +
preferredCompressionAlgorithms + + +Integer + + + +
keyServerPreferences + + +Integer + + + +
preferredKeyServer + + +Integer + + + +
primaryUserId + + +Integer + + + +
policyUri + + +Integer + + + +
keyFlags + + +Integer + + + +
signersUserId + + +Integer + + + +
reasonForRevocation + + +Integer + + + +
features + + +Integer + + + +
signatureTarget + + +Integer + + + +
embeddedSignature + + +Integer + + + +
issuerFingerprint + + +Integer + + + +
preferredAeadAlgorithms + + +Integer + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

(static, readonly) symmetric :Integer

+ + + + + + + + +
Type:
+
    +
  • + +Integer + + +
  • +
+ + + + + +
Properties:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
plaintext + + +Integer + + + +
idea + + +Integer + + + +

Not implemented!

tripledes + + +Integer + + + +
cast5 + + +Integer + + + +
blowfish + + +Integer + + + +
aes128 + + +Integer + + + +
aes192 + + +Integer + + + +
aes256 + + +Integer + + + +
twofish + + +Integer + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

(static) webHash :String

+ + + + +
+

A list of hash names as accepted by webCrypto functions. +Parameters, algo

+
+ + + +
Type:
+
    +
  • + +String + + +
  • +
+ + + + + +
Properties:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
"SHA-1" + + +String + + + +
"SHA-256" + + +String + + + +
"SHA-384" + + +String + + + +
"SHA-512" + + +String + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + +

Methods

+ + + + + + + +

(static) read()

+ + + + + + +
+

Converts from an integer to string.

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

(static) write()

+ + + + + + +
+

Asserts validity and converts from string/integer to integer.

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ + + + + + + \ No newline at end of file diff --git a/docs/module-key_SubKey-SubKey.html b/docs/module-key_SubKey-SubKey.html new file mode 100644 index 00000000..94b7f311 --- /dev/null +++ b/docs/module-key_SubKey-SubKey.html @@ -0,0 +1,2905 @@ + + + + + JSDoc: Class: SubKey + + + + + + + + + + +
+ +

Class: SubKey

+ + + + + + +
+ +
+ +

SubKey()

+ +

Class that represents a subkey packet and the relevant signatures.

+ + +
+ +
+
+ + + + +

Constructor

+ + + +

new SubKey()

+ + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + +

Methods

+ + + + + + + +

getAlgorithmInfo() → {Object}

+ + + + + + +
+

Returns algorithm information

+
+ + + + + + + + + + + + + +
+ + + + + + + + +
Overrides:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

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

+
+ + + +
+
+ Type +
+
+ +Object + + +
+
+ + + + + + + + + + + + + +

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 + + +
+
+ + + + + + + + + + + + + +

getCreationTime() → {Date}

+ + + + + + +
+

Returns the creation time of the key

+
+ + + + + + + + + + + + + +
+ + + + + + + + +
Overrides:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +Date + + +
+
+ + + + + + + + + + + + + +

(async) getExpirationTime(primaryKey, date, config) → {Promise.<(Date|Infinity|null)>}

+ + + + + + +
+

Returns the expiration time of the subkey or Infinity if key does not expire +Returns null if the subkey is invalid.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
primaryKey + + +SecretKeyPacket +| + +PublicKeyPacket + + + +

The primary key packet

date + + +Date + + + +

Use the given date instead of the current time

config + + +Object + + + +

(optional) full configuration, defaults to openpgp.config

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +Promise.<(Date|Infinity|null)> + + +
+
+ + + + + + + + + + + + + +

getFingerprint() → {String}

+ + + + + + +
+

Calculates the fingerprint of the key

+
+ + + + + + + + + + + + + +
+ + + + + + + + +
Overrides:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

A string containing the fingerprint in lowercase hex

+
+ + + +
+
+ Type +
+
+ +String + + +
+
+ + + + + + + + + + + + + +

getFingerprint() → {String}

+ + + + + + +
+

Calculates the fingerprint of the key

+
+ + + + + + + + + + + + + +
+ + + + + + + + +
Overrides:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

A string containing the fingerprint in lowercase hex

+
+ + + +
+
+ Type +
+
+ +String + + +
+
+ + + + + + + + + + + + + +

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 + + +
+
+ + + + + + + + + + + + + +

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 + + +
+
+ + + + + + + + + + + + + +

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 + + +
+
+ + + + + + + + + + + + + +

isDecrypted() → {Boolean|null}

+ + + + + + +
+

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

+
+ + + + + + + + + + + + + +
+ + + + + + + + +
Overrides:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +Boolean +| + +null + + +
+
+ + + + + + + + + + + + + +

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

+ + + + + + +
+

Checks if a binding signature of a subkey is revoked

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
primaryKey + + +SecretKeyPacket +| + +PublicKeyPacket + + + +

The primary key packet

signature + + +SignaturePacket + + + +

The binding signature to verify

key, + + +PublicSubkeyPacket +| + +SecretSubkeyPacket +| + +PublicKeyPacket +| + +SecretKeyPacket + + + +

optional The key to verify the signature

date + + +Date + + + +

Use the given date instead of the current time

config + + +Object + + + +

(optional) full configuration, defaults to openpgp.config

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

True if the binding signature is revoked

+
+ + + +
+
+ Type +
+
+ +Promise.<Boolean> + + +
+
+ + + + + + + + + + + + + +

(async) revoke(primaryKey, reasonForRevocation, date, config) → {Promise.<SubKey>}

+ + + + + + +
+

Revokes the subkey

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
primaryKey + + +SecretKeyPacket + + + +

decrypted private primary key for revocation

reasonForRevocation + + +Object + + + +

optional, object indicating the reason for revocation

+
Properties
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
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

config + + +Object + + + +

(optional) full configuration, defaults to openpgp.config

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

new subkey with revocation signature

+
+ + + +
+
+ Type +
+
+ +Promise.<SubKey> + + +
+
+ + + + + + + + + + + + + +

toPacketlist() → {PacketList}

+ + + + + + +
+

Transforms structured subkey data to packetlist

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +PacketList + + +
+
+ + + + + + + + + + + + + +

(async) update(subKey, primaryKey, config)

+ + + + + + +
+

Update subkey with new components from specified subkey

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
subKey + + +SubKey + + + +

Source subkey to merge

primaryKey + + +SecretKeyPacket +| + +SecretSubkeyPacket + + + +

primary key used for validation

config + + +Object + + + +

(optional) full configuration, defaults to openpgp.config

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Throws:
+ + + +
+
+
+

if update failed

+
+
+
+
+
+
+ Type +
+
+ +Error + + +
+
+
+
+
+ + + + + + + + + + + + + + + + +

(async) verify(primaryKey, date, config) → {Promise.<SignaturePacket>}

+ + + + + + +
+

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

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
primaryKey + + +SecretKeyPacket +| + +PublicKeyPacket + + + +

The primary key packet

date + + +Date + + + +

Use the given date instead of the current time

config + + +Object + + + +

(optional) full configuration, defaults to openpgp.config

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Throws:
+ + + +
+
+
+

if the subkey is invalid.

+
+
+
+
+
+
+ Type +
+
+ +Error + + +
+
+
+
+
+ + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +Promise.<SignaturePacket> + + +
+
+ + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ + + + + + + \ No newline at end of file diff --git a/docs/module-key_User-User.html b/docs/module-key_User-User.html new file mode 100644 index 00000000..bcd1ea7b --- /dev/null +++ b/docs/module-key_User-User.html @@ -0,0 +1,1694 @@ + + + + + JSDoc: Class: User + + + + + + + + + + +
+ +

Class: User

+ + + + + + +
+ +
+ +

User()

+ +

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

+ + +
+ +
+
+ + + + +

Constructor

+ + + +

new User()

+ + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + +

Methods

+ + + + + + + +

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

+ + + + + + +
+

Checks if a given certificate of the user is revoked

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
primaryKey + + +SecretKeyPacket +| + +PublicKeyPacket + + + +

The primary key packet

certificate + + +SignaturePacket + + + +

The certificate to verify

key, + + +PublicSubkeyPacket +| + +SecretSubkeyPacket +| + +PublicKeyPacket +| + +SecretKeyPacket + + + +

optional The key to verify the signature

date + + +Date + + + +

Use the given date instead of the current time

config + + +Object + + + +

Full configuration

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

True if the certificate is revoked

+
+ + + +
+
+ Type +
+
+ +Promise.<Boolean> + + +
+
+ + + + + + + + + + + + + +

(async) sign(primaryKey, privateKeys, config) → {Promise.<Key>}

+ + + + + + +
+

Signs user

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
primaryKey + + +SecretKeyPacket +| + +PublicKeyPacket + + + +

The primary key packet

privateKeys + + +Array.<Key> + + + +

Decrypted private keys for signing

config + + +Object + + + +

Full configuration

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

New user with new certificate signatures

+
+ + + +
+
+ Type +
+
+ +Promise.<Key> + + +
+
+ + + + + + + + + + + + + +

toPacketlist() → {PacketList}

+ + + + + + +
+

Transforms structured user data to packetlist

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +PacketList + + +
+
+ + + + + + + + + + + + + +

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

+ + + + + + +
+

Update user with new components from specified user

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
user + + +User + + + +

Source user to merge

primaryKey + + +SecretKeyPacket +| + +SecretSubkeyPacket + + + +

primary key used for validation

config + + +Object + + + +

Full configuration

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +Promise.<undefined> + + +
+
+ + + + + + + + + + + + + +

(async) verify(primaryKey, date, config) → {Promise.<true>}

+ + + + + + +
+

Verify User. Checks for existence of self signatures, revocation signatures +and validity of self signature.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
primaryKey + + +SecretKeyPacket +| + +PublicKeyPacket + + + +

The primary key packet

date + + +Date + + + +

Use the given date instead of the current time

config + + +Object + + + +

Full configuration

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Throws:
+ + + +
+
+
+

if there are no valid self signatures.

+
+
+
+
+
+
+ Type +
+
+ +Error + + +
+
+
+
+
+ + + + + +
Returns:
+ + +
+

Status of user

+
+ + + +
+
+ Type +
+
+ +Promise.<true> + + +
+
+ + + + + + + + + + + + + +

(async) verifyAllCertifications(primaryKey, keys, date, config) → {Promise.<Array.<{keyid: module:type/keyid~Keyid, valid: Boolean}>>}

+ + + + + + +
+

Verifies all user certificates

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
primaryKey + + +SecretKeyPacket +| + +PublicKeyPacket + + + +

The primary key packet

keys + + +Array.<Key> + + + +

Array of keys to verify certificate signatures

date + + +Date + + + +

Use the given date instead of the current time

config + + +Object + + + +

Full configuration

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

List of signer's keyid and validity of signature

+
+ + + +
+
+ Type +
+
+ +Promise.<Array.<{keyid: module:type/keyid~Keyid, valid: Boolean}>> + + +
+
+ + + + + + + + + + + + + +

(async) verifyCertificate(primaryKey, certificate, keys, date, config) → {Promise.<(true|null)>}

+ + + + + + +
+

Verifies the user certificate. Throws if the user certificate is invalid.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
primaryKey + + +SecretKeyPacket +| + +PublicKeyPacket + + + +

The primary key packet

certificate + + +SignaturePacket + + + +

A certificate of this user

keys + + +Array.<Key> + + + +

Array of keys to verify certificate signatures

date + + +Date + + + +

Use the given date instead of the current time

config + + +Object + + + +

Full configuration

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

status of the certificate

+
+ + + +
+
+ Type +
+
+ +Promise.<(true|null)> + + +
+
+ + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ + + + + + + \ No newline at end of file diff --git a/docs/module-type_kdf_params-KDFParams.html b/docs/module-type_kdf_params-KDFParams.html new file mode 100644 index 00000000..9bba53e3 --- /dev/null +++ b/docs/module-type_kdf_params-KDFParams.html @@ -0,0 +1,517 @@ + + + + + JSDoc: Class: KDFParams + + + + + + + + + + +
+ +

Class: KDFParams

+ + + + + + +
+ +
+ +

KDFParams(hash, cipher)

+ + +
+ +
+
+ + + + + + +

new KDFParams(hash, cipher)

+ + + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
hash + + +enums.hash + + + +

Hash algorithm

cipher + + +enums.symmetric + + + +

Symmetric algorithm

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + +

Methods

+ + + + + + + +

read(input) → {Number}

+ + + + + + +
+

Read KDFParams from an Uint8Array

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
input + + +Uint8Array + + + +

Where to read the KDFParams from

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

Number of read bytes

+
+ + + +
+
+ Type +
+
+ +Number + + +
+
+ + + + + + + + + + + + + +

write() → {Uint8Array}

+ + + + + + +
+

Write KDFParams to an Uint8Array

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

Array with the KDFParams value

+
+ + + +
+
+ Type +
+
+ +Uint8Array + + +
+
+ + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ + + + + + + \ No newline at end of file diff --git a/docs/module-type_keyid-Keyid.html b/docs/module-type_keyid-Keyid.html new file mode 100644 index 00000000..fc60d83b --- /dev/null +++ b/docs/module-type_keyid-Keyid.html @@ -0,0 +1,942 @@ + + + + + JSDoc: Class: Keyid + + + + + + + + + + +
+ +

Class: Keyid

+ + + + + + +
+ +
+ +

Keyid()

+ +

Implementation of type key id

+

RFC4880 3.3: +A Key ID is an eight-octet scalar that identifies a key. +Implementations SHOULD NOT assume that Key IDs are unique. The +section "Enhanced Key Formats" below describes how Key IDs are +formed.

+ + +
+ +
+
+ + + + +

Constructor

+ + + +

new Keyid()

+ + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + +

Methods

+ + + + + + + +

equals(keyid, matchWildcard)

+ + + + + + +
+

Checks equality of Key ID's

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDefaultDescription
keyid + + +Keyid + + + + + +
matchWildcard + + +Boolean + + + + + + false + +

Indicates whether to check if either keyid is a wildcard

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

isNull() → {Boolean}

+ + + + + + +
+

Checks to see if the Key ID is unset

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

true if the Key ID is null

+
+ + + +
+
+ Type +
+
+ +Boolean + + +
+
+ + + + + + + + + + + + + +

isWildcard() → {Boolean}

+ + + + + + +
+

Checks to see if the Key ID is a "wildcard" Key ID (all zeros)

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

true if this is a wildcard Key ID

+
+ + + +
+
+ Type +
+
+ +Boolean + + +
+
+ + + + + + + + + + + + + +

read(bytes)

+ + + + + + +
+

Parsing method for a key id

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
bytes + + +Uint8Array + + + +

Input to read the key id from

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

toHex() → {String}

+ + + + + + +
+

Returns the Key ID represented as a hexadecimal string

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

Key ID as a hexadecimal string

+
+ + + +
+
+ Type +
+
+ +String + + +
+
+ + + + + + + + + + + + + +

write() → {Uint8Array}

+ + + + + + +
+

Serializes the Key ID

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

Key ID as a Uint8Array

+
+ + + +
+
+ Type +
+
+ +Uint8Array + + +
+
+ + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ + + + + + + \ No newline at end of file diff --git a/docs/module-type_s2k-S2K.html b/docs/module-type_s2k-S2K.html new file mode 100644 index 00000000..6feccd4a --- /dev/null +++ b/docs/module-type_s2k-S2K.html @@ -0,0 +1,945 @@ + + + + + JSDoc: Class: S2K + + + + + + + + + + +
+ +

Class: S2K

+ + + + + + +
+ +
+ +

S2K(config)

+ + +
+ +
+
+ + + + + + +

new S2K(config)

+ + + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
config + + +Object + + + +

(optional) full configuration, defaults to openpgp.config

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + +

Members

+ + + +

algorithm :module:enums.hash

+ + + + + + +
Type:
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

c :Integer

+ + + + + + +
Type:
+
    +
  • + +Integer + + +
  • +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

salt :String

+ + + + +
+

Eight bytes of salt in a binary string.

+
+ + + +
Type:
+
    +
  • + +String + + +
  • +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

type :module:enums.s2k

+ + + + + + +
Type:
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + +

Methods

+ + + + + + + +

(async) produce_key(passphrase) → {Uint8Array}

+ + + + + + +
+

Produces a key using the specified passphrase and the defined +hashAlgorithm

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
passphrase + + +String + + + +

Passphrase containing user input

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

Produced key with a length corresponding to +hashAlgorithm hash length

+
+ + + +
+
+ Type +
+
+ +Uint8Array + + +
+
+ + + + + + + + + + + + + +

read(bytes) → {Integer}

+ + + + + + +
+

Parsing function for a string-to-key specifier (RFC 4880 3.7).

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
bytes + + +String + + + +

Payload of string-to-key specifier

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

Actual length of the object

+
+ + + +
+
+ Type +
+
+ +Integer + + +
+
+ + + + + + + + + + + + + +

write() → {Uint8Array}

+ + + + + + +
+

Serializes s2k information

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

binary representation of s2k

+
+ + + +
+
+ Type +
+
+ +Uint8Array + + +
+
+ + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ + + + + + + \ No newline at end of file diff --git a/docs/scripts/linenumber.js b/docs/scripts/linenumber.js new file mode 100644 index 00000000..4354785c --- /dev/null +++ b/docs/scripts/linenumber.js @@ -0,0 +1,25 @@ +/*global document */ +(() => { + const source = document.getElementsByClassName('prettyprint source linenums'); + let i = 0; + let lineNumber = 0; + let lineId; + let lines; + let totalLines; + let anchorHash; + + if (source && source[0]) { + anchorHash = document.location.hash.substring(1); + lines = source[0].getElementsByTagName('li'); + totalLines = lines.length; + + for (; i < totalLines; i++) { + lineNumber++; + lineId = `line${lineNumber}`; + lines[i].id = lineId; + if (lineId === anchorHash) { + lines[i].className += ' selected'; + } + } + } +})(); diff --git a/docs/scripts/prettify/Apache-License-2.0.txt b/docs/scripts/prettify/Apache-License-2.0.txt new file mode 100644 index 00000000..d6456956 --- /dev/null +++ b/docs/scripts/prettify/Apache-License-2.0.txt @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/docs/scripts/prettify/lang-css.js b/docs/scripts/prettify/lang-css.js new file mode 100644 index 00000000..041e1f59 --- /dev/null +++ b/docs/scripts/prettify/lang-css.js @@ -0,0 +1,2 @@ +PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\f\r ]+/,null," \t\r\n "]],[["str",/^"(?:[^\n\f\r"\\]|\\(?:\r\n?|\n|\f)|\\[\S\s])*"/,null],["str",/^'(?:[^\n\f\r'\\]|\\(?:\r\n?|\n|\f)|\\[\S\s])*'/,null],["lang-css-str",/^url\(([^"')]*)\)/i],["kwd",/^(?:url|rgb|!important|@import|@page|@media|@charset|inherit)(?=[^\w-]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|\\[\da-f]+ ?)(?:[\w-]|\\\\[\da-f]+ ?)*)\s*:/i],["com",/^\/\*[^*]*\*+(?:[^*/][^*]*\*+)*\//],["com", +/^(?:<\!--|--\>)/],["lit",/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],["lit",/^#[\da-f]{3,6}/i],["pln",/^-?(?:[_a-z]|\\[\da-f]+ ?)(?:[\w-]|\\\\[\da-f]+ ?)*/i],["pun",/^[^\s\w"']+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[["kwd",/^-?(?:[_a-z]|\\[\da-f]+ ?)(?:[\w-]|\\\\[\da-f]+ ?)*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[["str",/^[^"')]+/]]),["css-str"]); diff --git a/docs/scripts/prettify/prettify.js b/docs/scripts/prettify/prettify.js new file mode 100644 index 00000000..eef5ad7e --- /dev/null +++ b/docs/scripts/prettify/prettify.js @@ -0,0 +1,28 @@ +var q=null;window.PR_SHOULD_USE_CONTINUATION=!0; +(function(){function L(a){function m(a){var f=a.charCodeAt(0);if(f!==92)return f;var b=a.charAt(1);return(f=r[b])?f:"0"<=b&&b<="7"?parseInt(a.substring(1),8):b==="u"||b==="x"?parseInt(a.substring(2),16):a.charCodeAt(1)}function e(a){if(a<32)return(a<16?"\\x0":"\\x")+a.toString(16);a=String.fromCharCode(a);if(a==="\\"||a==="-"||a==="["||a==="]")a="\\"+a;return a}function h(a){for(var f=a.substring(1,a.length-1).match(/\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\[0-3][0-7]{0,2}|\\[0-7]{1,2}|\\[\S\s]|[^\\]/g),a= +[],b=[],o=f[0]==="^",c=o?1:0,i=f.length;c122||(d<65||j>90||b.push([Math.max(65,j)|32,Math.min(d,90)|32]),d<97||j>122||b.push([Math.max(97,j)&-33,Math.min(d,122)&-33]))}}b.sort(function(a,f){return a[0]-f[0]||f[1]-a[1]});f=[];j=[NaN,NaN];for(c=0;ci[0]&&(i[1]+1>i[0]&&b.push("-"),b.push(e(i[1])));b.push("]");return b.join("")}function y(a){for(var f=a.source.match(/\[(?:[^\\\]]|\\[\S\s])*]|\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\\d+|\\[^\dux]|\(\?[!:=]|[()^]|[^()[\\^]+/g),b=f.length,d=[],c=0,i=0;c=2&&a==="["?f[c]=h(j):a!=="\\"&&(f[c]=j.replace(/[A-Za-z]/g,function(a){a=a.charCodeAt(0);return"["+String.fromCharCode(a&-33,a|32)+"]"}));return f.join("")}for(var t=0,s=!1,l=!1,p=0,d=a.length;p=5&&"lang-"===b.substring(0,5))&&!(o&&typeof o[1]==="string"))c=!1,b="src";c||(r[f]=b)}i=d;d+=f.length;if(c){c=o[1];var j=f.indexOf(c),k=j+c.length;o[2]&&(k=f.length-o[2].length,j=k-c.length);b=b.substring(5);B(l+i,f.substring(0,j),e,p);B(l+i+j,c,C(b,c),p);B(l+i+k,f.substring(k),e,p)}else p.push(l+i,b)}a.e=p}var h={},y;(function(){for(var e=a.concat(m), +l=[],p={},d=0,g=e.length;d=0;)h[n.charAt(k)]=r;r=r[1];n=""+r;p.hasOwnProperty(n)||(l.push(r),p[n]=q)}l.push(/[\S\s]/);y=L(l)})();var t=m.length;return e}function u(a){var m=[],e=[];a.tripleQuotedStrings?m.push(["str",/^(?:'''(?:[^'\\]|\\[\S\s]|''?(?=[^']))*(?:'''|$)|"""(?:[^"\\]|\\[\S\s]|""?(?=[^"]))*(?:"""|$)|'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$))/,q,"'\""]):a.multiLineStrings?m.push(["str",/^(?:'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$)|`(?:[^\\`]|\\[\S\s])*(?:`|$))/, +q,"'\"`"]):m.push(["str",/^(?:'(?:[^\n\r'\\]|\\.)*(?:'|$)|"(?:[^\n\r"\\]|\\.)*(?:"|$))/,q,"\"'"]);a.verbatimStrings&&e.push(["str",/^@"(?:[^"]|"")*(?:"|$)/,q]);var h=a.hashComments;h&&(a.cStyleComments?(h>1?m.push(["com",/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,q,"#"]):m.push(["com",/^#(?:(?:define|elif|else|endif|error|ifdef|include|ifndef|line|pragma|undef|warning)\b|[^\n\r]*)/,q,"#"]),e.push(["str",/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h|[a-z]\w*)>/,q])):m.push(["com",/^#[^\n\r]*/, +q,"#"]));a.cStyleComments&&(e.push(["com",/^\/\/[^\n\r]*/,q]),e.push(["com",/^\/\*[\S\s]*?(?:\*\/|$)/,q]));a.regexLiterals&&e.push(["lang-regex",/^(?:^^\.?|[!+-]|!=|!==|#|%|%=|&|&&|&&=|&=|\(|\*|\*=|\+=|,|-=|->|\/|\/=|:|::|;|<|<<|<<=|<=|=|==|===|>|>=|>>|>>=|>>>|>>>=|[?@[^]|\^=|\^\^|\^\^=|{|\||\|=|\|\||\|\|=|~|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\s*(\/(?=[^*/])(?:[^/[\\]|\\[\S\s]|\[(?:[^\\\]]|\\[\S\s])*(?:]|$))+\/)/]);(h=a.types)&&e.push(["typ",h]);a=(""+a.keywords).replace(/^ | $/g, +"");a.length&&e.push(["kwd",RegExp("^(?:"+a.replace(/[\s,]+/g,"|")+")\\b"),q]);m.push(["pln",/^\s+/,q," \r\n\t\xa0"]);e.push(["lit",/^@[$_a-z][\w$@]*/i,q],["typ",/^(?:[@_]?[A-Z]+[a-z][\w$@]*|\w+_t\b)/,q],["pln",/^[$_a-z][\w$@]*/i,q],["lit",/^(?:0x[\da-f]+|(?:\d(?:_\d+)*\d*(?:\.\d*)?|\.\d\+)(?:e[+-]?\d+)?)[a-z]*/i,q,"0123456789"],["pln",/^\\[\S\s]?/,q],["pun",/^.[^\s\w"-$'./@\\`]*/,q]);return x(m,e)}function D(a,m){function e(a){switch(a.nodeType){case 1:if(k.test(a.className))break;if("BR"===a.nodeName)h(a), +a.parentNode&&a.parentNode.removeChild(a);else for(a=a.firstChild;a;a=a.nextSibling)e(a);break;case 3:case 4:if(p){var b=a.nodeValue,d=b.match(t);if(d){var c=b.substring(0,d.index);a.nodeValue=c;(b=b.substring(d.index+d[0].length))&&a.parentNode.insertBefore(s.createTextNode(b),a.nextSibling);h(a);c||a.parentNode.removeChild(a)}}}}function h(a){function b(a,d){var e=d?a.cloneNode(!1):a,f=a.parentNode;if(f){var f=b(f,1),g=a.nextSibling;f.appendChild(e);for(var h=g;h;h=g)g=h.nextSibling,f.appendChild(h)}return e} +for(;!a.nextSibling;)if(a=a.parentNode,!a)return;for(var a=b(a.nextSibling,0),e;(e=a.parentNode)&&e.nodeType===1;)a=e;d.push(a)}var k=/(?:^|\s)nocode(?:\s|$)/,t=/\r\n?|\n/,s=a.ownerDocument,l;a.currentStyle?l=a.currentStyle.whiteSpace:window.getComputedStyle&&(l=s.defaultView.getComputedStyle(a,q).getPropertyValue("white-space"));var p=l&&"pre"===l.substring(0,3);for(l=s.createElement("LI");a.firstChild;)l.appendChild(a.firstChild);for(var d=[l],g=0;g=0;){var h=m[e];A.hasOwnProperty(h)?window.console&&console.warn("cannot override language handler %s",h):A[h]=a}}function C(a,m){if(!a||!A.hasOwnProperty(a))a=/^\s*=o&&(h+=2);e>=c&&(a+=2)}}catch(w){"console"in window&&console.log(w&&w.stack?w.stack:w)}}var v=["break,continue,do,else,for,if,return,while"],w=[[v,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"], +"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],F=[w,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"],G=[w,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"], +H=[G,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var"],w=[w,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"],I=[v,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"], +J=[v,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],v=[v,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],K=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)/,N=/\S/,O=u({keywords:[F,H,w,"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END"+ +I,J,v],hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0}),A={};k(O,["default-code"]);k(x([],[["pln",/^[^]*(?:>|$)/],["com",/^<\!--[\S\s]*?(?:--\>|$)/],["lang-",/^<\?([\S\s]+?)(?:\?>|$)/],["lang-",/^<%([\S\s]+?)(?:%>|$)/],["pun",/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\S\s]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\S\s]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\S\s]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]), +["default-markup","htm","html","mxml","xhtml","xml","xsl"]);k(x([["pln",/^\s+/,q," \t\r\n"],["atv",/^(?:"[^"]*"?|'[^']*'?)/,q,"\"'"]],[["tag",/^^<\/?[a-z](?:[\w-.:]*\w)?|\/?>$/i],["atn",/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^\s"'>]*(?:[^\s"'/>]|\/(?=\s)))/],["pun",/^[/<->]+/],["lang-js",/^on\w+\s*=\s*"([^"]+)"/i],["lang-js",/^on\w+\s*=\s*'([^']+)'/i],["lang-js",/^on\w+\s*=\s*([^\s"'>]+)/i],["lang-css",/^style\s*=\s*"([^"]+)"/i],["lang-css",/^style\s*=\s*'([^']+)'/i],["lang-css", +/^style\s*=\s*([^\s"'>]+)/i]]),["in.tag"]);k(x([],[["atv",/^[\S\s]+/]]),["uq.val"]);k(u({keywords:F,hashComments:!0,cStyleComments:!0,types:K}),["c","cc","cpp","cxx","cyc","m"]);k(u({keywords:"null,true,false"}),["json"]);k(u({keywords:H,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:K}),["cs"]);k(u({keywords:G,cStyleComments:!0}),["java"]);k(u({keywords:v,hashComments:!0,multiLineStrings:!0}),["bsh","csh","sh"]);k(u({keywords:I,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}), +["cv","py"]);k(u({keywords:"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["perl","pl","pm"]);k(u({keywords:J,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb"]);k(u({keywords:w,cStyleComments:!0,regexLiterals:!0}),["js"]);k(u({keywords:"all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,true,try,unless,until,when,while,yes", +hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]);k(x([],[["str",/^[\S\s]+/]]),["regex"]);window.prettyPrintOne=function(a,m,e){var h=document.createElement("PRE");h.innerHTML=a;e&&D(h,e);E({g:m,i:e,h:h});return h.innerHTML};window.prettyPrint=function(a){function m(){for(var e=window.PR_SHOULD_USE_CONTINUATION?l.now()+250:Infinity;p=0){var k=k.match(g),f,b;if(b= +!k){b=n;for(var o=void 0,c=b.firstChild;c;c=c.nextSibling)var i=c.nodeType,o=i===1?o?b:c:i===3?N.test(c.nodeValue)?b:o:o;b=(f=o===b?void 0:o)&&"CODE"===f.tagName}b&&(k=f.className.match(g));k&&(k=k[1]);b=!1;for(o=n.parentNode;o;o=o.parentNode)if((o.tagName==="pre"||o.tagName==="code"||o.tagName==="xmp")&&o.className&&o.className.indexOf("prettyprint")>=0){b=!0;break}b||((b=(b=n.className.match(/\blinenums\b(?::(\d+))?/))?b[1]&&b[1].length?+b[1]:!0:!1)&&D(n,b),d={g:k,h:n,i:b},E(d))}}p th:last-child { border-right: 1px solid #ddd; } + +.ancestors, .attribs { color: #999; } +.ancestors a, .attribs a +{ + color: #999 !important; + text-decoration: none; +} + +.clear +{ + clear: both; +} + +.important +{ + font-weight: bold; + color: #950B02; +} + +.yes-def { + text-indent: -1000px; +} + +.type-signature { + color: #aaa; +} + +.name, .signature { + font-family: Consolas, Monaco, 'Andale Mono', monospace; +} + +.details { margin-top: 14px; border-left: 2px solid #DDD; } +.details dt { width: 120px; float: left; padding-left: 10px; padding-top: 6px; } +.details dd { margin-left: 70px; } +.details ul { margin: 0; } +.details ul { list-style-type: none; } +.details li { margin-left: 30px; padding-top: 6px; } +.details pre.prettyprint { margin: 0 } +.details .object-value { padding-top: 0; } + +.description { + margin-bottom: 1em; + margin-top: 1em; +} + +.code-caption +{ + font-style: italic; + font-size: 107%; + margin: 0; +} + +.source +{ + border: 1px solid #ddd; + width: 80%; + overflow: auto; +} + +.prettyprint.source { + width: inherit; +} + +.source code +{ + font-size: 100%; + line-height: 18px; + display: block; + padding: 4px 12px; + margin: 0; + background-color: #fff; + color: #4D4E53; +} + +.prettyprint code span.line +{ + display: inline-block; +} + +.prettyprint.linenums +{ + padding-left: 70px; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} + +.prettyprint.linenums ol +{ + padding-left: 0; +} + +.prettyprint.linenums li +{ + border-left: 3px #ddd solid; +} + +.prettyprint.linenums li.selected, +.prettyprint.linenums li.selected * +{ + background-color: lightyellow; +} + +.prettyprint.linenums li * +{ + -webkit-user-select: text; + -moz-user-select: text; + -ms-user-select: text; + user-select: text; +} + +.params .name, .props .name, .name code { + color: #4D4E53; + font-family: Consolas, Monaco, 'Andale Mono', monospace; + font-size: 100%; +} + +.params td.description > p:first-child, +.props td.description > p:first-child +{ + margin-top: 0; + padding-top: 0; +} + +.params td.description > p:last-child, +.props td.description > p:last-child +{ + margin-bottom: 0; + padding-bottom: 0; +} + +.disabled { + color: #454545; +} diff --git a/docs/styles/prettify-jsdoc.css b/docs/styles/prettify-jsdoc.css new file mode 100644 index 00000000..5a2526e3 --- /dev/null +++ b/docs/styles/prettify-jsdoc.css @@ -0,0 +1,111 @@ +/* JSDoc prettify.js theme */ + +/* plain text */ +.pln { + color: #000000; + font-weight: normal; + font-style: normal; +} + +/* string content */ +.str { + color: #006400; + font-weight: normal; + font-style: normal; +} + +/* a keyword */ +.kwd { + color: #000000; + font-weight: bold; + font-style: normal; +} + +/* a comment */ +.com { + font-weight: normal; + font-style: italic; +} + +/* a type name */ +.typ { + color: #000000; + font-weight: normal; + font-style: normal; +} + +/* a literal value */ +.lit { + color: #006400; + font-weight: normal; + font-style: normal; +} + +/* punctuation */ +.pun { + color: #000000; + font-weight: bold; + font-style: normal; +} + +/* lisp open bracket */ +.opn { + color: #000000; + font-weight: bold; + font-style: normal; +} + +/* lisp close bracket */ +.clo { + color: #000000; + font-weight: bold; + font-style: normal; +} + +/* a markup tag name */ +.tag { + color: #006400; + font-weight: normal; + font-style: normal; +} + +/* a markup attribute name */ +.atn { + color: #006400; + font-weight: normal; + font-style: normal; +} + +/* a markup attribute value */ +.atv { + color: #006400; + font-weight: normal; + font-style: normal; +} + +/* a declaration */ +.dec { + color: #000000; + font-weight: bold; + font-style: normal; +} + +/* a variable name */ +.var { + color: #000000; + font-weight: normal; + font-style: normal; +} + +/* a function name */ +.fun { + color: #000000; + font-weight: bold; + font-style: normal; +} + +/* Specify class=linenums on a pre to get line numbering */ +ol.linenums { + margin-top: 0; + margin-bottom: 0; +} diff --git a/docs/styles/prettify-tomorrow.css b/docs/styles/prettify-tomorrow.css new file mode 100644 index 00000000..b6f92a78 --- /dev/null +++ b/docs/styles/prettify-tomorrow.css @@ -0,0 +1,132 @@ +/* Tomorrow Theme */ +/* Original theme - https://github.com/chriskempson/tomorrow-theme */ +/* Pretty printing styles. Used with prettify.js. */ +/* SPAN elements with the classes below are added by prettyprint. */ +/* plain text */ +.pln { + color: #4d4d4c; } + +@media screen { + /* string content */ + .str { + color: #718c00; } + + /* a keyword */ + .kwd { + color: #8959a8; } + + /* a comment */ + .com { + color: #8e908c; } + + /* a type name */ + .typ { + color: #4271ae; } + + /* a literal value */ + .lit { + color: #f5871f; } + + /* punctuation */ + .pun { + color: #4d4d4c; } + + /* lisp open bracket */ + .opn { + color: #4d4d4c; } + + /* lisp close bracket */ + .clo { + color: #4d4d4c; } + + /* a markup tag name */ + .tag { + color: #c82829; } + + /* a markup attribute name */ + .atn { + color: #f5871f; } + + /* a markup attribute value */ + .atv { + color: #3e999f; } + + /* a declaration */ + .dec { + color: #f5871f; } + + /* a variable name */ + .var { + color: #c82829; } + + /* a function name */ + .fun { + color: #4271ae; } } +/* Use higher contrast and text-weight for printable form. */ +@media print, projection { + .str { + color: #060; } + + .kwd { + color: #006; + font-weight: bold; } + + .com { + color: #600; + font-style: italic; } + + .typ { + color: #404; + font-weight: bold; } + + .lit { + color: #044; } + + .pun, .opn, .clo { + color: #440; } + + .tag { + color: #006; + font-weight: bold; } + + .atn { + color: #404; } + + .atv { + color: #060; } } +/* Style */ +/* +pre.prettyprint { + background: white; + font-family: Consolas, Monaco, 'Andale Mono', monospace; + font-size: 12px; + line-height: 1.5; + border: 1px solid #ccc; + padding: 10px; } +*/ + +/* Specify class=linenums on a pre to get line numbering */ +ol.linenums { + margin-top: 0; + margin-bottom: 0; } + +/* IE indents via margin-left */ +li.L0, +li.L1, +li.L2, +li.L3, +li.L4, +li.L5, +li.L6, +li.L7, +li.L8, +li.L9 { + /* */ } + +/* Alternate shading for lines */ +li.L1, +li.L3, +li.L5, +li.L7, +li.L9 { + /* */ } diff --git a/package-lock.json b/package-lock.json index ca41012b..adc0c191 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "openpgp", - "version": "4.10.10", + "version": "5.0.0-0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index b33b0aec..30dab24c 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "openpgp", "description": "OpenPGP.js is a Javascript implementation of the OpenPGP protocol. This is defined in RFC 4880.", - "version": "4.10.10", + "version": "5.0.0-0", "license": "LGPL-3.0+", "homepage": "https://openpgpjs.org/", "engines": {