diff --git a/docs/AEADEncryptedDataPacket.html b/docs/AEADEncryptedDataPacket.html index cd95975d..da6470c6 100644 --- a/docs/AEADEncryptedDataPacket.html +++ b/docs/AEADEncryptedDataPacket.html @@ -98,7 +98,7 @@ AEAD Protected Data Packet

Source:
@@ -200,7 +200,7 @@ AEAD Protected Data Packet

Source:
@@ -270,7 +270,7 @@ AEAD Protected Data Packet

Source:
@@ -298,215 +298,6 @@ AEAD Protected Data Packet

-

(async) crypt(fn, key, data) → {Promise.<(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

- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - - - -
-
- Type -
-
- -Promise.<(Uint8Array|ReadableStream.<Uint8Array>)> - - -
-
- - - - - - - - - - - - -

(async) decrypt(sessionKeyAlgorithm, key, configopt)

@@ -684,7 +475,7 @@ AEAD Protected Data Packet

Source:
@@ -926,7 +717,7 @@ AEAD Protected Data Packet

Source:
@@ -1097,7 +888,7 @@ AEAD Protected Data Packet

Source:
@@ -1216,7 +1007,7 @@ AEAD Protected Data Packet

Source:
@@ -1287,13 +1078,13 @@ AEAD Protected Data Packet


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

Class: Argon2S2K

+ + + + + + +
+ +
+ +

Argon2S2K(configopt)

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

new Argon2S2K(configopt)

+ + + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
config + + +Object + + + + + + <optional>
+ + + + + +

Full configuration, defaults to openpgp.config

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

Members

+ + + +

encodedM :Integer

+ + + + +
+

exponent indicating memory size

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

p :Integer

+ + + + +
+

degree of parallelism (lanes)

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

salt :Uint8Array

+ + + + +
+

16 bytes of salt

+
+ + + +
Type:
+
    +
  • + +Uint8Array + + +
  • +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

t :Integer

+ + + + +
+

number of passes

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

Methods

+ + + + + + + +

(async) produceKey(passphrase) → {Promise.<Uint8Array>}

+ + + + + + +
+

Produces a key using the specified passphrase and the defined +hashAlgorithm

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

Passphrase containing user input

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Throws:
+ + + +
+ + +Argon2OutOfMemoryError +| + +Errors + + + +
+ + + + + +
Returns:
+ + +
+

Produced key with a length corresponding to keySize

+
+ + + +
+
+ Type +
+
+ +Promise.<Uint8Array> + + +
+
+ + + + + + + + + + + + + +

read(bytes) → {Integer}

+ + + + + + +
+

Parsing function for argon2 string-to-key specifier.

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

Payload of argon2 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/CleartextMessage.html b/docs/CleartextMessage.html index f58f77cc..1d6fba9e 100644 --- a/docs/CleartextMessage.html +++ b/docs/CleartextMessage.html @@ -168,7 +168,7 @@ See https://tools.ietf.o
Source:
@@ -346,7 +346,7 @@ See https://tools.ietf.o
Source:
@@ -461,7 +461,7 @@ See https://tools.ietf.o
Source:
@@ -573,7 +573,7 @@ See https://tools.ietf.o
Source:
@@ -974,7 +974,7 @@ See https://tools.ietf.o
Source:
@@ -1211,7 +1211,7 @@ See https://tools.ietf.o
Source:
@@ -1279,13 +1279,13 @@ See https://tools.ietf.o
diff --git a/docs/CompressedDataPacket.html b/docs/CompressedDataPacket.html index f6c10968..2a8a0504 100644 --- a/docs/CompressedDataPacket.html +++ b/docs/CompressedDataPacket.html @@ -160,7 +160,7 @@ a Signature or One-Pass Signature packet, and contains a literal data packet.

Source:
@@ -266,7 +266,7 @@ a Signature or One-Pass Signature packet, and contains a literal data packet.

Source:
@@ -343,7 +343,7 @@ a Signature or One-Pass Signature packet, and contains a literal data packet.

Source:
@@ -407,7 +407,7 @@ a Signature or One-Pass Signature packet, and contains a literal data packet.

Source:
@@ -481,7 +481,7 @@ a Signature or One-Pass Signature packet, and contains a literal data packet.

Source:
@@ -563,7 +563,7 @@ a Signature or One-Pass Signature packet, and contains a literal data packet.

Source:
@@ -715,7 +715,7 @@ read by read_packet

Source:
@@ -900,7 +900,7 @@ read by read_packet

Source:
@@ -990,7 +990,7 @@ read by read_packet

Source:
@@ -1061,13 +1061,13 @@ read by read_packet


diff --git a/docs/Key.html b/docs/Key.html index 96d8e75a..4eafe297 100644 --- a/docs/Key.html +++ b/docs/Key.html @@ -96,7 +96,7 @@ Can contain additional subkeys, signatures, user ids, user attributes.

Source:
@@ -333,7 +333,7 @@ if it is a valid revocation signature.

Source:
@@ -514,7 +514,7 @@ if it is a valid revocation signature.

Source:
@@ -626,7 +626,7 @@ if it is a valid revocation signature.

Source:
@@ -738,7 +738,7 @@ if it is a valid revocation signature.

Source:
@@ -1006,7 +1006,7 @@ if it is a valid revocation signature.

Source:
@@ -1225,7 +1225,7 @@ Returns Infinity if the key doesn't expire, or null if
Source:
@@ -1333,7 +1333,7 @@ Returns Infinity if the key doesn't expire, or null if
Source:
@@ -1445,7 +1445,7 @@ Returns Infinity if the key doesn't expire, or null if
Source:
@@ -1557,7 +1557,7 @@ Returns Infinity if the key doesn't expire, or null if
Source:
@@ -1735,7 +1735,7 @@ If no keyID is given, returns all keys, starting with the primary key.

Source:
@@ -1793,6 +1793,248 @@ If no keyID is given, returns all keys, starting with the primary key.

+

(async) getPrimarySelfSignature(dateopt, userIDopt, configopt) → {Promise.<SignaturePacket>}

+ + + + + + +
+

For V4 keys, returns the self-signature of the primary user. +For V5 keys, returns the latest valid direct-key self-signature. +This self-signature is to be used to check the key expiration, +algorithm preferences, and so on.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
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 for V4 keys, if it exists

config + + +Object + + + + + + <optional>
+ + + + + +

Full configuration, defaults to openpgp.config

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

The primary self-signature

+
+ + + +
+
+ Type +
+
+ +Promise.<SignaturePacket> + + +
+
+ + + + + + + + + + + + +

(async) getPrimaryUser(dateopt, userIDopt, configopt) → {Promise.<{user: User, selfCertification: SignaturePacket}>}

@@ -1978,7 +2220,7 @@ If no keyID is given, returns all keys, starting with the primary key.

Source:
@@ -2183,7 +2425,7 @@ If no keyID is given, returns all keys, starting with the primary key.

Source:
@@ -2475,7 +2717,7 @@ If no keyID is given, returns all keys, starting with the primary key.

Source:
@@ -2669,7 +2911,7 @@ If no keyID is given, returns all subkeys.

Source:
@@ -2781,7 +3023,7 @@ If no keyID is given, returns all subkeys.

Source:
@@ -2893,7 +3135,7 @@ If no keyID is given, returns all subkeys.

Source:
@@ -3170,7 +3412,7 @@ If no keyID is given, returns all subkeys.

Source:
@@ -3354,7 +3596,7 @@ If no keyID is given, returns all subkeys.

Source:
@@ -3569,7 +3811,7 @@ If no keyID is given, returns all subkeys.

Source:
@@ -3839,7 +4081,7 @@ If no keyID is given, returns all subkeys.

Source:
@@ -3951,7 +4193,7 @@ If no keyID is given, returns all subkeys.

Source:
@@ -4192,7 +4434,7 @@ a private key is returned.

Source:
@@ -4435,7 +4677,7 @@ a private key is returned.

Source:
@@ -4676,7 +4918,7 @@ and valid self signature. Throws if the primary key is invalid.

Source:
@@ -4959,7 +5201,7 @@ and valid self signature. Throws if the primary key is invalid.

Source:
@@ -5072,7 +5314,7 @@ Signature validity is null if the verification keys do not correspond to the cer
Source:
@@ -5140,13 +5382,13 @@ Signature validity is null if the verification keys do not correspond to the cer
diff --git a/docs/LiteralDataPacket.html b/docs/LiteralDataPacket.html index 91a1c9a0..c3d734a8 100644 --- a/docs/LiteralDataPacket.html +++ b/docs/LiteralDataPacket.html @@ -147,7 +147,7 @@ further interpreted.

Source:
@@ -326,7 +326,7 @@ further interpreted.

Source:
@@ -441,7 +441,7 @@ further interpreted.

Source:
@@ -623,7 +623,7 @@ with normalized end of line to \n

Source:
@@ -790,7 +790,7 @@ with normalized end of line to \n

Source:
@@ -977,7 +977,7 @@ with normalized end of line to \n

Source:
@@ -1116,7 +1116,7 @@ with normalized end of line to \n

Source:
@@ -1302,7 +1302,7 @@ will be normalized to \r\n and by default text is converted to UTF8

Source:
@@ -1392,7 +1392,7 @@ will be normalized to \r\n and by default text is converted to UTF8

Source:
@@ -1507,7 +1507,7 @@ will be normalized to \r\n and by default text is converted to UTF8

Source:
@@ -1575,13 +1575,13 @@ will be normalized to \r\n and by default text is converted to UTF8


diff --git a/docs/MarkerPacket.html b/docs/MarkerPacket.html index c93faeec..d41e366f 100644 --- a/docs/MarkerPacket.html +++ b/docs/MarkerPacket.html @@ -106,7 +106,7 @@ software is necessary to process the message.

Source:
@@ -265,7 +265,7 @@ software is necessary to process the message.

Source:
@@ -333,13 +333,13 @@ software is necessary to process the message.


diff --git a/docs/Message.html b/docs/Message.html index d01d613e..47b41564 100644 --- a/docs/Message.html +++ b/docs/Message.html @@ -146,7 +146,7 @@ See https://tools.iet
Source:
@@ -661,7 +661,7 @@ See https://tools.iet
Source:
@@ -933,7 +933,7 @@ See https://tools.iet
Source:
@@ -1140,7 +1140,7 @@ See https://tools.iet
Source:
@@ -1291,7 +1291,7 @@ See https://tools.iet
Source:
@@ -1495,7 +1495,7 @@ See https://tools.iet
Source:
@@ -1800,7 +1800,7 @@ See https://tools.iet
Source:
@@ -1858,7 +1858,7 @@ See https://tools.iet -

(async) decryptSessionKeys(decryptionKeysopt, passwordsopt, dateopt, configopt) → {Promise.<Array.<{data: Uint8Array, algorithm: String}>>}

+

(async) decryptSessionKeys(decryptionKeysopt, passwordsopt, expectedSymmetricAlgorithmopt, dateopt, configopt) → {Promise.<Array.<{data: Uint8Array, algorithm: String}>>}

@@ -1968,6 +1968,39 @@ See
https://tools.iet + + + expectedSymmetricAlgorithm + + + + + +enums.symmetric + + + + + + + + + <optional>
+ + + + + + + + + + +

The symmetric algorithm the SEIPDv2 / AEAD packet is encrypted with (if applicable)

+ + + + date @@ -2072,7 +2105,7 @@ See
https://tools.iet
Source:
@@ -2512,7 +2545,7 @@ See https://tools.iet
Source:
@@ -2624,7 +2657,7 @@ See https://tools.iet
Source:
@@ -2736,7 +2769,7 @@ See https://tools.iet
Source:
@@ -2851,7 +2884,7 @@ See https://tools.iet
Source:
@@ -2966,7 +2999,7 @@ See https://tools.iet
Source:
@@ -3078,7 +3111,7 @@ See https://tools.iet
Source:
@@ -3482,7 +3515,7 @@ See https://tools.iet
Source:
@@ -3883,7 +3916,7 @@ See https://tools.iet
Source:
@@ -3995,7 +4028,7 @@ See https://tools.iet
Source:
@@ -4232,7 +4265,7 @@ See https://tools.iet
Source:
@@ -4498,7 +4531,7 @@ See https://tools.iet
Source:
@@ -4610,7 +4643,7 @@ See https://tools.iet
Source:
@@ -4678,13 +4711,13 @@ See https://tools.iet
diff --git a/docs/OnePassSignaturePacket.html b/docs/OnePassSignaturePacket.html index 75d42bad..0d385ee7 100644 --- a/docs/OnePassSignaturePacket.html +++ b/docs/OnePassSignaturePacket.html @@ -101,7 +101,7 @@ can compute the entire signed message in one pass.

Source:
@@ -199,7 +199,7 @@ that describes another signature to be applied to the same message data.

Source:
@@ -273,7 +273,7 @@ that describes another signature to be applied to the same message data.

Source:
@@ -298,13 +298,13 @@ that describes another signature to be applied to the same message data.

-

issuerKeyID

+

issuerFingerprint

-

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

+

Only for v6 packets, 32 octets of the fingerprint of the signing key.

@@ -344,7 +344,71 @@ that describes another signature to be applied to the same message data.

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

issuerKeyID

+ + + + +
+

Only for v3 packets, an eight-octet number holding the Key ID of the signing key.

+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
@@ -418,7 +482,7 @@ that describes another signature to be applied to the same message data.

Source:
@@ -443,6 +507,70 @@ that describes another signature to be applied to the same message data.

+

salt

+ + + + +
+

Only for v6, a variable-length field containing the salt.

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

signatureType :enums.signature

@@ -501,7 +629,7 @@ Signature types are described in
Source:
@@ -525,7 +653,7 @@ Signature types are described in
-

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

+

A one-octet version number. The current versions are 3 and 6.

@@ -565,7 +693,7 @@ Signature types are described in
Source:
@@ -696,7 +824,7 @@ Signature types are described in
Source:
@@ -808,7 +936,7 @@ Signature types are described in
Source:
@@ -876,13 +1004,13 @@ Signature types are described in
diff --git a/docs/PacketList.html b/docs/PacketList.html index 2b1e9744..26512388 100644 --- a/docs/PacketList.html +++ b/docs/PacketList.html @@ -97,7 +97,7 @@ are stored as numerical indices.

Source:
@@ -345,7 +345,7 @@ Equivalent to calling read on an empty PacketList instance.

Source:
@@ -530,7 +530,7 @@ Equivalent to calling read on an empty PacketList instance.

Source:
@@ -687,7 +687,7 @@ Equivalent to calling read on an empty PacketList instance.

Source:
@@ -859,7 +859,7 @@ Equivalent to calling read on an empty PacketList instance.

Source:
@@ -1097,7 +1097,7 @@ Equivalent to calling read on an empty PacketList instance.

Source:
@@ -1200,7 +1200,7 @@ class instance.

Source:
@@ -1268,13 +1268,13 @@ class instance.


diff --git a/docs/PaddingPacket.html b/docs/PaddingPacket.html new file mode 100644 index 00000000..f61bf58f --- /dev/null +++ b/docs/PaddingPacket.html @@ -0,0 +1,600 @@ + + + + + JSDoc: Class: PaddingPacket + + + + + + + + + + +
+ +

Class: PaddingPacket

+ + + + + + +
+ +
+ +

PaddingPacket()

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

Constructor

+ + + +

new PaddingPacket()

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

Methods

+ + + + + + + +

(async) createPadding(length)

+ + + + + + +
+

Create random padding.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
length + + +Number + + + +

The length of padding to be generated.

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

if padding generation was not successful

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

read(bytes)

+ + + + + + +
+

Read a padding packet

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

write() → {Uint8Array}

+ + + + + + +
+

Write the padding packet

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

The padding packet.

+
+ + + +
+
+ Type +
+
+ +Uint8Array + + +
+
+ + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ + + + + + + \ No newline at end of file diff --git a/docs/PrivateKey.html b/docs/PrivateKey.html index 8b9799c3..492f3427 100644 --- a/docs/PrivateKey.html +++ b/docs/PrivateKey.html @@ -144,7 +144,7 @@
Source:
@@ -209,7 +209,8 @@

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.

+Supports RSA and ECC keys, as well as the newer Curve448 and Curve25519. +Defaults to the algorithm and bit size/curve of the primary key. DSA primary keys default to RSA subkeys.

@@ -255,6 +256,12 @@ Supports RSA and ECC keys. Defaults to the algorithm and bit size/curve of the p | rsa +| + +curve25519 +| + +curve448 @@ -264,7 +271,8 @@ Supports RSA and ECC keys. Defaults to the algorithm and bit size/curve of the p -

The subkey algorithm: ECC or RSA

+

The subkey algorithm: ECC, RSA, Curve448 or Curve25519 (new format). +Note: Curve448 and Curve25519 are not widely supported yet.

@@ -445,7 +453,7 @@ Supports RSA and ECC keys. Defaults to the algorithm and bit size/curve of the p
Source:
@@ -614,7 +622,7 @@ Supports RSA and ECC keys. Defaults to the algorithm and bit size/curve of the p
Source:
@@ -726,7 +734,7 @@ Supports RSA and ECC keys. Defaults to the algorithm and bit size/curve of the p
Source:
@@ -971,7 +979,7 @@ This is useful to retrieve keys for session key decryption

Source:
@@ -1084,7 +1092,7 @@ A dummy key is considered encrypted.

Source:
@@ -1174,7 +1182,7 @@ A dummy key is considered encrypted.

Source:
@@ -1477,7 +1485,7 @@ A dummy key is considered encrypted.

Source:
@@ -1589,7 +1597,7 @@ A dummy key is considered encrypted.

Source:
@@ -1766,7 +1774,7 @@ If only gnu-dummy keys are found, we cannot properly validate so we throw an err
Source:
@@ -1841,13 +1849,13 @@ If only gnu-dummy keys are found, we cannot properly validate so we throw an err
diff --git a/docs/PublicKey.html b/docs/PublicKey.html index c8edd749..0719a06c 100644 --- a/docs/PublicKey.html +++ b/docs/PublicKey.html @@ -144,7 +144,7 @@
Source:
@@ -315,7 +315,7 @@
Source:
@@ -427,7 +427,7 @@
Source:
@@ -535,7 +535,7 @@
Source:
@@ -603,13 +603,13 @@
diff --git a/docs/PublicKeyEncryptedSessionKeyPacket.html b/docs/PublicKeyEncryptedSessionKeyPacket.html index 337ea927..c9f05bd5 100644 --- a/docs/PublicKeyEncryptedSessionKeyPacket.html +++ b/docs/PublicKeyEncryptedSessionKeyPacket.html @@ -107,7 +107,7 @@ decrypt the message.

Source:
@@ -209,7 +209,7 @@ decrypt the message.

Source:
@@ -283,7 +283,7 @@ decrypt the message.

Source:
@@ -458,7 +458,7 @@ This is needed for constant-time processing. Expected object of the form: { sess
Source:
@@ -626,7 +626,7 @@ This is needed for constant-time processing. Expected object of the form: { sess
Source:
@@ -794,7 +794,7 @@ This is needed for constant-time processing. Expected object of the form: { sess
Source:
@@ -884,7 +884,7 @@ This is needed for constant-time processing. Expected object of the form: { sess
Source:
@@ -952,13 +952,13 @@ This is needed for constant-time processing. Expected object of the form: { sess
diff --git a/docs/PublicKeyPacket.html b/docs/PublicKeyPacket.html index a3063b29..476c16f1 100644 --- a/docs/PublicKeyPacket.html +++ b/docs/PublicKeyPacket.html @@ -195,7 +195,7 @@ key (sometimes called an OpenPGP certificate).

Source:
@@ -301,7 +301,7 @@ key (sometimes called an OpenPGP certificate).

Source:
@@ -375,7 +375,7 @@ key (sometimes called an OpenPGP certificate).

Source:
@@ -449,7 +449,7 @@ key (sometimes called an OpenPGP certificate).

Source:
@@ -523,7 +523,7 @@ key (sometimes called an OpenPGP certificate).

Source:
@@ -597,7 +597,7 @@ key (sometimes called an OpenPGP certificate).

Source:
@@ -671,7 +671,7 @@ key (sometimes called an OpenPGP certificate).

Source:
@@ -735,7 +735,7 @@ key (sometimes called an OpenPGP certificate).

Source:
@@ -816,7 +816,7 @@ key (sometimes called an OpenPGP certificate).

Source:
@@ -880,7 +880,7 @@ key (sometimes called an OpenPGP certificate).

Source:
@@ -1018,7 +1018,7 @@ key (sometimes called an OpenPGP certificate).

Source:
@@ -1130,7 +1130,7 @@ key (sometimes called an OpenPGP certificate).

Source:
@@ -1220,7 +1220,7 @@ key (sometimes called an OpenPGP certificate).

Source:
@@ -1310,7 +1310,7 @@ key (sometimes called an OpenPGP certificate).

Source:
@@ -1422,7 +1422,7 @@ key (sometimes called an OpenPGP certificate).

Source:
@@ -1530,7 +1530,7 @@ key (sometimes called an OpenPGP certificate).

Source:
@@ -1642,7 +1642,7 @@ key (sometimes called an OpenPGP certificate).

Source:
@@ -1754,7 +1754,7 @@ key (sometimes called an OpenPGP certificate).

Source:
@@ -1866,7 +1866,7 @@ key (sometimes called an OpenPGP certificate).

Source:
@@ -1978,7 +1978,7 @@ key (sometimes called an OpenPGP certificate).

Source:
@@ -2138,7 +2138,7 @@ key (sometimes called an OpenPGP certificate).

Source:
@@ -2250,7 +2250,7 @@ key (sometimes called an OpenPGP certificate).

Source:
@@ -2411,7 +2411,7 @@ key (sometimes called an OpenPGP certificate).

Source:
@@ -2457,13 +2457,13 @@ key (sometimes called an OpenPGP certificate).


diff --git a/docs/PublicSubkeyPacket.html b/docs/PublicSubkeyPacket.html index 4b838083..2725ce91 100644 --- a/docs/PublicSubkeyPacket.html +++ b/docs/PublicSubkeyPacket.html @@ -193,7 +193,7 @@ services.

Source:
@@ -315,7 +315,7 @@ services.

Source:
@@ -394,7 +394,7 @@ services.

Source:
@@ -473,7 +473,7 @@ services.

Source:
@@ -552,7 +552,7 @@ services.

Source:
@@ -631,7 +631,7 @@ services.

Source:
@@ -710,7 +710,7 @@ services.

Source:
@@ -779,7 +779,7 @@ services.

Source:
@@ -865,7 +865,7 @@ services.

Source:
@@ -934,7 +934,7 @@ services.

Source:
@@ -1072,7 +1072,7 @@ services.

Source:
@@ -1189,7 +1189,7 @@ services.

Source:
@@ -1284,7 +1284,7 @@ services.

Source:
@@ -1379,7 +1379,7 @@ services.

Source:
@@ -1496,7 +1496,7 @@ services.

Source:
@@ -1609,7 +1609,7 @@ services.

Source:
@@ -1726,7 +1726,7 @@ services.

Source:
@@ -1843,7 +1843,7 @@ services.

Source:
@@ -1960,7 +1960,7 @@ services.

Source:
@@ -2077,7 +2077,7 @@ services.

Source:
@@ -2242,7 +2242,7 @@ services.

Source:
@@ -2359,7 +2359,7 @@ services.

Source:
@@ -2525,7 +2525,7 @@ services.

Source:
@@ -2571,13 +2571,13 @@ services.


diff --git a/docs/SecretKeyPacket.html b/docs/SecretKeyPacket.html index b87b7bdf..59097cb0 100644 --- a/docs/SecretKeyPacket.html +++ b/docs/SecretKeyPacket.html @@ -191,7 +191,7 @@ includes the secret-key material after all the public-key fields.

Source:
@@ -308,7 +308,7 @@ includes the secret-key material after all the public-key fields.

Source:
@@ -387,7 +387,7 @@ includes the secret-key material after all the public-key fields.

Source:
@@ -466,7 +466,7 @@ includes the secret-key material after all the public-key fields.

Source:
@@ -545,7 +545,7 @@ includes the secret-key material after all the public-key fields.

Source:
@@ -624,7 +624,7 @@ includes the secret-key material after all the public-key fields.

Source:
@@ -688,7 +688,7 @@ includes the secret-key material after all the public-key fields.

Source:
@@ -767,7 +767,7 @@ includes the secret-key material after all the public-key fields.

Source:
@@ -831,7 +831,7 @@ includes the secret-key material after all the public-key fields.

Source:
@@ -905,7 +905,7 @@ includes the secret-key material after all the public-key fields.

Source:
@@ -984,7 +984,7 @@ includes the secret-key material after all the public-key fields.

Source:
@@ -1053,7 +1053,7 @@ includes the secret-key material after all the public-key fields.

Source:
@@ -1134,7 +1134,7 @@ includes the secret-key material after all the public-key fields.

Source:
@@ -1208,7 +1208,7 @@ includes the secret-key material after all the public-key fields.

Source:
@@ -1282,7 +1282,7 @@ includes the secret-key material after all the public-key fields.

Source:
@@ -1361,7 +1361,7 @@ includes the secret-key material after all the public-key fields.

Source:
@@ -1430,7 +1430,7 @@ includes the secret-key material after all the public-key fields.

Source:
@@ -1519,7 +1519,7 @@ includes the secret-key material after all the public-key fields.

Source:
@@ -1614,7 +1614,7 @@ includes the secret-key material after all the public-key fields.

Source:
@@ -1709,7 +1709,7 @@ includes the secret-key material after all the public-key fields.

Source:
@@ -1851,7 +1851,7 @@ otherwise calls to this function will throw an error.

Source:
@@ -2065,7 +2065,7 @@ This can be used to remove passphrase protection after calling decrypt().

Source:
@@ -2189,7 +2189,7 @@ This can be used to remove passphrase protection after calling decrypt().

Source:
@@ -2306,7 +2306,7 @@ This can be used to remove passphrase protection after calling decrypt().

Source:
@@ -2419,7 +2419,7 @@ This can be used to remove passphrase protection after calling decrypt().

Source:
@@ -2536,7 +2536,7 @@ This can be used to remove passphrase protection after calling decrypt().

Source:
@@ -2653,7 +2653,7 @@ This can be used to remove passphrase protection after calling decrypt().

Source:
@@ -2770,7 +2770,7 @@ This can be used to remove passphrase protection after calling decrypt().

Source:
@@ -2888,7 +2888,7 @@ Returns false for gnu-dummy keys and null for public keys.

Source:
@@ -2999,7 +2999,7 @@ Returns false for gnu-dummy keys and null for public keys.

Source:
@@ -3114,7 +3114,7 @@ Such keys are:

Source:
@@ -3266,7 +3266,7 @@ The resulting key cannot be used for signing/decrypting but can still verify sig
Source:
@@ -3411,7 +3411,7 @@ The resulting key cannot be used for signing/decrypting but can still verify sig
Source:
@@ -3501,7 +3501,7 @@ The resulting key cannot be used for signing/decrypting but can still verify sig
Source:
@@ -3625,7 +3625,7 @@ The resulting key cannot be used for signing/decrypting but can still verify sig
Source:
@@ -3791,7 +3791,7 @@ The resulting key cannot be used for signing/decrypting but can still verify sig
Source:
@@ -3837,13 +3837,13 @@ The resulting key cannot be used for signing/decrypting but can still verify sig
diff --git a/docs/SecretSubkeyPacket.html b/docs/SecretSubkeyPacket.html index 1c2050af..63f9b9b3 100644 --- a/docs/SecretSubkeyPacket.html +++ b/docs/SecretSubkeyPacket.html @@ -190,7 +190,7 @@ Key packet and has exactly the same format.

Source:
@@ -312,7 +312,7 @@ Key packet and has exactly the same format.

Source:
@@ -391,7 +391,7 @@ Key packet and has exactly the same format.

Source:
@@ -470,7 +470,7 @@ Key packet and has exactly the same format.

Source:
@@ -549,7 +549,7 @@ Key packet and has exactly the same format.

Source:
@@ -628,7 +628,7 @@ Key packet and has exactly the same format.

Source:
@@ -697,7 +697,7 @@ Key packet and has exactly the same format.

Source:
@@ -776,7 +776,7 @@ Key packet and has exactly the same format.

Source:
@@ -845,7 +845,7 @@ Key packet and has exactly the same format.

Source:
@@ -924,7 +924,7 @@ Key packet and has exactly the same format.

Source:
@@ -1003,7 +1003,7 @@ Key packet and has exactly the same format.

Source:
@@ -1072,7 +1072,7 @@ Key packet and has exactly the same format.

Source:
@@ -1158,7 +1158,7 @@ Key packet and has exactly the same format.

Source:
@@ -1237,7 +1237,7 @@ Key packet and has exactly the same format.

Source:
@@ -1316,7 +1316,7 @@ Key packet and has exactly the same format.

Source:
@@ -1395,7 +1395,7 @@ Key packet and has exactly the same format.

Source:
@@ -1464,7 +1464,7 @@ Key packet and has exactly the same format.

Source:
@@ -1558,7 +1558,7 @@ Key packet and has exactly the same format.

Source:
@@ -1653,7 +1653,7 @@ Key packet and has exactly the same format.

Source:
@@ -1748,7 +1748,7 @@ Key packet and has exactly the same format.

Source:
@@ -1895,7 +1895,7 @@ otherwise calls to this function will throw an error.

Source:
@@ -2114,7 +2114,7 @@ This can be used to remove passphrase protection after calling decrypt().

Source:
@@ -2238,7 +2238,7 @@ This can be used to remove passphrase protection after calling decrypt().

Source:
@@ -2355,7 +2355,7 @@ This can be used to remove passphrase protection after calling decrypt().

Source:
@@ -2468,7 +2468,7 @@ This can be used to remove passphrase protection after calling decrypt().

Source:
@@ -2585,7 +2585,7 @@ This can be used to remove passphrase protection after calling decrypt().

Source:
@@ -2702,7 +2702,7 @@ This can be used to remove passphrase protection after calling decrypt().

Source:
@@ -2819,7 +2819,7 @@ This can be used to remove passphrase protection after calling decrypt().

Source:
@@ -2937,7 +2937,7 @@ Returns false for gnu-dummy keys and null for public keys.

Source:
@@ -3053,7 +3053,7 @@ Returns false for gnu-dummy keys and null for public keys.

Source:
@@ -3173,7 +3173,7 @@ Such keys are:

Source:
@@ -3330,7 +3330,7 @@ The resulting key cannot be used for signing/decrypting but can still verify sig
Source:
@@ -3475,7 +3475,7 @@ The resulting key cannot be used for signing/decrypting but can still verify sig
Source:
@@ -3570,7 +3570,7 @@ The resulting key cannot be used for signing/decrypting but can still verify sig
Source:
@@ -3694,7 +3694,7 @@ The resulting key cannot be used for signing/decrypting but can still verify sig
Source:
@@ -3860,7 +3860,7 @@ The resulting key cannot be used for signing/decrypting but can still verify sig
Source:
@@ -3906,13 +3906,13 @@ The resulting key cannot be used for signing/decrypting but can still verify sig
diff --git a/docs/Signature.html b/docs/Signature.html index 71ab0cc2..16b92a51 100644 --- a/docs/Signature.html +++ b/docs/Signature.html @@ -144,7 +144,7 @@
Source:
@@ -322,7 +322,7 @@
Source:
@@ -434,7 +434,7 @@
Source:
@@ -546,7 +546,7 @@
Source:
@@ -614,13 +614,13 @@
diff --git a/docs/SignaturePacket.html b/docs/SignaturePacket.html index 6adcfe0b..f1b23612 100644 --- a/docs/SignaturePacket.html +++ b/docs/SignaturePacket.html @@ -99,7 +99,7 @@ block of text, and a signature that is a certification of a User ID.

Source:
@@ -201,7 +201,7 @@ block of text, and a signature that is a certification of a User ID.

Source:
@@ -271,7 +271,7 @@ block of text, and a signature that is a certification of a User ID.

Source:
@@ -341,7 +341,7 @@ block of text, and a signature that is a certification of a User ID.

Source:
@@ -423,7 +423,7 @@ block of text, and a signature that is a certification of a User ID.

Source:
@@ -599,7 +599,7 @@ block of text, and a signature that is a certification of a User ID.

Source:
@@ -760,7 +760,7 @@ block of text, and a signature that is a certification of a User ID.

Source:
@@ -1048,7 +1048,7 @@ block of text, and a signature that is a certification of a User ID.

Source:
@@ -1427,7 +1427,7 @@ block of text, and a signature that is a certification of a User ID.

Source:
@@ -1546,7 +1546,7 @@ block of text, and a signature that is a certification of a User ID.

Source:
@@ -1654,7 +1654,7 @@ block of text, and a signature that is a certification of a User ID.

Source:
@@ -1765,7 +1765,7 @@ block of text, and a signature that is a certification of a User ID.

Source:
@@ -1833,13 +1833,13 @@ block of text, and a signature that is a certification of a User ID.


diff --git a/docs/SymEncryptedIntegrityProtectedDataPacket.html b/docs/SymEncryptedIntegrityProtectedDataPacket.html index f3c948c2..04cfd19d 100644 --- a/docs/SymEncryptedIntegrityProtectedDataPacket.html +++ b/docs/SymEncryptedIntegrityProtectedDataPacket.html @@ -101,7 +101,7 @@ packet.

Source:
@@ -147,6 +147,150 @@ packet.

+

Members

+ + + +

aeadAlgorithm :enums.aead

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

cipherAlgorithm :enums.symmetric

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

Methods

@@ -334,7 +478,7 @@ packet.

Source:
@@ -594,7 +738,7 @@ packet.

Source:
@@ -687,13 +831,13 @@ packet.


diff --git a/docs/SymEncryptedSessionKeyPacket.html b/docs/SymEncryptedSessionKeyPacket.html index 370d50d7..a2b46c0d 100644 --- a/docs/SymEncryptedSessionKeyPacket.html +++ b/docs/SymEncryptedSessionKeyPacket.html @@ -165,7 +165,7 @@ the Symmetric-Key Encrypted Session Key packet.

Source:
@@ -271,7 +271,7 @@ the Symmetric-Key Encrypted Session Key packet.

Source:
@@ -345,7 +345,7 @@ the Symmetric-Key Encrypted Session Key packet.

Source:
@@ -419,7 +419,7 @@ the Symmetric-Key Encrypted Session Key packet.

Source:
@@ -550,7 +550,7 @@ the Symmetric-Key Encrypted Session Key packet.

Source:
@@ -761,7 +761,7 @@ the Symmetric-Key Encrypted Session Key packet.

Source:
@@ -929,7 +929,7 @@ the Symmetric-Key Encrypted Session Key packet.

Source:
@@ -1019,7 +1019,7 @@ the Symmetric-Key Encrypted Session Key packet.

Source:
@@ -1087,13 +1087,13 @@ the Symmetric-Key Encrypted Session Key packet.


diff --git a/docs/SymmetricallyEncryptedDataPacket.html b/docs/SymmetricallyEncryptedDataPacket.html index 55718315..c7c01bec 100644 --- a/docs/SymmetricallyEncryptedDataPacket.html +++ b/docs/SymmetricallyEncryptedDataPacket.html @@ -101,7 +101,7 @@ that form whole OpenPGP messages).

Source:
@@ -197,7 +197,7 @@ that form whole OpenPGP messages).

Source:
@@ -271,7 +271,7 @@ that form whole OpenPGP messages).

Source:
@@ -477,7 +477,7 @@ See RFC 4880 9.2 f
Source:
@@ -720,7 +720,7 @@ See RFC 4880 9.2 f
Source:
@@ -795,13 +795,13 @@ See RFC 4880 9.2 f
diff --git a/docs/TrustPacket.html b/docs/TrustPacket.html index b2cbafa4..f9ce4086 100644 --- a/docs/TrustPacket.html +++ b/docs/TrustPacket.html @@ -105,7 +105,7 @@ other than local keyring files.

Source:
@@ -216,7 +216,7 @@ Currently not implemented as we ignore trust packets

Source:
@@ -262,13 +262,13 @@ Currently not implemented as we ignore trust packets


diff --git a/docs/UserAttributePacket.html b/docs/UserAttributePacket.html index d48d3906..1e485667 100644 --- a/docs/UserAttributePacket.html +++ b/docs/UserAttributePacket.html @@ -107,7 +107,7 @@ an implementation may use any method desired.

Source:
@@ -266,7 +266,7 @@ an implementation may use any method desired.

Source:
@@ -427,7 +427,7 @@ an implementation may use any method desired.

Source:
@@ -517,7 +517,7 @@ an implementation may use any method desired.

Source:
@@ -585,13 +585,13 @@ an implementation may use any method desired.


diff --git a/docs/UserIDPacket.html b/docs/UserIDPacket.html index 746a0779..78afa335 100644 --- a/docs/UserIDPacket.html +++ b/docs/UserIDPacket.html @@ -100,7 +100,7 @@ specifies the length of the User ID.

Source:
@@ -207,7 +207,7 @@ John Doe john@example.com

Source:
@@ -338,7 +338,7 @@ John Doe john@example.com

Source:
@@ -495,7 +495,7 @@ John Doe john@example.com

Source:
@@ -585,7 +585,7 @@ John Doe john@example.com

Source:
@@ -653,13 +653,13 @@ John Doe john@example.com


diff --git a/docs/global.html b/docs/global.html index 53c0c87b..c2ff19a6 100644 --- a/docs/global.html +++ b/docs/global.html @@ -161,7 +161,7 @@ This is used as fallback if the native Crypto APIs are not available.

Source:
@@ -443,7 +443,7 @@ This is used as fallback if the native Crypto APIs are not available.

Source:
@@ -656,7 +656,7 @@ This is used as fallback if the native Crypto APIs are not available.

Source:
@@ -795,7 +795,7 @@ This is used as fallback if the native Crypto APIs are not available.

Source:
@@ -1204,7 +1204,7 @@ This is used as fallback if the native Crypto APIs are not available.

Source:
@@ -1785,7 +1785,7 @@ One of decryptionKeys, sessionkeys or passwords<
Source:
@@ -1828,7 +1828,8 @@ One of decryptionKeys, sessionkeys or passwords< ] } -where `signatures` contains a separate entry for each signature packet found in the input message. +where `signatures` contains a separate entry for each signature packet found in the input message. +
@@ -2087,7 +2088,7 @@ This method does not change the original key.

Source:
@@ -2446,7 +2447,7 @@ One of decryptionKeys or passwords must be specified.<
Source:
@@ -2511,6 +2512,103 @@ One of decryptionKeys or passwords must be specified.< + + + + + + +

detectBigInt()

+ + + + + + +
+

We don't use the BigIntegerInterface wrapper from noble-hashes because:

+ +
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + @@ -3250,7 +3348,7 @@ must be specified. If signing keys are specified, those will be used to sign the
Source:
@@ -3538,7 +3636,7 @@ This method does not change the original key.

Source:
@@ -4158,7 +4256,7 @@ At least one of encryptionKeys or passwords must be sp
Source:
@@ -4374,7 +4472,7 @@ At least one of encryptionKeys or passwords must be sp
Source:
@@ -4442,7 +4540,8 @@ At least one of encryptionKeys or passwords must be sp
-

Generates a new OpenPGP key pair. Supports RSA and ECC keys. By default, primary and subkeys will be of same type. +

Generates a new OpenPGP key pair. Supports RSA and ECC keys, as well as the newer Curve448 and Curve25519 keys. +By default, primary and subkeys will be of same type. The generated primary key will have signing capabilities. By default, one subkey with encryption capabilities is also generated.

@@ -4573,6 +4672,12 @@ The generated primary key will have signing capabilities. By default, one subkey | 'rsa' +| + +'curve448' +| + +'curve25519' @@ -4598,7 +4703,8 @@ The generated primary key will have signing capabilities. By default, one subkey -

The primary key algorithm type: ECC (default) or RSA

+

The primary key algorithm type: ECC (default for v4 keys), RSA, Curve448 or Curve25519 (new format, default for v6 keys). +Note: Curve448 and Curve25519 (new format) are not widely supported yet.

@@ -4710,13 +4816,13 @@ The generated primary key will have signing capabilities. By default, one subkey - 'curve25519' + 'curve25519Legacy'

Elliptic curve for ECC keys: -curve25519 (default), p256, p384, p521, secp256k1, +curve25519Legacy (default), p256, p384, p521, secp256k1, brainpoolP256r1, brainpoolP384r1, or brainpoolP512r1

@@ -4967,7 +5073,7 @@ default to main key options, except for sign parameter that default
Source:
@@ -5317,7 +5423,7 @@ default to main key options, except for sign parameter that default
Source:
@@ -5501,7 +5607,7 @@ default to main key options, except for sign parameter that default
Source:
@@ -5591,6 +5697,653 @@ default to main key options, except for sign parameter that default +

newS2KFromConfig() → {Object}

+ + + + + + +
+

Instantiate a new S2K instance based on the config settings

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

for unknown or unsupported types

+
+
+
+
+
+
+ Type +
+
+ +Error + + +
+
+
+
+
+ + + + + +
Returns:
+ + +
+

New s2k object

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

newS2KFromType(type) → {Object}

+ + + + + + +
+

Instantiate a new S2K instance of the given type

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
type + + +module:enums.s2k + + + +
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Throws:
+ + + +
+
+
+

for unknown or unsupported types

+
+
+
+
+
+
+ Type +
+
+ +Error + + +
+
+
+
+
+ + + + + +
Returns:
+ + +
+

New s2k object

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

(async) produceEncryptionKey(keyVersion, s2k, passphrase, cipherAlgo, aeadModeopt, serializedPacketTag)

+ + + + + + +
+

Derive encryption key

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
keyVersion + + +Number + + + + + + + + + +

key derivation differs for v5 keys

s2k + + +module:type/s2k + + + + + + + + + +
passphrase + + +String + + + + + + + + + +
cipherAlgo + + +module:enums.symmetric + + + + + + + + + +
aeadMode + + +module:enums.aead + + + + + + <optional>
+ + + + + +

for AEAD-encrypted keys only (excluding v5)

serializedPacketTag + + +Uint8Array + + + + + + + + + +

for AEAD-encrypted keys only (excluding v5)

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

encryption key

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

(async) readCleartextMessage(options) → {Promise.<CleartextMessage>}

@@ -5786,7 +6539,7 @@ default to main key options, except for sign parameter that default
Source:
@@ -6074,7 +6827,7 @@ default to main key options, except for sign parameter that default
Source:
@@ -6362,7 +7115,7 @@ default to main key options, except for sign parameter that default
Source:
@@ -6656,7 +7409,7 @@ default to main key options, except for sign parameter that default
Source:
@@ -6944,7 +7697,7 @@ default to main key options, except for sign parameter that default
Source:
@@ -7232,7 +7985,7 @@ default to main key options, except for sign parameter that default
Source:
@@ -7520,7 +8273,7 @@ default to main key options, except for sign parameter that default
Source:
@@ -7982,7 +8735,7 @@ to set the same date as the key creation time to ensure that old message signatu
Source:
@@ -8511,7 +9264,7 @@ If a revocation certificate is passed, the reasonForRevocation parameter will be
Source:
@@ -8571,6 +9324,215 @@ If a revocation certificate is passed, the reasonForRevocation parameter will be +

(async) runAEAD(fn, key, data) → {Promise.<(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

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +Promise.<(Uint8Array|ReadableStream.<Uint8Array>)> + + +
+
+ + + + + + + + + + + + +

(async) sign(options) → {Promise.<MaybeStream.<(String|Uint8Array)>>}

@@ -9066,7 +10028,7 @@ If a revocation certificate is passed, the reasonForRevocation parameter will be
Source:
@@ -9228,7 +10190,7 @@ the encoded bytes

Source:
@@ -9690,7 +10652,7 @@ an attribute "data" containing a stream of bytes and "type"
Source:
@@ -9732,7 +10694,8 @@ an attribute "data" containing a stream of bytes and "type" ] } -where `signatures` contains a separate entry for each signature packet found in the input message. +where `signatures` contains a separate entry for each signature packet found in the input message. + @@ -9934,7 +10897,7 @@ The new key includes a revocation certificate that must be removed before return
Source:
@@ -9998,13 +10961,13 @@ The new key includes a revocation certificate that must be removed before return
diff --git a/docs/index.html b/docs/index.html index 8a2c2ba6..275ca440 100644 --- a/docs/index.html +++ b/docs/index.html @@ -44,7 +44,7 @@

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.

+

OpenPGP.js is a JavaScript implementation of the OpenPGP protocol. It implements the crypto-refresh (superseding RFC4880 and RFC4880bis).

Table of Contents

  • OpenPGP.js @@ -85,24 +85,24 @@

    Platform Support

    • -

      The dist/openpgp.min.js bundle works well with recent versions of Chrome, Firefox, Safari and Edge.

      +

      The dist/openpgp.min.js (or .mjs) bundle works with recent versions of Chrome, Firefox, Edge and Safari 13+.

    • -

      The dist/node/openpgp.min.js bundle works well in Node.js. It is used by default when you require('openpgp') in Node.js.

      +

      The dist/node/openpgp.min.mjs (or .cjs) bundle works in Node.js v16+: it is used by default when you import ... from 'openpgp' (resp. require('openpgp')).

    • -

      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 +

      Streaming support: the latest versions of Chrome, Firefox, Edge and Safari implement the +Streams specification, including TransformStreams. +These are needed if you use the library with streamed inputs. +In previous versions of OpenPGP.js, WebStreams were automatically polyfilled by the library, +but from v6 this task is left up to the library user, due to the more extensive browser support, and the +polyfilling side-effects. If you're working with older browsers versions which do not implement e.g. TransformStreams, you can manually +load WebStream polyfill. +Please note that when you load the polyfills, the global ReadableStream property (if it exists) gets overwritten with the polyfill version. +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 +the polyfills. There is also the web-streams-adapter library to convert back and forth between them.

    @@ -201,21 +201,19 @@ library to convert back and forth between them.

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

    +

    The library implements authenticated encryption (AEAD) as per the "crypto refresh" draft standard using AES-OCB, EAX, or GCM. This makes symmetric encryption faster on platforms with native implementations. However, since the specification is very recent and other OpenPGP implementations are in the process of adopting it, the feature is currently behind a flag. Note: activating this setting can break compatibility with other OpenPGP implementations which have yet to implement the feature. You can enable it by setting openpgp.config.aeadProtect = true. +Note that this setting has a different effect from the one in OpenPGP.js v5, which implemented support for a provisional version of AEAD from RFC4880bis, which was modified in a later draft of the crypto refresh.

    You can change the AEAD mode by setting one of the following options:

    -
    openpgp.config.preferredAEADAlgorithm = openpgp.enums.aead.eax // Default, native
    -openpgp.config.preferredAEADAlgorithm = openpgp.enums.aead.ocb // Non-native
    -openpgp.config.preferredAEADAlgorithm = openpgp.enums.aead.experimentalGCM // **Non-standard**, fastest
    +
    openpgp.config.preferredAEADAlgorithm = openpgp.enums.aead.ocb; // Default (widest ecosystem support), non-native
    +openpgp.config.preferredAEADAlgorithm = openpgp.enums.aead.gcm; // Native in WebCrypto and Node.js
    +openpgp.config.preferredAEADAlgorithm = openpgp.enums.aead.eax; // Native in Node.js
     
  • -

    For environments that don't provide native crypto, the library falls back to asm.js implementations of AES, SHA-1, and SHA-256.

    +

    For environments that don't provide native crypto, the library falls back to asm.js AES and AEAD implementations.

Getting started

@@ -223,12 +221,12 @@ openpgp.config.preferredAEADAlgorithm = openpgp.enums.aead.experimentalGCM // **

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:

+

And import it as an ES module, from a .mjs file:

import * as openpgp from 'openpgp';
 
+

Or as a CommonJS module:

+
const openpgp = require('openpgp');
+

Deno (experimental)

Import as an ES6 module, using /dist/openpgp.mjs.

import * as openpgp from './openpgpjs/dist/openpgp.mjs';
@@ -708,13 +706,13 @@ and a subkey for encryption using Curve25519.


diff --git a/docs/module-config.html b/docs/module-config.html index 51fef1bb..315e5010 100644 --- a/docs/module-config.html +++ b/docs/module-config.html @@ -89,7 +89,7 @@
Source:
@@ -247,7 +247,7 @@ as a global config setting, but can be used for specific function calls (e.g. de
Source:
@@ -365,7 +365,7 @@ Must be an integer value from 0 to 56.

Source:
@@ -390,8 +390,14 @@ Must be an integer value from 0 to 56.

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

+This option is applicable to:

+
    +
  • key generation (encryption key preferences),
  • +
  • password-based message encryption, and
  • +
  • private key encryption. +In the case of message encryption using public keys, the encryption key preferences are respected instead. +Note: not all OpenPGP implementations are compatible with this option.
  • +
@@ -483,7 +489,7 @@ Note: not all OpenPGP implementations are compatible with this option.
Source:
@@ -493,7 +499,7 @@ Note: not all OpenPGP implementations are compatible with this option.
See:
@@ -608,7 +614,7 @@ where key flags were ignored when selecting a key for encryption.

Source:
@@ -727,7 +733,7 @@ and have self-signature's creation date that does not match the primary key crea
Source:
@@ -848,7 +854,7 @@ This is an insecure setting:

Source:
@@ -875,7 +881,13 @@ This is an insecure setting:

Allow streaming unauthenticated data before its integrity has been checked. This would allow the application to process large streams while limiting memory usage by releasing the decrypted chunks as soon as possible and deferring checking their integrity until the decrypted stream has been read in full.

-

This setting is insecure if the partially decrypted message is processed further or displayed to the user.

+

This setting is insecure if the encrypted data has been corrupted by a malicious entity:

+
    +
  • if the partially decrypted message is processed further or displayed to the user, it opens up the possibility of attacks such as EFAIL +(see https://efail.de/).
  • +
  • an attacker with access to traces or timing info of internal processing errors could learn some info about the data.
  • +
+

NB: this setting does not apply to AEAD-encrypted data, where the AEAD data chunk is never released until integrity is confirmed.

@@ -967,119 +979,7 @@ and deferring checking their integrity until the decrypted stream has been read
Source:
- - - - - - - -
- - - - - - - - -

(static) checksumRequired

- - - - - - - - - - -
Properties:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
checksumRequired - - -Boolean - - - -

Do not throw error when armor is missing a checksum

- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
@@ -1191,7 +1091,7 @@ and deferring checking their integrity until the decrypted stream has been read
Source:
@@ -1313,7 +1213,7 @@ See also constantTimePKCS1DecryptionSupportedSymmetricAlgorithms.Source:
@@ -1431,7 +1331,7 @@ However, the more algorithms are added, the slower the decryption procedure beco
Source:
@@ -1543,7 +1443,7 @@ However, the more algorithms are added, the slower the decryption procedure beco
Source:
@@ -1655,7 +1555,7 @@ However, the more algorithms are added, the slower the decryption procedure beco
Source:
@@ -1767,7 +1667,7 @@ However, the more algorithms are added, the slower the decryption procedure beco
Source:
@@ -1884,7 +1784,7 @@ validation error when the notation is marked as critical.

Source:
@@ -2000,119 +1900,7 @@ validation error when the notation is marked as critical.

Source:
- - - - - - - -
- - - - - - - - -

(static) minBytesForWebCrypto

- - - - - - - - - - -
Properties:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
minBytesForWebCrypto - - -Integer - - - -

The minimum amount of bytes for which to use native WebCrypto APIs when available

- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
@@ -2229,7 +2017,7 @@ The default is 2047 since due to a bug, previous versions of OpenPGP.js could ge
Source:
@@ -2346,7 +2134,7 @@ The default is 2047 since due to a bug, previous versions of OpenPGP.js could ge
Source:
@@ -2463,7 +2251,7 @@ Only has an effect when aeadProtect is set to true.

Source:
@@ -2575,7 +2363,7 @@ Only has an effect when aeadProtect is set to true.

Source:
@@ -2687,7 +2475,7 @@ Only has an effect when aeadProtect is set to true.

Source:
@@ -2799,7 +2587,7 @@ Only has an effect when aeadProtect is set to true.

Source:
@@ -2915,7 +2703,7 @@ Only has an effect when aeadProtect is set to true.

Source:
@@ -3031,7 +2819,7 @@ Only has an effect when aeadProtect is set to true.

Source:
@@ -3147,7 +2935,7 @@ Only has an effect when aeadProtect is set to true.

Source:
@@ -3263,7 +3051,7 @@ Only has an effect when aeadProtect is set to true.

Source:
@@ -3375,7 +3163,222 @@ Only has an effect when aeadProtect is set to true.

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

(static) s2kArgon2Params

+ + + + +
+

draft-crypto-refresh 3.7.1.4: +Argon2 parameters for S2K (String to Key). +Only relevant if config.s2kType is set to enums.s2k.argon2. +Default settings correspond to the second recommendation from RFC9106 ("uniformly safe option"), +to ensure compatibility with memory-constrained environments. +For more details on the choice of parameters, see https://tools.ietf.org/html/rfc9106#section-4.

+
+ + + + + + + +
Properties:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
params + + +Object + + + + +
Properties
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
passes + + +Integer + + + +

number of iterations t

parallelism + + +Integer + + + +

degree of parallelism p

memoryExponent + + +Integer + + + +

one-octet exponent indicating the memory size, which will be: 2**memoryExponent kibibytes.

+ +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
@@ -3399,8 +3402,10 @@ Only has an effect when aeadProtect is set to true.

-

RFC4880 3.7.1.3: -Iteration Count Byte for S2K (String to Key)

+

RFC4880 3.7.1.3: +Iteration Count Byte for Iterated and Salted S2K (String to Key). +Only relevant if config.s2kType is set to enums.s2k.iterated. +Note: this is the exponent value, not the final number of iterations (refer to specs for more details).

@@ -3492,7 +3497,129 @@ Iteration Count Byte for S2K (String to Key)

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

(static) s2kType

+ + + + +
+

S2K (String to Key) type, used for key derivation in the context of secret key encryption +and password-encrypted data. Weaker s2k options are not allowed. +Note: Argon2 is the strongest option but not all OpenPGP implementations are compatible with it +(pending standardisation).

+
+ + + + + + + +
Properties:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
s2kType + + +enums.s2k.argon2 +| + +enums.s2k.iterated + + + +

module:enums.s2k

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
@@ -3604,7 +3731,7 @@ Iteration Count Byte for S2K (String to Key)

Source:
@@ -3716,7 +3843,7 @@ Iteration Count Byte for S2K (String to Key)

Source:
@@ -3734,15 +3861,14 @@ Iteration Count Byte for S2K (String to Key)

-

(static) useIndutnyElliptic

+

(static) useEllipticFallback

-

Whether to use the indutny/elliptic library for curves (other than Curve25519) that are not supported by the available native crypto API. -When false, certain standard curves will not be supported (depending on the platform). -Note: the indutny/elliptic curve library is not designed to be constant time.

+

Whether to use the the noble-curves library for curves (other than Curve25519) that are not supported by the available native crypto API. +When false, certain standard curves will not be supported (depending on the platform).

@@ -3777,7 +3903,7 @@ Note: the indutny/elliptic curve library is not designed to be constant time.

- useIndutnyElliptic + useEllipticFallback @@ -3834,7 +3960,7 @@ Note: the indutny/elliptic curve library is not designed to be constant time.

Source:
@@ -3852,13 +3978,13 @@ Note: the indutny/elliptic curve library is not designed to be constant time.

(static) v5Keys +

(static) v6Keys

-

Use V5 keys. +

Use v6 keys. Note: not all OpenPGP implementations are compatible with this option. FUTURE OPENPGP.JS VERSIONS MAY BREAK COMPATIBILITY WHEN USING THIS OPTION

@@ -3895,7 +4021,7 @@ Note: not all OpenPGP implementations are compatible with this option. - v5Keys + v6Keys @@ -3952,7 +4078,7 @@ Note: not all OpenPGP implementations are compatible with this option.
Source:
@@ -4064,7 +4190,7 @@ Note: not all OpenPGP implementations are compatible with this option.
Source:
@@ -4098,13 +4224,13 @@ Note: not all OpenPGP implementations are compatible with this option.
diff --git a/docs/module-crypto.html b/docs/module-crypto.html new file mode 100644 index 00000000..6360dce9 --- /dev/null +++ b/docs/module-crypto.html @@ -0,0 +1,184 @@ + + + + + JSDoc: Module: crypto + + + + + + + + + + +
+ +

Module: crypto

+ + + + + + +
+ +
+ + + + + +
+ + + +
+ + + + +
+ + + +
+ + + + + + + \ No newline at end of file diff --git a/docs/module-crypto_aes_kw.html b/docs/module-crypto_aes_kw.html new file mode 100644 index 00000000..2150278b --- /dev/null +++ b/docs/module-crypto_aes_kw.html @@ -0,0 +1,553 @@ + + + + + JSDoc: Module: crypto/aes_kw + + + + + + + + + + +
+ +

Module: crypto/aes_kw

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

Implementation of RFC 3394 AES Key Wrap & Key Unwrap funcions

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

Methods

+ + + + + + + +

(static) unwrap(key, data) → {Uint8Array}

+ + + + + + +
+

AES key unwrap

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
key + + +String + + + +
data + + +String + + + +
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Throws:
+ + + +
+ + +Error + + + +
+ + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +Uint8Array + + +
+
+ + + + + + + + + + + + + +

(static) wrap(key, data) → {Uint8Array}

+ + + + + + +
+

AES key wrap

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
key + + +Uint8Array + + + +
data + + +Uint8Array + + + +
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +Uint8Array + + +
+
+ + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ + + + + + + \ No newline at end of file diff --git a/docs/module-crypto_cipher.html b/docs/module-crypto_cipher.html new file mode 100644 index 00000000..089085be --- /dev/null +++ b/docs/module-crypto_cipher.html @@ -0,0 +1,1430 @@ + + + + + JSDoc: Module: crypto/cipher + + + + + + + + + + +
+ +

Module: crypto/cipher

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

Symmetric cryptography functions

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

Methods

+ + + + + + + +

(static) aes128(key) → {Object}

+ + + + + + +
+

AES-128 encryption and decryption (ID 7)

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
key + + +String + + + +

128-bit key

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + +
See:
+
+ +
+ + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +Object + + +
+
+ + + + + + + + + + + + + +

(static) aes192(key) → {Object}

+ + + + + + +
+

AES-128 Block Cipher (ID 8)

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
key + + +String + + + +

192-bit key

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + +
See:
+
+ +
+ + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +Object + + +
+
+ + + + + + + + + + + + + +

(static) aes256(key) → {Object}

+ + + + + + +
+

AES-128 Block Cipher (ID 9)

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
key + + +String + + + +

256-bit key

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + +
See:
+
+ +
+ + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +Object + + +
+
+ + + + + + + + + + + + + +

(static) blowfish(key) → {Object}

+ + + + + + +
+

Blowfish Block Cipher (ID 4)

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
key + + +String + + + +

128-bit key

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + +
See:
+
+ +
+ + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +Object + + +
+
+ + + + + + + + + + + + + +

(static) cast5(key) → {Object}

+ + + + + + +
+

CAST-128 Block Cipher (ID 3)

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
key + + +String + + + +

128-bit key

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + +
See:
+
+ +
+ + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +Object + + +
+
+ + + + + + + + + + + + + +

(static) idea()

+ + + + + + +
+

Not implemented

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

(static) tripledes(key) → {Object}

+ + + + + + +
+

Triple DES Block Cipher (ID 2)

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
key + + +String + + + +

192-bit key

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + +
See:
+
+ +
+ + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +Object + + +
+
+ + + + + + + + + + + + + +

(static) twofish(key) → {Object}

+ + + + + + +
+

Twofish Block Cipher (ID 10)

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
key + + +String + + + +

256-bit key

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + +
See:
+
+ +
+ + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +Object + + +
+
+ + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ + + + + + + \ No newline at end of file diff --git a/docs/module-crypto_cmac.html b/docs/module-crypto_cmac.html new file mode 100644 index 00000000..31aaadf1 --- /dev/null +++ b/docs/module-crypto_cmac.html @@ -0,0 +1,413 @@ + + + + + JSDoc: Module: crypto/cmac + + + + + + + + + + +
+ +

Module: crypto/cmac

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

This module implements AES-CMAC on top of +native AES-CBC using either the WebCrypto API or Node.js' crypto API.

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

Members

+ + + +

(inner, constant) blockLength

+ + + + +
+

This implementation of CMAC is based on the description of OMAC in +http://web.cs.ucdavis.edu/~rogaway/papers/eax.pdf. As per that +document:

+

We have made a small modification to the OMAC algorithm as it was +originally presented, changing one of its two constants. +Specifically, the constant 4 at line 85 was the constant 1/2 (the +multiplicative inverse of 2) in the original definition of OMAC [14]. +The OMAC authors indicate that they will promulgate this modification +[15], which slightly simplifies implementations.

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

Methods

+ + + + + + + +

(inner) rightXORMut(data, padding)

+ + + + + + +
+

xor padding into the end of data. This function implements "the +operation xor→ [which] xors the shorter string into the end of longer +one". Since data is always as least as long as padding, we can +simplify the implementation.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
data + + +Uint8Array + + + +
padding + + +Uint8Array + + + +
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ + + + + + + \ No newline at end of file diff --git a/docs/module-crypto_crypto.html b/docs/module-crypto_crypto.html new file mode 100644 index 00000000..a0105d17 --- /dev/null +++ b/docs/module-crypto_crypto.html @@ -0,0 +1,3000 @@ + + + + + JSDoc: Module: crypto/crypto + + + + + + + + + + +
+ +

Module: crypto/crypto

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

Provides functions for asymmetric encryption and decryption as +well as key generation and parameter handling for all public-key cryptosystems.

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

Methods

+ + + + + + + +

(async, static) generateParams(algo, bits, oid) → {Promise.<{publicParams: {Object}, privateParams: {Object}}>}

+ + + + + + +
+

Generate algorithm-specific key parameters

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
algo + + +module:enums.publicKey + + + +

The public key algorithm

bits + + +Integer + + + +

Bit length for RSA keys

oid + + +module:type/oid + + + +

Object identifier for ECC keys

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

The parameters referenced by name.

+
+ + + +
+
+ Type +
+
+ +Promise.<{publicParams: {Object}, privateParams: {Object}}> + + +
+
+ + + + + + + + + + + + + +

(static) generateSessionKey(algo) → {Uint8Array}

+ + + + + + +
+

Generating a session key for the specified symmetric algorithm +See RFC 4880 9.2 for algorithms.

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

Symmetric encryption algorithm

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

Random bytes as a string to be used as a key.

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

(static) getAEADMode(algo) → {Object}

+ + + + + + +
+

Get implementation of the given AEAD mode

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
algo + + +enums.aead + + + +
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Throws:
+ + + +
+
+
+

on invalid algo

+
+
+
+
+
+
+ Type +
+
+ +Error + + +
+
+
+
+
+ + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +Object + + +
+
+ + + + + + + + + + + + + +

(static) getCurvePayloadSize(algo, oidopt)

+ + + + + + +
+

Get encoded secret size for a given elliptic algo

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
algo + + +module:enums.publicKey + + + + + + + + + +

alrogithm identifier

oid + + +module:type/oid + + + + + + <optional>
+ + + + + +

curve OID if needed by algo

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

(static) getPreferredCurveHashAlgo(algo, oidopt)

+ + + + + + +
+

Get preferred signing hash algo for a given elliptic algo

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
algo + + +module:enums.publicKey + + + + + + + + + +

alrogithm identifier

oid + + +module:type/oid + + + + + + <optional>
+ + + + + +

curve OID if needed by algo

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

(async, static) getPrefixRandom(algo) → {Promise.<Uint8Array>}

+ + + + + + +
+

Generates a random byte prefix for the specified algorithm +See RFC 4880 9.2 for algorithms.

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

Symmetric encryption algorithm

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

Random bytes with length equal to the block size of the cipher, plus the last two bytes repeated.

+
+ + + +
+
+ Type +
+
+ +Promise.<Uint8Array> + + +
+
+ + + + + + + + + + + + + +

(static) parseEncSessionKeyParams(algo, bytes) → {Object}

+ + + + + + +
+

Returns the types comprising the encrypted session key of an algorithm

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
algo + + +module:enums.publicKey + + + +

The key algorithm

bytes + + +Uint8Array + + + +

The key material to parse

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

The session key parameters referenced by name.

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

(static) parsePrivateKeyParams(algo, bytes, publicParams) → {Object}

+ + + + + + +
+

Parse private key material in binary form to get the key parameters

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
algo + + +module:enums.publicKey + + + +

The key algorithm

bytes + + +Uint8Array + + + +

The key material to parse

publicParams + + +Object + + + +

(ECC only) public params, needed to format some private params

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

Number of read bytes plus the key parameters referenced by name.

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

(static) parsePublicKeyParams(algo, bytes) → {Object}

+ + + + + + +
+

Parse public key material in binary form to get the key parameters

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
algo + + +module:enums.publicKey + + + +

The key algorithm

bytes + + +Uint8Array + + + +

The key material to parse

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

Number of read bytes plus key parameters referenced by name.

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

(async, static) publicKeyDecrypt(algo, publicKeyParams, privateKeyParams, sessionKeyParams, fingerprint, randomPayloadopt) → {Promise.<Uint8Array>}

+ + + + + + +
+

Decrypts data using specified algorithm and private key parameters. +See RFC 4880 5.5.3

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
algo + + +module:enums.publicKey + + + + + + + + + +

Public key algorithm

publicKeyParams + + +Object + + + + + + + + + +

Algorithm-specific public key parameters

privateKeyParams + + +Object + + + + + + + + + +

Algorithm-specific private key parameters

sessionKeyParams + + +Object + + + + + + + + + +

Encrypted session key parameters

fingerprint + + +Uint8Array + + + + + + + + + +

Recipient fingerprint

randomPayload + + +Uint8Array + + + + + + <optional>
+ + + + + +

Data to return on decryption error, instead of throwing +(needed for constant-time processing in RSA and ElGamal)

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

on sensitive decryption error, unless randomPayload is given

+
+
+
+
+
+
+ Type +
+
+ +Error + + +
+
+
+
+
+ + + + + +
Returns:
+ + +
+

Decrypted data.

+
+ + + +
+
+ Type +
+
+ +Promise.<Uint8Array> + + +
+
+ + + + + + + + + + + + + +

(async, static) publicKeyEncrypt(keyAlgo, symmetricAlgo, publicParams, data, fingerprint) → {Promise.<Object>}

+ + + + + + +
+

Encrypts data using specified algorithm and public key parameters. +See RFC 4880 9.1 for public key algorithms.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
keyAlgo + + +module:enums.publicKey + + + +

Public key algorithm

symmetricAlgo + + +module:enums.symmetric + + + +

Cipher algorithm

publicParams + + +Object + + + +

Algorithm-specific public key parameters

data + + +Uint8Array + + + +

Session key data to be encrypted

fingerprint + + +Uint8Array + + + +

Recipient fingerprint

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

Encrypted session key parameters.

+
+ + + +
+
+ Type +
+
+ +Promise.<Object> + + +
+
+ + + + + + + + + + + + + +

(static) serializeParams(algo, params) → {Uint8Array}

+ + + + + + +
+

Convert params to MPI and serializes them in the proper order

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
algo + + +module:enums.publicKey + + + +

The public key algorithm

params + + +Object + + + +

The key parameters indexed by name

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

The array containing the MPIs.

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

(async, static) validateParams(algo, publicParams, privateParams) → {Promise.<Boolean>}

+ + + + + + +
+

Validate algorithm-specific key parameters

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
algo + + +module:enums.publicKey + + + +

The public key algorithm

publicParams + + +Object + + + +

Algorithm-specific public key parameters

privateParams + + +Object + + + +

Algorithm-specific private key parameters

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

Whether the parameters are valid.

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

(inner) checkSupportedCurve(oid)

+ + + + + + +
+

Check whether the given curve OID is supported

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
oid + + +module:type/oid + + + +

EC object identifier

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

if curve is not supported

+
+
+
+
+
+
+ Type +
+
+ +UnsupportedError + + +
+
+
+
+
+ + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ + + + + + + \ No newline at end of file diff --git a/docs/module-crypto_hash.html b/docs/module-crypto_hash.html new file mode 100644 index 00000000..1e4de57d --- /dev/null +++ b/docs/module-crypto_hash.html @@ -0,0 +1,596 @@ + + + + + JSDoc: Module: crypto/hash + + + + + + + + + + +
+ +

Module: crypto/hash

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

Provides an interface to hashing functions available in Node.js or external libraries.

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

Members

+ + + +

(static) md5

+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + +
See:
+
+
    +
  • module:md5
  • +
+
+ + + +
+ + + + + + + + + + +

Methods

+ + + + + + + +

(static) digest(algo, data) → {Promise.<Uint8Array>}

+ + + + + + +
+

Create a hash on the specified data using the specified algorithm

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
algo + + +module:enums.hash + + + +

Hash algorithm type (see RFC 4880 9.4)

data + + +Uint8Array + + + +

Data to be hashed

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

Hash value.

+
+ + + +
+
+ Type +
+
+ +Promise.<Uint8Array> + + +
+
+ + + + + + + + + + + + + +

(static) getHashByteLength(algo) → {Integer}

+ + + + + + +
+

Returns the hash size in bytes of the specified hash algorithm type

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
algo + + +module:enums.hash + + + +

Hash algorithm type (See RFC 4880 9.4)

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

Size in bytes of the resulting hash.

+
+ + + +
+
+ Type +
+
+ +Integer + + +
+
+ + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ + + + + + + \ No newline at end of file diff --git a/docs/module-crypto_hkdf.html b/docs/module-crypto_hkdf.html new file mode 100644 index 00000000..08e03208 --- /dev/null +++ b/docs/module-crypto_hkdf.html @@ -0,0 +1,167 @@ + + + + + JSDoc: Module: crypto/hkdf + + + + + + + + + + +
+ +

Module: crypto/hkdf

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

This module implements HKDF using either the WebCrypto API or Node.js' crypto API.

+ + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ + + + + + + \ No newline at end of file diff --git a/docs/module-crypto_mode.html b/docs/module-crypto_mode.html new file mode 100644 index 00000000..766568b7 --- /dev/null +++ b/docs/module-crypto_mode.html @@ -0,0 +1,439 @@ + + + + + JSDoc: Module: crypto/mode + + + + + + + + + + +
+ +

Module: crypto/mode

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

Cipher modes

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

Members

+ + + +

(static) cfb

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

(static) eax

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

(static) gcm

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

(static) ocb

+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + +
See:
+
+ +
+ + + +
+ + + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ + + + + + + \ No newline at end of file diff --git a/docs/module-crypto_mode_cfb.html b/docs/module-crypto_mode_cfb.html new file mode 100644 index 00000000..2aa1d209 --- /dev/null +++ b/docs/module-crypto_mode_cfb.html @@ -0,0 +1,548 @@ + + + + + JSDoc: Module: crypto/mode/cfb + + + + + + + + + + +
+ +

Module: crypto/mode/cfb

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

Methods

+ + + + + + + +

(static) decrypt(algo, key, ciphertext, iv)

+ + + + + + +
+

CFB decryption

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
algo + + +enums.symmetric + + + +

block cipher algorithm

key + + +Uint8Array + + + +
ciphertext + + +MaybeStream.<Uint8Array> + + + +
iv + + +Uint8Array + + + +
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

MaybeStream

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

(static) encrypt(algo, key, plaintext, iv, config)

+ + + + + + +
+

CFB encryption

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
algo + + +enums.symmetric + + + +

block cipher algorithm

key + + +Uint8Array + + + +
plaintext + + +MaybeStream.<Uint8Array> + + + +
iv + + +Uint8Array + + + +
config + + +Object + + + +

full configuration, defaults to openpgp.config

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

MaybeStream

+
+ + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ + + + + + + \ No newline at end of file diff --git a/docs/module-crypto_mode_eax.html b/docs/module-crypto_mode_eax.html new file mode 100644 index 00000000..76aa3551 --- /dev/null +++ b/docs/module-crypto_mode_eax.html @@ -0,0 +1,748 @@ + + + + + JSDoc: Module: crypto/mode/eax + + + + + + + + + + +
+ +

Module: crypto/mode/eax

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

This module implements AES-EAX en/decryption on top of +native AES-CTR using either the WebCrypto API or Node.js' crypto API.

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

Methods

+ + + + + + + +

(inner) decrypt(ciphertext, nonce, adata) → {Promise.<Uint8Array>}

+ + + + + + +
+

Decrypt ciphertext input.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
ciphertext + + +Uint8Array + + + +

The ciphertext input to be decrypted

nonce + + +Uint8Array + + + +

The nonce (16 bytes)

adata + + +Uint8Array + + + +

Associated data to verify

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

The plaintext output.

+
+ + + +
+
+ Type +
+
+ +Promise.<Uint8Array> + + +
+
+ + + + + + + + + + + + + +

(async, inner) EAX(cipher, key)

+ + + + + + +
+

Class to en/decrypt using EAX mode.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
cipher + + +enums.symmetric + + + +

The symmetric cipher algorithm to use

key + + +Uint8Array + + + +

The encryption key

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

(inner) encrypt(plaintext, nonce, adata) → {Promise.<Uint8Array>}

+ + + + + + +
+

Encrypt plaintext input.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
plaintext + + +Uint8Array + + + +

The cleartext input to be encrypted

nonce + + +Uint8Array + + + +

The nonce (16 bytes)

adata + + +Uint8Array + + + +

Associated data to sign

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

The ciphertext output.

+
+ + + +
+
+ Type +
+
+ +Promise.<Uint8Array> + + +
+
+ + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ + + + + + + \ No newline at end of file diff --git a/docs/module-crypto_mode_gcm.html b/docs/module-crypto_mode_gcm.html new file mode 100644 index 00000000..c9911464 --- /dev/null +++ b/docs/module-crypto_mode_gcm.html @@ -0,0 +1,334 @@ + + + + + JSDoc: Module: crypto/mode/gcm + + + + + + + + + + +
+ +

Module: crypto/mode/gcm

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

This module wraps native AES-GCM en/decryption for both +the WebCrypto api as well as node.js' crypto api.

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

Methods

+ + + + + + + +

(async, inner) GCM(cipher, key)

+ + + + + + +
+

Class to en/decrypt using GCM mode.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
cipher + + +enums.symmetric + + + +

The symmetric cipher algorithm to use

key + + +Uint8Array + + + +

The encryption key

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ + + + + + + \ No newline at end of file diff --git a/docs/module-crypto_mode_ocb.html b/docs/module-crypto_mode_ocb.html new file mode 100644 index 00000000..19dceb00 --- /dev/null +++ b/docs/module-crypto_mode_ocb.html @@ -0,0 +1,747 @@ + + + + + JSDoc: Module: crypto/mode/ocb + + + + + + + + + + +
+ +

Module: crypto/mode/ocb

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

This module implements AES-OCB en/decryption.

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

Methods

+ + + + + + + +

(inner) decrypt(ciphertext, nonce, adata) → {Promise.<Uint8Array>}

+ + + + + + +
+

Decrypt ciphertext input.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
ciphertext + + +Uint8Array + + + +

The ciphertext input to be decrypted

nonce + + +Uint8Array + + + +

The nonce (15 bytes)

adata + + +Uint8Array + + + +

Associated data to sign

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

The ciphertext output.

+
+ + + +
+
+ Type +
+
+ +Promise.<Uint8Array> + + +
+
+ + + + + + + + + + + + + +

(inner) encrypt(plaintext, nonce, adata) → {Promise.<Uint8Array>}

+ + + + + + +
+

Encrypt plaintext input.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
plaintext + + +Uint8Array + + + +

The cleartext input to be encrypted

nonce + + +Uint8Array + + + +

The nonce (15 bytes)

adata + + +Uint8Array + + + +

Associated data to sign

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

The ciphertext output.

+
+ + + +
+
+ Type +
+
+ +Promise.<Uint8Array> + + +
+
+ + + + + + + + + + + + + +

(async, inner) OCB(cipher, key)

+ + + + + + +
+

Class to en/decrypt using OCB mode.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
cipher + + +enums.symmetric + + + +

The symmetric cipher algorithm to use

key + + +Uint8Array + + + +

The encryption key

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ + + + + + + \ No newline at end of file diff --git a/docs/module-crypto_pkcs1.html b/docs/module-crypto_pkcs1.html new file mode 100644 index 00000000..2a8616b5 --- /dev/null +++ b/docs/module-crypto_pkcs1.html @@ -0,0 +1,882 @@ + + + + + JSDoc: Module: crypto/pkcs1 + + + + + + + + + + +
+ +

Module: crypto/pkcs1

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

Provides EME-PKCS1-v1_5 encoding and decoding and EMSA-PKCS1-v1_5 encoding function

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

Members

+ + + +

(inner, constant) hash_headers

+ + + + +
+

ASN1 object identifiers for hashes

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

Methods

+ + + + + + + +

(static) emeDecode(encoded, randomPayload) → {Uint8Array}

+ + + + + + +
+

Decode a EME-PKCS1-v1_5 padded message

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
encoded + + +Uint8Array + + + +

Encoded message bytes

randomPayload + + +Uint8Array + + + +

Data to return in case of decoding error (needed for constant-time processing)

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

on decoding failure, unless randomPayload is provided

+
+
+
+
+
+
+ Type +
+
+ +Error + + +
+
+
+
+
+ + + + + +
Returns:
+ + +
+

decoded data or randomPayload (on error, if given)

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

(static) emeEncode(message, keyLength) → {Uint8Array}

+ + + + + + +
+

Create a EME-PKCS1-v1_5 padded message

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
message + + +Uint8Array + + + +

Message to be encoded

keyLength + + +Integer + + + +

The length in octets of the key modulus

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

EME-PKCS1 padded message.

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

(static) emsaEncode(algo, hashed, emLen) → {Uint8Array}

+ + + + + + +
+

Create a EMSA-PKCS1-v1_5 padded message

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
algo + + +Integer + + + +

Hash algorithm type used

hashed + + +Uint8Array + + + +

Message to be encoded

emLen + + +Integer + + + +

Intended length in octets of the encoded message

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

Encoded message.

+
+ + + +
+
+ Type +
+
+ +Uint8Array + + +
+
+ + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ + + + + + + \ No newline at end of file diff --git a/docs/module-crypto_public_key.html b/docs/module-crypto_public_key.html new file mode 100644 index 00000000..c052971f --- /dev/null +++ b/docs/module-crypto_public_key.html @@ -0,0 +1,439 @@ + + + + + JSDoc: Module: crypto/public_key + + + + + + + + + + +
+ +

Module: crypto/public_key

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

Asymmetric cryptography functions

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

Members

+ + + +

(static) dsa

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

(static) elgamal

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

(static) elliptic

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

(static) rsa

+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + +
See:
+
+ +
+ + + +
+ + + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ + + + + + + \ No newline at end of file diff --git a/docs/module-crypto_public_key_dsa.html b/docs/module-crypto_public_key_dsa.html new file mode 100644 index 00000000..aa017bee --- /dev/null +++ b/docs/module-crypto_public_key_dsa.html @@ -0,0 +1,1084 @@ + + + + + JSDoc: Module: crypto/public_key/dsa + + + + + + + + + + +
+ +

Module: crypto/public_key/dsa

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

A Digital signature algorithm implementation

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

Members

+ + + +

(inner) x

+ + + + +
+

Re-derive public key y' = g ** x mod p +Expect y == y'

+

Blinded exponentiation computes g**{rq + x} to compare to y

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

Methods

+ + + + + + + +

(async, static) sign(hashAlgo, hashed, g, p, q, x) → {Promise.<{r: Uint8Array, s: Uint8Array}>}

+ + + + + + +
+

DSA Sign function

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
hashAlgo + + +Integer + + + +
hashed + + +Uint8Array + + + +
g + + +Uint8Array + + + +
p + + +Uint8Array + + + +
q + + +Uint8Array + + + +
x + + +Uint8Array + + + +
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +Promise.<{r: Uint8Array, s: Uint8Array}> + + +
+
+ + + + + + + + + + + + + +

(async, static) validateParams(p, q, g, y, x) → {Promise.<Boolean>}

+ + + + + + +
+

Validate DSA parameters

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
p + + +Uint8Array + + + +

DSA prime

q + + +Uint8Array + + + +

DSA group order

g + + +Uint8Array + + + +

DSA sub-group generator

y + + +Uint8Array + + + +

DSA public key

x + + +Uint8Array + + + +

DSA private key

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

Whether params are valid.

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

(async, static) verify(hashAlgo, r, s, hashed, g, p, q, y) → {boolean}

+ + + + + + +
+

DSA Verify function

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
hashAlgo + + +Integer + + + +
r + + +Uint8Array + + + +
s + + +Uint8Array + + + +
hashed + + +Uint8Array + + + +
g + + +Uint8Array + + + +
p + + +Uint8Array + + + +
q + + +Uint8Array + + + +
y + + +Uint8Array + + + +
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +boolean + + +
+
+ + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ + + + + + + \ No newline at end of file diff --git a/docs/module-crypto_public_key_elgamal.html b/docs/module-crypto_public_key_elgamal.html new file mode 100644 index 00000000..a4e8c423 --- /dev/null +++ b/docs/module-crypto_public_key_elgamal.html @@ -0,0 +1,981 @@ + + + + + JSDoc: Module: crypto/public_key/elgamal + + + + + + + + + + +
+ +

Module: crypto/public_key/elgamal

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

ElGamal implementation

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

Members

+ + + +

(inner) x

+ + + + +
+

Re-derive public key y' = g ** x mod p +Expect y == y'

+

Blinded exponentiation computes g**{r(p-1) + x} to compare to y

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

Methods

+ + + + + + + +

(async, static) decrypt(c1, c2, p, x, randomPayload) → {Promise.<Uint8Array>}

+ + + + + + +
+

ElGamal Encryption function

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
c1 + + +Uint8Array + + + +
c2 + + +Uint8Array + + + +
p + + +Uint8Array + + + +
x + + +Uint8Array + + + +
randomPayload + + +Uint8Array + + + +

Data to return on unpadding error, instead of throwing +(needed for constant-time processing)

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

on decryption error, unless randomPayload is given

+
+
+
+
+
+
+ Type +
+
+ +Error + + +
+
+
+
+
+ + + + + +
Returns:
+ + +
+

Unpadded message.

+
+ + + +
+
+ Type +
+
+ +Promise.<Uint8Array> + + +
+
+ + + + + + + + + + + + + +

(async, static) encrypt(data, p, g, y) → {Promise.<{c1: Uint8Array, c2: Uint8Array}>}

+ + + + + + +
+

ElGamal Encryption function +Note that in OpenPGP, the message needs to be padded with PKCS#1 (same as RSA)

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
data + + +Uint8Array + + + +

To be padded and encrypted

p + + +Uint8Array + + + +
g + + +Uint8Array + + + +
y + + +Uint8Array + + + +
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +Promise.<{c1: Uint8Array, c2: Uint8Array}> + + +
+
+ + + + + + + + + + + + + +

(async, static) validateParams(p, g, y, x) → {Promise.<Boolean>}

+ + + + + + +
+

Validate ElGamal parameters

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
p + + +Uint8Array + + + +

ElGamal prime

g + + +Uint8Array + + + +

ElGamal group generator

y + + +Uint8Array + + + +

ElGamal public key

x + + +Uint8Array + + + +

ElGamal private exponent

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

Whether params are valid.

+
+ + + +
+
+ Type +
+
+ +Promise.<Boolean> + + +
+
+ + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ + + + + + + \ No newline at end of file diff --git a/docs/module-crypto_public_key_elliptic.html b/docs/module-crypto_public_key_elliptic.html new file mode 100644 index 00000000..f116206b --- /dev/null +++ b/docs/module-crypto_public_key_elliptic.html @@ -0,0 +1,180 @@ + + + + + JSDoc: Module: crypto/public_key/elliptic + + + + + + + + + + +
+ +

Module: crypto/public_key/elliptic

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

Functions to access Elliptic Curve Cryptography

+ + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + +
See:
+
+ +
+ + + +
+ + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ + + + + + + \ No newline at end of file diff --git a/docs/module-crypto_public_key_elliptic_curve.html b/docs/module-crypto_public_key_elliptic_curve.html new file mode 100644 index 00000000..b925f144 --- /dev/null +++ b/docs/module-crypto_public_key_elliptic_curve.html @@ -0,0 +1,1149 @@ + + + + + JSDoc: Module: crypto/public_key/elliptic/curve + + + + + + + + + + +
+ +

Module: crypto/public_key/elliptic/curve

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

Wrapper of an instance of an Elliptic Curve

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

Methods

+ + + + + + + +

(inner) getPreferredHashAlgo(oid) → {enums.hash}

+ + + + + + +
+

Get preferred hash algo to use with the given curve

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
oid + + +module:type/oid + + + +

curve oid

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

hash algorithm

+
+ + + +
+
+ Type +
+
+ +enums.hash + + +
+
+ + + + + + + + + + + + + +

(inner) jwkToRawPublic(jwk) → {Uint8Array}

+ + + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
jwk + + +JsonWebKey + + + +

key for conversion

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

Raw public key.

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

(inner) privateToJWK(payloadSize, name, publicKey, privateKey) → {JsonWebKey}

+ + + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
payloadSize + + +Integer + + + +

ec payload size

name + + +String + + + +

curve name

publicKey + + +Uint8Array + + + +

public key

privateKey + + +Uint8Array + + + +

private key

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

Private key in jwk format.

+
+ + + +
+
+ Type +
+
+ +JsonWebKey + + +
+
+ + + + + + + + + + + + + +

(inner) rawPublicToJWK(payloadSize, name, publicKey) → {JsonWebKey}

+ + + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
payloadSize + + +Integer + + + +

ec payload size

name + + +String + + + +

curve name

publicKey + + +Uint8Array + + + +

public key

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

Public key in jwk format.

+
+ + + +
+
+ Type +
+
+ +JsonWebKey + + +
+
+ + + + + + + + + + + + + +

(async, inner) validateStandardParams(algo, oid, Q, d) → {Promise.<Boolean>}

+ + + + + + +
+

Validate ECDH and ECDSA parameters +Not suitable for EdDSA (different secret key format)

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
algo + + +module:enums.publicKey + + + +

EC algorithm, to filter supported curves

oid + + +module:type/oid + + + +

EC object identifier

Q + + +Uint8Array + + + +

EC public point

d + + +Uint8Array + + + +

EC secret scalar

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

Whether params are valid.

+
+ + + +
+
+ Type +
+
+ +Promise.<Boolean> + + +
+
+ + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ + + + + + + \ No newline at end of file diff --git a/docs/module-crypto_public_key_elliptic_ecdh.html b/docs/module-crypto_public_key_elliptic_ecdh.html new file mode 100644 index 00000000..8c83d512 --- /dev/null +++ b/docs/module-crypto_public_key_elliptic_ecdh.html @@ -0,0 +1,6011 @@ + + + + + JSDoc: Module: crypto/public_key/elliptic/ecdh + + + + + + + + + + +
+ +

Module: crypto/public_key/elliptic/ecdh

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

Key encryption and decryption for RFC 6637 ECDH

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

Methods

+ + + + + + + +

(async, static) decrypt(oid, kdfParams, V, C, Q, d, fingerprint) → {Promise.<Uint8Array>}

+ + + + + + +
+

Decrypt and unwrap the value derived from session key

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
oid + + +module:type/oid + + + +

Elliptic curve object identifier

kdfParams + + +module:type/kdf_params + + + +

KDF params including cipher and algorithm to use

V + + +Uint8Array + + + +

Public part of ephemeral key

C + + +Uint8Array + + + +

Encrypted and wrapped value derived from session key

Q + + +Uint8Array + + + +

Recipient public key

d + + +Uint8Array + + + +

Recipient private key

fingerprint + + +Uint8Array + + + +

Recipient fingerprint

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

Value derived from session key.

+
+ + + +
+
+ Type +
+
+ +Promise.<Uint8Array> + + +
+
+ + + + + + + + + + + + + +

(async, static) decrypt(algo, ephemeralPublicKey, wrappedKey,, A, k) → {Promise.<Uint8Array>}

+ + + + + + +
+

Decrypt and unwrap the session key

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
algo + + +module:enums.publicKey + + + +

Algorithm identifier

ephemeralPublicKey + + +Uint8Array + + + +

(K_A)

wrappedKey, + + +Uint8Array + + + +
A + + +Uint8Array + + + +

Recipient public key (K_b), needed for KDF

k + + +Uint8Array + + + +

Recipient secret key (b)

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

decrypted session key data

+
+ + + +
+
+ Type +
+
+ +Promise.<Uint8Array> + + +
+
+ + + + + + + + + + + + + +

(async, static) encrypt(oid, kdfParams, data, Q, fingerprint) → {Promise.<{publicKey: Uint8Array, wrappedKey: Uint8Array}>}

+ + + + + + +
+

Encrypt and wrap a session key

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
oid + + +module:type/oid + + + +

Elliptic curve object identifier

kdfParams + + +module:type/kdf_params + + + +

KDF params including cipher and algorithm to use

data + + +Uint8Array + + + +

Unpadded session key data

Q + + +Uint8Array + + + +

Recipient public key

fingerprint + + +Uint8Array + + + +

Recipient fingerprint

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +Promise.<{publicKey: Uint8Array, wrappedKey: Uint8Array}> + + +
+
+ + + + + + + + + + + + + +

(async, static) encrypt(algo, data, recipientA) → {Promise.<{ephemeralPublicKey: Uint8Array, wrappedKey: Uint8Array}>}

+ + + + + + +
+

Wrap and encrypt a session key

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
algo + + +module:enums.publicKey + + + +

Algorithm identifier

data + + +Uint8Array + + + +

session key data to be encrypted

recipientA + + +Uint8Array + + + +

Recipient public key (K_B)

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

ephemeral public key (K_A) and encrypted key

+
+ + + +
+
+ Type +
+
+ +Promise.<{ephemeralPublicKey: Uint8Array, wrappedKey: Uint8Array}> + + +
+
+ + + + + + + + + + + + + +

(static) generate(algo) → {Promise.<{A: Uint8Array, k: Uint8Array}>}

+ + + + + + +
+

Generate ECDH key for Montgomery curves

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
algo + + +module:enums.publicKey + + + +

Algorithm identifier

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +Promise.<{A: Uint8Array, k: Uint8Array}> + + +
+
+ + + + + + + + + + + + + +

(async, static) validateParams(oid, Q, d) → {Promise.<Boolean>}

+ + + + + + +
+

Validate ECDH parameters

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
oid + + +module:type/oid + + + +

Elliptic curve object identifier

Q + + +Uint8Array + + + +

ECDH public point

d + + +Uint8Array + + + +

ECDH secret scalar

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

Whether params are valid.

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

(async, static) validateParams(algo, A, k) → {Promise.<Boolean>}

+ + + + + + +
+

Validate ECDH parameters

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
algo + + +module:enums.publicKey + + + +

Algorithm identifier

A + + +Uint8Array + + + +

ECDH public point

k + + +Uint8Array + + + +

ECDH secret scalar

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

Whether params are valid.

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

(async, inner) genPrivateEphemeralKey(curve, V, Q, d) → {Promise.<{secretKey: Uint8Array, sharedKey: Uint8Array}>}

+ + + + + + +
+

Generate ECDHE secret from private key and public part of ephemeral key

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
curve + + +CurveWithOID + + + +

Elliptic curve object

V + + +Uint8Array + + + +

Public part of ephemeral key

Q + + +Uint8Array + + + +

Recipient public key

d + + +Uint8Array + + + +

Recipient private key

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +Promise.<{secretKey: Uint8Array, sharedKey: Uint8Array}> + + +
+
+ + + + + + + + + + + + + +

(async, inner) genPublicEphemeralKey(curve, Q) → {Promise.<{publicKey: Uint8Array, sharedKey: Uint8Array}>}

+ + + + + + +
+

Generate ECDHE ephemeral key and secret from public key

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
curve + + +CurveWithOID + + + +

Elliptic curve object

Q + + +Uint8Array + + + +

Recipient public key

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +Promise.<{publicKey: Uint8Array, sharedKey: Uint8Array}> + + +
+
+ + + + + + + + + + + + + +

(async, inner) nodePrivateEphemeralKey(curve, V, d) → {Promise.<{secretKey: Uint8Array, sharedKey: Uint8Array}>}

+ + + + + + +
+

Generate ECDHE secret from private key and public part of ephemeral key using nodeCrypto

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
curve + + +CurveWithOID + + + +

Elliptic curve object

V + + +Uint8Array + + + +

Public part of ephemeral key

d + + +Uint8Array + + + +

Recipient private key

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +Promise.<{secretKey: Uint8Array, sharedKey: Uint8Array}> + + +
+
+ + + + + + + + + + + + + +

(async, inner) nodePublicEphemeralKey(curve, Q) → {Promise.<{publicKey: Uint8Array, sharedKey: Uint8Array}>}

+ + + + + + +
+

Generate ECDHE ephemeral key and secret from public key using nodeCrypto

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
curve + + +CurveWithOID + + + +

Elliptic curve object

Q + + +Uint8Array + + + +

Recipient public key

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +Promise.<{publicKey: Uint8Array, sharedKey: Uint8Array}> + + +
+
+ + + + + + + + + + + + + +

(async, inner) webPrivateEphemeralKey(curve, V, Q, d) → {Promise.<{secretKey: Uint8Array, sharedKey: Uint8Array}>}

+ + + + + + +
+

Generate ECDHE secret from private key and public part of ephemeral key using webCrypto

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
curve + + +CurveWithOID + + + +

Elliptic curve object

V + + +Uint8Array + + + +

Public part of ephemeral key

Q + + +Uint8Array + + + +

Recipient public key

d + + +Uint8Array + + + +

Recipient private key

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +Promise.<{secretKey: Uint8Array, sharedKey: Uint8Array}> + + +
+
+ + + + + + + + + + + + + +

(async, inner) webPublicEphemeralKey(curve, Q) → {Promise.<{publicKey: Uint8Array, sharedKey: Uint8Array}>}

+ + + + + + +
+

Generate ECDHE ephemeral key and secret from public key using webCrypto

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
curve + + +CurveWithOID + + + +

Elliptic curve object

Q + + +Uint8Array + + + +

Recipient public key

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +Promise.<{publicKey: Uint8Array, sharedKey: Uint8Array}> + + +
+
+ + + + + + + + + + + + + +
+ +
+ + + + + + + +
+ +
+ + + + + + + +
+ +
+
+ + +

Key encryption and decryption for RFC 6637 ECDH

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

Methods

+ + + + + + + +

(async, static) decrypt(oid, kdfParams, V, C, Q, d, fingerprint) → {Promise.<Uint8Array>}

+ + + + + + +
+

Decrypt and unwrap the value derived from session key

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
oid + + +module:type/oid + + + +

Elliptic curve object identifier

kdfParams + + +module:type/kdf_params + + + +

KDF params including cipher and algorithm to use

V + + +Uint8Array + + + +

Public part of ephemeral key

C + + +Uint8Array + + + +

Encrypted and wrapped value derived from session key

Q + + +Uint8Array + + + +

Recipient public key

d + + +Uint8Array + + + +

Recipient private key

fingerprint + + +Uint8Array + + + +

Recipient fingerprint

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

Value derived from session key.

+
+ + + +
+
+ Type +
+
+ +Promise.<Uint8Array> + + +
+
+ + + + + + + + + + + + + +

(async, static) decrypt(algo, ephemeralPublicKey, wrappedKey,, A, k) → {Promise.<Uint8Array>}

+ + + + + + +
+

Decrypt and unwrap the session key

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
algo + + +module:enums.publicKey + + + +

Algorithm identifier

ephemeralPublicKey + + +Uint8Array + + + +

(K_A)

wrappedKey, + + +Uint8Array + + + +
A + + +Uint8Array + + + +

Recipient public key (K_b), needed for KDF

k + + +Uint8Array + + + +

Recipient secret key (b)

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

decrypted session key data

+
+ + + +
+
+ Type +
+
+ +Promise.<Uint8Array> + + +
+
+ + + + + + + + + + + + + +

(async, static) encrypt(oid, kdfParams, data, Q, fingerprint) → {Promise.<{publicKey: Uint8Array, wrappedKey: Uint8Array}>}

+ + + + + + +
+

Encrypt and wrap a session key

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
oid + + +module:type/oid + + + +

Elliptic curve object identifier

kdfParams + + +module:type/kdf_params + + + +

KDF params including cipher and algorithm to use

data + + +Uint8Array + + + +

Unpadded session key data

Q + + +Uint8Array + + + +

Recipient public key

fingerprint + + +Uint8Array + + + +

Recipient fingerprint

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +Promise.<{publicKey: Uint8Array, wrappedKey: Uint8Array}> + + +
+
+ + + + + + + + + + + + + +

(async, static) encrypt(algo, data, recipientA) → {Promise.<{ephemeralPublicKey: Uint8Array, wrappedKey: Uint8Array}>}

+ + + + + + +
+

Wrap and encrypt a session key

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
algo + + +module:enums.publicKey + + + +

Algorithm identifier

data + + +Uint8Array + + + +

session key data to be encrypted

recipientA + + +Uint8Array + + + +

Recipient public key (K_B)

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

ephemeral public key (K_A) and encrypted key

+
+ + + +
+
+ Type +
+
+ +Promise.<{ephemeralPublicKey: Uint8Array, wrappedKey: Uint8Array}> + + +
+
+ + + + + + + + + + + + + +

(static) generate(algo) → {Promise.<{A: Uint8Array, k: Uint8Array}>}

+ + + + + + +
+

Generate ECDH key for Montgomery curves

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
algo + + +module:enums.publicKey + + + +

Algorithm identifier

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +Promise.<{A: Uint8Array, k: Uint8Array}> + + +
+
+ + + + + + + + + + + + + +

(async, static) validateParams(oid, Q, d) → {Promise.<Boolean>}

+ + + + + + +
+

Validate ECDH parameters

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
oid + + +module:type/oid + + + +

Elliptic curve object identifier

Q + + +Uint8Array + + + +

ECDH public point

d + + +Uint8Array + + + +

ECDH secret scalar

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

Whether params are valid.

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

(async, static) validateParams(algo, A, k) → {Promise.<Boolean>}

+ + + + + + +
+

Validate ECDH parameters

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
algo + + +module:enums.publicKey + + + +

Algorithm identifier

A + + +Uint8Array + + + +

ECDH public point

k + + +Uint8Array + + + +

ECDH secret scalar

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

Whether params are valid.

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

(async, inner) genPrivateEphemeralKey(curve, V, Q, d) → {Promise.<{secretKey: Uint8Array, sharedKey: Uint8Array}>}

+ + + + + + +
+

Generate ECDHE secret from private key and public part of ephemeral key

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
curve + + +CurveWithOID + + + +

Elliptic curve object

V + + +Uint8Array + + + +

Public part of ephemeral key

Q + + +Uint8Array + + + +

Recipient public key

d + + +Uint8Array + + + +

Recipient private key

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +Promise.<{secretKey: Uint8Array, sharedKey: Uint8Array}> + + +
+
+ + + + + + + + + + + + + +

(async, inner) genPublicEphemeralKey(curve, Q) → {Promise.<{publicKey: Uint8Array, sharedKey: Uint8Array}>}

+ + + + + + +
+

Generate ECDHE ephemeral key and secret from public key

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
curve + + +CurveWithOID + + + +

Elliptic curve object

Q + + +Uint8Array + + + +

Recipient public key

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +Promise.<{publicKey: Uint8Array, sharedKey: Uint8Array}> + + +
+
+ + + + + + + + + + + + + +

(async, inner) nodePrivateEphemeralKey(curve, V, d) → {Promise.<{secretKey: Uint8Array, sharedKey: Uint8Array}>}

+ + + + + + +
+

Generate ECDHE secret from private key and public part of ephemeral key using nodeCrypto

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
curve + + +CurveWithOID + + + +

Elliptic curve object

V + + +Uint8Array + + + +

Public part of ephemeral key

d + + +Uint8Array + + + +

Recipient private key

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +Promise.<{secretKey: Uint8Array, sharedKey: Uint8Array}> + + +
+
+ + + + + + + + + + + + + +

(async, inner) nodePublicEphemeralKey(curve, Q) → {Promise.<{publicKey: Uint8Array, sharedKey: Uint8Array}>}

+ + + + + + +
+

Generate ECDHE ephemeral key and secret from public key using nodeCrypto

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
curve + + +CurveWithOID + + + +

Elliptic curve object

Q + + +Uint8Array + + + +

Recipient public key

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +Promise.<{publicKey: Uint8Array, sharedKey: Uint8Array}> + + +
+
+ + + + + + + + + + + + + +

(async, inner) webPrivateEphemeralKey(curve, V, Q, d) → {Promise.<{secretKey: Uint8Array, sharedKey: Uint8Array}>}

+ + + + + + +
+

Generate ECDHE secret from private key and public part of ephemeral key using webCrypto

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
curve + + +CurveWithOID + + + +

Elliptic curve object

V + + +Uint8Array + + + +

Public part of ephemeral key

Q + + +Uint8Array + + + +

Recipient public key

d + + +Uint8Array + + + +

Recipient private key

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +Promise.<{secretKey: Uint8Array, sharedKey: Uint8Array}> + + +
+
+ + + + + + + + + + + + + +

(async, inner) webPublicEphemeralKey(curve, Q) → {Promise.<{publicKey: Uint8Array, sharedKey: Uint8Array}>}

+ + + + + + +
+

Generate ECDHE ephemeral key and secret from public key using webCrypto

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
curve + + +CurveWithOID + + + +

Elliptic curve object

Q + + +Uint8Array + + + +

Recipient public key

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +Promise.<{publicKey: Uint8Array, sharedKey: Uint8Array}> + + +
+
+ + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ + + + + + + \ No newline at end of file diff --git a/docs/module-crypto_public_key_elliptic_ecdsa.html b/docs/module-crypto_public_key_elliptic_ecdsa.html new file mode 100644 index 00000000..ff155f0b --- /dev/null +++ b/docs/module-crypto_public_key_elliptic_ecdsa.html @@ -0,0 +1,1017 @@ + + + + + JSDoc: Module: crypto/public_key/elliptic/ecdsa + + + + + + + + + + +
+ +

Module: crypto/public_key/elliptic/ecdsa

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

Implementation of ECDSA following RFC6637 for Openpgpjs

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

Methods

+ + + + + + + +

(async, static) sign(oid, hashAlgo, message, publicKey, privateKey, hashed) → {Promise.<{r: Uint8Array, s: Uint8Array}>}

+ + + + + + +
+

Sign a message using the provided key

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
oid + + +module:type/oid + + + +

Elliptic curve object identifier

hashAlgo + + +module:enums.hash + + + +

Hash algorithm used to sign

message + + +Uint8Array + + + +

Message to sign

publicKey + + +Uint8Array + + + +

Public key

privateKey + + +Uint8Array + + + +

Private key used to sign the message

hashed + + +Uint8Array + + + +

The hashed message

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

Signature of the message

+
+ + + +
+
+ Type +
+
+ +Promise.<{r: Uint8Array, s: Uint8Array}> + + +
+
+ + + + + + + + + + + + + +

(async, static) validateParams(oid, Q, d) → {Promise.<Boolean>}

+ + + + + + +
+

Validate ECDSA parameters

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
oid + + +module:type/oid + + + +

Elliptic curve object identifier

Q + + +Uint8Array + + + +

ECDSA public point

d + + +Uint8Array + + + +

ECDSA secret scalar

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

Whether params are valid.

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

(async, static) verify(oid, hashAlgo, signature, message, publicKey, hashed) → {Boolean}

+ + + + + + +
+

Verifies if a signature is valid for a message

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
oid + + +module:type/oid + + + +

Elliptic curve object identifier

hashAlgo + + +module:enums.hash + + + +

Hash algorithm used in the signature

signature + + +Object + + + +

Signature to verify

message + + +Uint8Array + + + +

Message to verify

publicKey + + +Uint8Array + + + +

Public key used to verify the message

hashed + + +Uint8Array + + + +

The hashed message

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

(async, inner) jsVerify()

+ + + + + + +
+

Fallback javascript implementation of ECDSA verification. +To be used if no native implementation is available for the given curve/operation.

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ + + + + + + \ No newline at end of file diff --git a/docs/module-crypto_public_key_elliptic_eddsa.html b/docs/module-crypto_public_key_elliptic_eddsa.html new file mode 100644 index 00000000..21bb2eb8 --- /dev/null +++ b/docs/module-crypto_public_key_elliptic_eddsa.html @@ -0,0 +1,1106 @@ + + + + + JSDoc: Module: crypto/public_key/elliptic/eddsa + + + + + + + + + + +
+ +

Module: crypto/public_key/elliptic/eddsa

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

Implementation of EdDSA following RFC4880bis-03 for OpenPGP

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

Methods

+ + + + + + + +

(static) generate(algo) → {Promise.<{A: Uint8Array, seed: Uint8Array}>}

+ + + + + + +
+

Generate (non-legacy) EdDSA key

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
algo + + +module:enums.publicKey + + + +

Algorithm identifier

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +Promise.<{A: Uint8Array, seed: Uint8Array}> + + +
+
+ + + + + + + + + + + + + +

(async, static) sign(algo, hashAlgo, message, publicKey, privateKey, hashed) → {Promise.<{RS: Uint8Array}>}

+ + + + + + +
+

Sign a message using the provided key

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
algo + + +module:enums.publicKey + + + +

Algorithm identifier

hashAlgo + + +module:enums.hash + + + +

Hash algorithm used to sign (must be sha256 or stronger)

message + + +Uint8Array + + + +

Message to sign

publicKey + + +Uint8Array + + + +

Public key

privateKey + + +Uint8Array + + + +

Private key used to sign the message

hashed + + +Uint8Array + + + +

The hashed message

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

Signature of the message

+
+ + + +
+
+ Type +
+
+ +Promise.<{RS: Uint8Array}> + + +
+
+ + + + + + + + + + + + + +

(async, static) validateParams(algo, A, seed, oid) → {Promise.<Boolean>}

+ + + + + + +
+

Validate (non-legacy) EdDSA parameters

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
algo + + +module:enums.publicKey + + + +

Algorithm identifier

A + + +Uint8Array + + + +

EdDSA public point

seed + + +Uint8Array + + + +

EdDSA secret seed

oid + + +Uint8Array + + + +

(legacy only) EdDSA OID

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

Whether params are valid.

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

(async, static) verify(algo, hashAlgo, signature, m, publicKey, hashed) → {Boolean}

+ + + + + + +
+

Verifies if a signature is valid for a message

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
algo + + +module:enums.publicKey + + + +

Algorithm identifier

hashAlgo + + +module:enums.hash + + + +

Hash algorithm used in the signature

signature + + +Object + + + +

Signature to verify the message

m + + +Uint8Array + + + +

Message to verify

publicKey + + +Uint8Array + + + +

Public key used to verify the message

hashed + + +Uint8Array + + + +

The hashed message

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +Boolean + + +
+
+ + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ + + + + + + \ No newline at end of file diff --git a/docs/module-crypto_public_key_elliptic_eddsa_legacy.html b/docs/module-crypto_public_key_elliptic_eddsa_legacy.html new file mode 100644 index 00000000..b9a68f12 --- /dev/null +++ b/docs/module-crypto_public_key_elliptic_eddsa_legacy.html @@ -0,0 +1,927 @@ + + + + + JSDoc: Module: crypto/public_key/elliptic/eddsa_legacy + + + + + + + + + + +
+ +

Module: crypto/public_key/elliptic/eddsa_legacy

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

Implementation of legacy EdDSA following RFC4880bis-03 for OpenPGP. +This key type has been deprecated by the crypto-refresh RFC.

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

Methods

+ + + + + + + +

(async, static) sign(oid, hashAlgo, message, publicKey, privateKey, hashed) → {Promise.<{r: Uint8Array, s: Uint8Array}>}

+ + + + + + +
+

Sign a message using the provided legacy EdDSA key

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
oid + + +module:type/oid + + + +

Elliptic curve object identifier

hashAlgo + + +module:enums.hash + + + +

Hash algorithm used to sign (must be sha256 or stronger)

message + + +Uint8Array + + + +

Message to sign

publicKey + + +Uint8Array + + + +

Public key

privateKey + + +Uint8Array + + + +

Private key used to sign the message

hashed + + +Uint8Array + + + +

The hashed message

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

Signature of the message

+
+ + + +
+
+ Type +
+
+ +Promise.<{r: Uint8Array, s: Uint8Array}> + + +
+
+ + + + + + + + + + + + + +

(async, static) validateParams(oid, Q, k) → {Promise.<Boolean>}

+ + + + + + +
+

Validate legacy EdDSA parameters

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
oid + + +module:type/oid + + + +

Elliptic curve object identifier

Q + + +Uint8Array + + + +

EdDSA public point

k + + +Uint8Array + + + +

EdDSA secret seed

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

Whether params are valid.

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

(async, static) verify(oid, hashAlgo, signature, m, publicKey, hashed) → {Boolean}

+ + + + + + +
+

Verifies if a legacy EdDSA signature is valid for a message

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
oid + + +module:type/oid + + + +

Elliptic curve object identifier

hashAlgo + + +module:enums.hash + + + +

Hash algorithm used in the signature

signature + + +Object + + + +

Signature to verify the message

m + + +Uint8Array + + + +

Message to verify

publicKey + + +Uint8Array + + + +

Public key used to verify the message

hashed + + +Uint8Array + + + +

The hashed message

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +Boolean + + +
+
+ + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ + + + + + + \ No newline at end of file diff --git a/docs/module-crypto_public_key_prime.html b/docs/module-crypto_public_key_prime.html new file mode 100644 index 00000000..f26a9c24 --- /dev/null +++ b/docs/module-crypto_public_key_prime.html @@ -0,0 +1,954 @@ + + + + + JSDoc: Module: crypto/public_key/prime + + + + + + + + + + +
+ +

Module: crypto/public_key/prime

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

Algorithms for probabilistic random prime generation

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

Methods

+ + + + + + + +

(static) fermat(n, b) → {boolean}

+ + + + + + +
+

Tests whether n is probably prime or not using Fermat's test with b = 2. +Fails if b^(n-1) mod n != 1.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
n + + +BigInteger + + + +

Number to test

b + + +BigInteger + + + +

Optional Fermat test base

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +boolean + + +
+
+ + + + + + + + + + + + + +

(async, static) isProbablePrime(n, e, k) → {boolean}

+ + + + + + +
+

Probabilistic primality testing

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
n + + +BigInteger + + + +

Number to test

e + + +BigInteger + + + +

Optional RSA exponent to check against the prime

k + + +Integer + + + +

Optional number of iterations of Miller-Rabin test

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +boolean + + +
+
+ + + + + + + + + + + + + +

(async, static) millerRabin(n, k, rand) → {boolean}

+ + + + + + +
+

Tests whether n is probably prime or not using the Miller-Rabin test. +See HAC Remark 4.28.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
n + + +BigInteger + + + +

Number to test

k + + +Integer + + + +

Optional number of iterations of Miller-Rabin test

rand + + +function + + + +

Optional function to generate potential witnesses

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +boolean + + +
+
+ + + + + + + + + + + + + +

(async, static) randomProbablePrime(bits, e, k)

+ + + + + + +
+

Generate a probably prime random number

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
bits + + +Integer + + + +

Bit length of the prime

e + + +BigInteger + + + +

Optional RSA exponent to check against the prime

k + + +Integer + + + +

Optional number of iterations of Miller-Rabin test

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

BigInteger

+
+ + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ + + + + + + \ No newline at end of file diff --git a/docs/module-crypto_public_key_rsa.html b/docs/module-crypto_public_key_rsa.html new file mode 100644 index 00000000..7cc1eccf --- /dev/null +++ b/docs/module-crypto_public_key_rsa.html @@ -0,0 +1,2279 @@ + + + + + JSDoc: Module: crypto/public_key/rsa + + + + + + + + + + +
+ +

Module: crypto/public_key/rsa

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

RSA implementation

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

Methods

+ + + + + + + +

(async, static) decrypt(m, n, e, d, p, q, u, randomPayload) → {Promise.<String>}

+ + + + + + +
+

Decrypt RSA message

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
m + + +Uint8Array + + + +

Message

n + + +Uint8Array + + + +

RSA public modulus

e + + +Uint8Array + + + +

RSA public exponent

d + + +Uint8Array + + + +

RSA private exponent

p + + +Uint8Array + + + +

RSA private prime p

q + + +Uint8Array + + + +

RSA private prime q

u + + +Uint8Array + + + +

RSA private coefficient

randomPayload + + +Uint8Array + + + +

Data to return on decryption error, instead of throwing +(needed for constant-time processing)

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

on decryption error, unless randomPayload is given

+
+
+
+
+
+
+ Type +
+
+ +Error + + +
+
+
+
+
+ + + + + +
Returns:
+ + +
+

RSA Plaintext.

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

(async, static) encrypt(data, n, e) → {Promise.<Uint8Array>}

+ + + + + + +
+

Encrypt message

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
data + + +Uint8Array + + + +

Message

n + + +Uint8Array + + + +

RSA public modulus

e + + +Uint8Array + + + +

RSA public exponent

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

RSA Ciphertext.

+
+ + + +
+
+ Type +
+
+ +Promise.<Uint8Array> + + +
+
+ + + + + + + + + + + + + +

(async, static) generate(bits, e) → {Object}

+ + + + + + +
+

Generate a new random private key B bits long with public exponent E.

+

When possible, webCrypto or nodeCrypto is used. Otherwise, primes are generated using +40 rounds of the Miller-Rabin probabilistic random prime generation algorithm.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
bits + + +Integer + + + +

RSA bit length

e + + +Integer + + + +

RSA public exponent

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

RSA public modulus, RSA public exponent, RSA private exponent, +RSA private prime p, RSA private prime q, u = p ** -1 mod q

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

(async, static) sign(hashAlgo, data, n, e, d, p, q, u, hashed) → {Promise.<Uint8Array>}

+ + + + + + +
+

Create signature

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
hashAlgo + + +module:enums.hash + + + +

Hash algorithm

data + + +Uint8Array + + + +

Message

n + + +Uint8Array + + + +

RSA public modulus

e + + +Uint8Array + + + +

RSA public exponent

d + + +Uint8Array + + + +

RSA private exponent

p + + +Uint8Array + + + +

RSA private prime p

q + + +Uint8Array + + + +

RSA private prime q

u + + +Uint8Array + + + +

RSA private coefficient

hashed + + +Uint8Array + + + +

Hashed message

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

RSA Signature.

+
+ + + +
+
+ Type +
+
+ +Promise.<Uint8Array> + + +
+
+ + + + + + + + + + + + + +

(async, static) validateParams(n, e, d, p, q, u) → {Promise.<Boolean>}

+ + + + + + +
+

Validate RSA parameters

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
n + + +Uint8Array + + + +

RSA public modulus

e + + +Uint8Array + + + +

RSA public exponent

d + + +Uint8Array + + + +

RSA private exponent

p + + +Uint8Array + + + +

RSA private prime p

q + + +Uint8Array + + + +

RSA private prime q

u + + +Uint8Array + + + +

RSA inverse of p w.r.t. q

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

Whether params are valid.

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

(async, static) verify(hashAlgo, data, s, n, e, hashed) → {Boolean}

+ + + + + + +
+

Verify signature

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
hashAlgo + + +module:enums.hash + + + +

Hash algorithm

data + + +Uint8Array + + + +

Message

s + + +Uint8Array + + + +

Signature

n + + +Uint8Array + + + +

RSA public modulus

e + + +Uint8Array + + + +

RSA public exponent

hashed + + +Uint8Array + + + +

Hashed message

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

(async, inner) privateToJWK(hashAlgo, n, e, d, p, q, u)

+ + + + + + +
+

Convert Openpgp private key params to jwk key according to

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
hashAlgo + + +String + + + +
n + + +Uint8Array + + + +
e + + +Uint8Array + + + +
d + + +Uint8Array + + + +
p + + +Uint8Array + + + +
q + + +Uint8Array + + + +
u + + +Uint8Array + + + +
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

(inner) publicToJWK(hashAlgo, n, e)

+ + + + + + +
+

Convert Openpgp key public params to jwk key according to

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
hashAlgo + + +String + + + +
n + + +Uint8Array + + + +
e + + +Uint8Array + + + +
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ + + + + + + \ No newline at end of file diff --git a/docs/module-crypto_random.html b/docs/module-crypto_random.html new file mode 100644 index 00000000..fa8b2c6c --- /dev/null +++ b/docs/module-crypto_random.html @@ -0,0 +1,516 @@ + + + + + JSDoc: Module: crypto/random + + + + + + + + + + +
+ +

Module: crypto/random

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

Provides tools for retrieving secure randomness from browsers or Node.js

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

Methods

+ + + + + + + +

(async, static) getRandomBigInteger(min, max) → {Promise.<module:BigInteger>}

+ + + + + + +
+

Create a secure random BigInteger that is greater than or equal to min and less than max.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
min + + +module:BigInteger + + + +

Lower bound, included

max + + +module:BigInteger + + + +

Upper bound, excluded

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

Random BigInteger.

+
+ + + +
+
+ Type +
+
+ +Promise.<module:BigInteger> + + +
+
+ + + + + + + + + + + + + +

(static) getRandomBytes(length) → {Uint8Array}

+ + + + + + +
+

Retrieve secure random byte array of the specified length

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
length + + +Integer + + + +

Length in bytes to generate

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

Random byte array.

+
+ + + +
+
+ Type +
+
+ +Uint8Array + + +
+
+ + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ + + + + + + \ No newline at end of file diff --git a/docs/module-crypto_signature.html b/docs/module-crypto_signature.html new file mode 100644 index 00000000..accef42e --- /dev/null +++ b/docs/module-crypto_signature.html @@ -0,0 +1,917 @@ + + + + + JSDoc: Module: crypto/signature + + + + + + + + + + +
+ +

Module: crypto/signature

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

Provides functions for asymmetric signing and signature verification

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

Methods

+ + + + + + + +

(async, static) parseSignatureParams(algo, signature) → {Promise.<Object>}

+ + + + + + +
+

Parse signature in binary form to get the parameters. +The returned values are only padded for EdDSA, since in the other cases their expected length +depends on the key params, hence we delegate the padding to the signature verification function. +See RFC 4880 9.1 +See RFC 4880 5.2.2.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
algo + + +module:enums.publicKey + + + +

Public key algorithm

signature + + +Uint8Array + + + +

Data for which the signature was created

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

True if signature is valid.

+
+ + + +
+
+ Type +
+
+ +Promise.<Object> + + +
+
+ + + + + + + + + + + + + +

(async, static) sign(algo, hashAlgo, publicKeyParams, privateKeyParams, data, hashed) → {Promise.<Object>}

+ + + + + + +
+

Creates a signature on data using specified algorithms and private key parameters. +See RFC 4880 9.1 +and RFC 4880 9.4 +for public key and hash algorithms.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
algo + + +module:enums.publicKey + + + +

Public key algorithm

hashAlgo + + +module:enums.hash + + + +

Hash algorithm

publicKeyParams + + +Object + + + +

Algorithm-specific public and private key parameters

privateKeyParams + + +Object + + + +

Algorithm-specific public and private key parameters

data + + +Uint8Array + + + +

Data to be signed

hashed + + +Uint8Array + + + +

The hashed data

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

Signature Object containing named signature parameters.

+
+ + + +
+
+ Type +
+
+ +Promise.<Object> + + +
+
+ + + + + + + + + + + + + +

(async, static) verify(algo, hashAlgo, signature, publicParams, data, hashed) → {Promise.<Boolean>}

+ + + + + + +
+

Verifies the signature provided for data using specified algorithms and public key parameters. +See RFC 4880 9.1 +and RFC 4880 9.4 +for public key and hash algorithms.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
algo + + +module:enums.publicKey + + + +

Public key algorithm

hashAlgo + + +module:enums.hash + + + +

Hash algorithm

signature + + +Object + + + +

Named algorithm-specific signature parameters

publicParams + + +Object + + + +

Algorithm-specific public key parameters

data + + +Uint8Array + + + +

Data for which the signature was created

hashed + + +Uint8Array + + + +

The hashed data

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

True if signature is valid.

+
+ + + +
+
+ Type +
+
+ +Promise.<Boolean> + + +
+
+ + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ + + + + + + \ No newline at end of file diff --git a/docs/module-encoding_base64.html b/docs/module-encoding_base64.html new file mode 100644 index 00000000..11035aa0 --- /dev/null +++ b/docs/module-encoding_base64.html @@ -0,0 +1,769 @@ + + + + + JSDoc: Module: encoding/base64 + + + + + + + + + + +
+ +

Module: encoding/base64

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

Methods

+ + + + + + + +

(static) b64ToUint8Array(base64) → {Uint8Array}

+ + + + + + +
+

Convert a Base-64 encoded string an array of 8-bit integer

+

Note: accepts both Radix-64 and URL-safe strings

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
base64 + + +String + + + +

Base-64 encoded string to convert

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

An array of 8-bit integers.

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

(static) decode(data) → {Uint8Array|ReadableStream.<Uint8Array>}

+ + + + + + +
+

Convert radix-64 to binary array

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
data + + +String +| + +ReadableStream.<String> + + + +

Radix-64 string to convert

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

Binary array version of input string.

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

(static) encode(data) → {String|ReadableStream.<String>}

+ + + + + + +
+

Convert binary array to radix-64

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

Uint8Array to convert

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

Radix-64 version of input string.

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

(static) uint8ArrayToB64(bytes, url) → {String}

+ + + + + + +
+

Convert an array of 8-bit integer to a Base-64 encoded string

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

An array of 8-bit integers to convert

url + + +bool + + + +

If true, output is URL-safe

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

Base-64 encoded string.

+
+ + + +
+
+ Type +
+
+ +String + + +
+
+ + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ + + + + + + \ No newline at end of file diff --git a/docs/module-enums.html b/docs/module-enums.html index 848ff729..af3da952 100644 --- a/docs/module-enums.html +++ b/docs/module-enums.html @@ -148,6 +148,29 @@ + + + + + + + + gcm + + + + + +Integer + + + + + + + + + @@ -212,7 +235,7 @@
Source:
@@ -476,7 +499,7 @@
Source:
@@ -671,7 +694,7 @@
Source:
@@ -1924,7 +1947,7 @@
Source:
@@ -2068,6 +2091,29 @@ fingerprint format

+ + + + seipdv2 + + + + + +Integer + + + + + + + + + + + + + @@ -2105,7 +2151,7 @@ fingerprint format

Source:
@@ -2328,6 +2374,52 @@ fingerprint format

+ + + + + + + + sha3_256 + + + + + +Integer + + + + + + + + + + + + + + + + + sha3_512 + + + + + +Integer + + + + + + + + + @@ -2369,7 +2461,7 @@ fingerprint format

Source:
@@ -2635,7 +2727,7 @@ possession of more than one person.

Source:
@@ -2830,7 +2922,7 @@ possession of more than one person.

Source:
@@ -3306,6 +3398,29 @@ possession of more than one person.

+ + + + + + + + padding + + + + + +Integer + + + + + + + + + @@ -3347,7 +3462,7 @@ possession of more than one person.

Source:
@@ -3599,52 +3714,6 @@ possession of more than one person.

- - - ed25519Legacy - - - - - -Integer - - - - - - - - - - - - - - - - - eddsa - - - - - -Integer - - - - - - - - - - - - - - aedh @@ -3819,7 +3888,7 @@ possession of more than one person.

Source:
@@ -4037,7 +4106,7 @@ possession of more than one person.

Source:
@@ -4168,6 +4237,29 @@ possession of more than one person.

+ + + + + + + + argon2 + + + + + +Integer + + + + + + + + + @@ -4232,7 +4324,7 @@ possession of more than one person.

Source:
@@ -4749,7 +4841,7 @@ document) that cannot include a target subpacket.

Source:
@@ -5048,7 +5140,7 @@ document) that cannot include a target subpacket.

- issuer + issuerKeyID @@ -5409,6 +5501,29 @@ document) that cannot include a target subpacket.

+ + + + + + + + preferredCipherSuites + + + + + +Integer + + + + + + + + + @@ -5450,7 +5565,7 @@ document) that cannot include a target subpacket.

Source:
@@ -5517,29 +5632,6 @@ document) that cannot include a target subpacket.

- - - plaintext - - - - - -Integer - - - - - - - - - - - - - - idea @@ -5760,7 +5852,7 @@ document) that cannot include a target subpacket.

Source:
@@ -5956,7 +6048,7 @@ document) that cannot include a target subpacket.

Source:
@@ -6110,7 +6202,7 @@ document) that cannot include a target subpacket.

Source:
@@ -6326,7 +6418,7 @@ document) that cannot include a target subpacket.

Source:
@@ -6423,13 +6515,13 @@ document) that cannot include a target subpacket.


diff --git a/docs/module-key_Subkey-Subkey.html b/docs/module-key_Subkey-Subkey.html index 5f486957..87f2ab7f 100644 --- a/docs/module-key_Subkey-Subkey.html +++ b/docs/module-key_Subkey-Subkey.html @@ -28,7 +28,8 @@
-

Subkey(subkeyPacket, mainKey)

+

+ key/Subkey~Subkey(subkeyPacket, mainKey)

Class that represents a subkey packet and the relevant signatures.

@@ -170,7 +171,7 @@
Source:
@@ -280,7 +281,7 @@
Source:
@@ -393,7 +394,7 @@
Source:
@@ -510,7 +511,7 @@
Source:
@@ -627,7 +628,7 @@
Source:
@@ -740,7 +741,7 @@
Source:
@@ -941,7 +942,7 @@ Returns null if the subkey is invalid.

Source:
@@ -1054,7 +1055,7 @@ Returns null if the subkey is invalid.

Source:
@@ -1171,7 +1172,7 @@ Returns null if the subkey is invalid.

Source:
@@ -1288,7 +1289,7 @@ Returns null if the subkey is invalid.

Source:
@@ -1405,7 +1406,7 @@ Returns null if the subkey is invalid.

Source:
@@ -1522,7 +1523,7 @@ Returns null if the subkey is invalid.

Source:
@@ -1639,7 +1640,7 @@ Returns null if the subkey is invalid.

Source:
@@ -1756,7 +1757,7 @@ Returns null if the subkey is invalid.

Source:
@@ -1872,7 +1873,7 @@ Returns null if the subkey is invalid.

Source:
@@ -2148,7 +2149,7 @@ Returns null if the subkey is invalid.

Source:
@@ -2486,7 +2487,7 @@ Returns null if the subkey is invalid.

Source:
@@ -2598,7 +2599,7 @@ Returns null if the subkey is invalid.

Source:
@@ -2831,7 +2832,7 @@ Returns null if the subkey is invalid.

Source:
@@ -3043,7 +3044,7 @@ and valid binding signature.

Source:
@@ -3136,13 +3137,13 @@ and valid binding signature.


diff --git a/docs/module-key_Subkey.html b/docs/module-key_Subkey.html new file mode 100644 index 00000000..681d225d --- /dev/null +++ b/docs/module-key_Subkey.html @@ -0,0 +1,92 @@ + + + + + JSDoc: Module: key/Subkey + + + + + + + + + + +
+ +

Module: key/Subkey

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

Classes

+ +
+
Subkey
+
+
+ + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ + + + + + + \ No newline at end of file diff --git a/docs/module-key_User-User.html b/docs/module-key_User-User.html index 363373c9..8ef2f320 100644 --- a/docs/module-key_User-User.html +++ b/docs/module-key_User-User.html @@ -28,7 +28,8 @@
-

User(userPacket, mainKey)

+

+ key/User~User(userPacket, mainKey)

Class that represents an user ID or attribute packet and the relevant signatures.

@@ -170,7 +171,7 @@
Source:
@@ -403,7 +404,7 @@
Source:
@@ -515,7 +516,7 @@
Source:
@@ -788,7 +789,7 @@
Source:
@@ -1126,7 +1127,7 @@
Source:
@@ -1238,7 +1239,7 @@
Source:
@@ -1441,7 +1442,7 @@
Source:
@@ -1622,7 +1623,7 @@ and validity of self signature.

Source:
@@ -1886,7 +1887,7 @@ and validity of self signature.

Source:
@@ -2153,7 +2154,7 @@ Signature validity is null if the verification keys do not correspond to the cer
Source:
@@ -2233,13 +2234,13 @@ Signature validity is null if the verification keys do not correspond to the cer
diff --git a/docs/module-key_User.html b/docs/module-key_User.html new file mode 100644 index 00000000..298131b9 --- /dev/null +++ b/docs/module-key_User.html @@ -0,0 +1,92 @@ + + + + + JSDoc: Module: key/User + + + + + + + + + + +
+ +

Module: key/User

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

Classes

+ +
+
User
+
+
+ + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ + + + + + + \ No newline at end of file diff --git a/docs/module-key_helper.html b/docs/module-key_helper.html new file mode 100644 index 00000000..45f9f817 --- /dev/null +++ b/docs/module-key_helper.html @@ -0,0 +1,2867 @@ + + + + + JSDoc: Module: key/helper + + + + + + + + + + +
+ +

Module: key/helper

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

Provides helpers methods for key module

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

Methods

+ + + + + + + +

(static) checkKeyRequirements(keyPacket, config)

+ + + + + + +
+

Check key against blacklisted algorithms and minimum strength requirements.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
keyPacket + + +SecretKeyPacket +| + +PublicKeyPacket +| + +SecretSubkeyPacket +| + +PublicSubkeyPacket + + + +
config + + +Config + + + +
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Throws:
+ + + +
+
+
+

if the key packet does not meet the requirements

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

(static) createBindingSignature(subkey, primaryKey, options, config)

+ + + + + + +
+

Create Binding signature to the key according to the https://tools.ietf.org/html/rfc4880#section-5.2.1

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
subkey + + +SecretSubkeyPacket + + + +

Subkey key packet

primaryKey + + +SecretKeyPacket + + + +

Primary key packet

options + + +Object + + + +
config + + +Object + + + +

Full configuration

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

(static) createSignaturePacket(dataToSign, privateKey, signingKeyPacket, signaturePropertiesopt, dateopt, userIDopt, notationsopt, detachedopt, config) → {Promise.<SignaturePacket>}

+ + + + + + +
+

Create signature packet

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
dataToSign + + +Object + + + + + + + + + +

Contains packets to be signed

privateKey + + +PrivateKey + + + + + + + + + +

key to get preferences from

signingKeyPacket + + +SecretKeyPacket +| + +SecretSubkeyPacket + + + + + + + + + +

secret key packet for signing

signatureProperties + + +Object + + + + + + <optional>
+ + + + + +

Properties to write on the signature packet before signing

date + + +Date + + + + + + <optional>
+ + + + + +

Override the creationtime of the signature

userID + + +Object + + + + + + <optional>
+ + + + + +

User ID

notations + + +Array + + + + + + <optional>
+ + + + + +

Notation Data to add to the signature, e.g. [{ name: 'test@example.org', value: new TextEncoder().encode('test'), humanReadable: true, critical: false }]

detached + + +Object + + + + + + <optional>
+ + + + + +

Whether to create a detached signature packet

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

full configuration

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

Signature packet.

+
+ + + +
+
+ Type +
+
+ +Promise.<SignaturePacket> + + +
+
+ + + + + + + + + + + + + +

(static) getKeyExpirationTime(keyPacket, signature) → {Date|Infinity}

+ + + + + + +
+

Returns key expiration time based on the given certification signature. +The expiration time of the signature is ignored.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
keyPacket + + +PublicSubkeyPacket +| + +PublicKeyPacket + + + +

key to check

signature + + +SignaturePacket + + + +

signature to process

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

expiration time or infinity if the key does not expire

+
+ + + +
+
+ Type +
+
+ +Date +| + +Infinity + + +
+
+ + + + + + + + + + + + + +

(async, static) getLatestValidSignature(signatures, publicKey, date, config) → {Promise.<SignaturePacket>}

+ + + + + + +
+

Returns the valid and non-expired signature that has the latest creation date, while ignoring signatures created in the future.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
signatures + + +Array.<SignaturePacket> + + + +

List of signatures

publicKey + + +PublicKeyPacket +| + +PublicSubkeyPacket + + + +

Public key packet to verify the signature

date + + +Date + + + +

Use the given date instead of the current time

config + + +Object + + + +

full configuration

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

The latest valid signature.

+
+ + + +
+
+ Type +
+
+ +Promise.<SignaturePacket> + + +
+
+ + + + + + + + + + + + + +

(async, static) getPreferredCipherSuite(keysopt, dateopt, userIDsopt, configopt) → {Promise.<{symmetricAlgo: module:enums.symmetric, aeadAlgo: (module:enums.aead|undefined)}>}

+ + + + + + +
+

Returns the preferred symmetric and AEAD algorithm (if any) for a set of keys

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
keys + + +Array.<Key> + + + + + + <optional>
+ + + + + +

Set of keys

date + + +Date + + + + + + <optional>
+ + + + + +

Use the given date for verification instead of the current time

userIDs + + +Array + + + + + + <optional>
+ + + + + +

User IDs

config + + +Object + + + + + + <optional>
+ + + + + +

Full configuration, defaults to openpgp.config

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

Object containing the preferred symmetric algorithm, and the preferred AEAD algorithm, or undefined if CFB is preferred

+
+ + + +
+
+ Type +
+
+ +Promise.<{symmetricAlgo: module:enums.symmetric, aeadAlgo: (module:enums.aead|undefined)}> + + +
+
+ + + + + + + + + + + + + +

(async, static) getPreferredCompressionAlgo(keysopt, dateopt, userIDsopt, configopt) → {Promise.<module:enums.compression>}

+ + + + + + +
+

Returns the preferred compression algorithm for a set of keys

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
keys + + +Array.<Key> + + + + + + <optional>
+ + + + + +

Set of keys

date + + +Date + + + + + + <optional>
+ + + + + +

Use the given date for verification instead of the current time

userIDs + + +Array + + + + + + <optional>
+ + + + + +

User IDs

config + + +Object + + + + + + <optional>
+ + + + + +

Full configuration, defaults to openpgp.config

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

Preferred compression algorithm

+
+ + + +
+
+ Type +
+
+ +Promise.<module:enums.compression> + + +
+
+ + + + + + + + + + + + + +

(async, static) getPreferredHashAlgo(keyopt, keyPacket, dateopt, userIDopt, config) → {Promise.<enums.hash>}

+ + + + + + +
+

Returns the preferred signature hash algorithm of a key

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
key + + +Key + + + + + + <optional>
+ + + + + +

The key to get preferences from

keyPacket + + +SecretKeyPacket +| + +SecretSubkeyPacket + + + + + + + + + +

key packet used for signing

date + + +Date + + + + + + <optional>
+ + + + + +

Use the given date for verification instead of the current time

userID + + +Object + + + + + + <optional>
+ + + + + +

User ID

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

full configuration

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +Promise.<enums.hash> + + +
+
+ + + + + + + + + + + + + +

(async, static) isDataRevoked(primaryKey, dataToVerify, revocations, signature, key,, date, config) → {Promise.<Boolean>}

+ + + + + + +
+

Checks if a given certificate or binding signature is revoked

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
primaryKey + + +SecretKeyPacket +| + +PublicKeyPacket + + + +

The primary key packet

dataToVerify + + +Object + + + +

The data to check

revocations + + +Array.<SignaturePacket> + + + +

The revocation signatures to check

signature + + +SignaturePacket + + + +

The certificate or signature to check

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

optional The key packet to verify the signature, instead of the primary key

date + + +Date + + + +

Use the given date instead of the current time

config + + +Object + + + +

Full configuration

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

True if the signature revokes the data.

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

(static) mergeSignatures(source, dest, attr, dateopt, checkFnopt)

+ + + + + + +
+

Merges signatures from source[attr] to dest[attr]

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
source + + +Object + + + + + + + + + +
dest + + +Object + + + + + + + + + +
attr + + +String + + + + + + + + + +
date + + +Date + + + + + + <optional>
+ + + + + +

date to use for signature expiration check, instead of the current time

checkFn + + +function + + + + + + <optional>
+ + + + + +

signature only merged if true

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ + + + + + + \ No newline at end of file diff --git a/docs/module-packet_packet.html b/docs/module-packet_packet.html new file mode 100644 index 00000000..9215d135 --- /dev/null +++ b/docs/module-packet_packet.html @@ -0,0 +1,866 @@ + + + + + JSDoc: Module: packet/packet + + + + + + + + + + +
+ +

Module: packet/packet

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

Functions for reading and writing packets

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

Methods

+ + + + + + + +

(static) readPackets(input, callback) → {Boolean}

+ + + + + + +
+

Generic static Packet Parser function

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

Input stream as string

callback + + +function + + + +

Function to call with the parsed packet

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

Returns false if the stream was empty and parsing is done, and true otherwise.

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

(static) supportsStreaming(tag) → {Boolean}

+ + + + + + +
+

Whether the packet type supports partial lengths per RFC4880

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
tag + + +Integer + + + +

Tag type

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

String of the header.

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

(static) writeHeader(tag_type, length) → {String}

+ + + + + + +
+

Writes a packet header version 4 with the given tag_type and length to a +string

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
tag_type + + +Integer + + + +

Tag type

length + + +Integer + + + +

Length of the payload

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

String of the header.

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

(static) writeSimpleLength(length) → {Uint8Array}

+ + + + + + +
+

Encodes a given integer of length to the openpgp length specifier to a +string

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
length + + +Integer + + + +

The length to encode

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

String with openpgp length representation.

+
+ + + +
+
+ Type +
+
+ +Uint8Array + + +
+
+ + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ + + + + + + \ No newline at end of file diff --git a/docs/module-type_ecdh_symkey.html b/docs/module-type_ecdh_symkey.html new file mode 100644 index 00000000..1849b1da --- /dev/null +++ b/docs/module-type_ecdh_symkey.html @@ -0,0 +1,167 @@ + + + + + JSDoc: Module: type/ecdh_symkey + + + + + + + + + + +
+ +

Module: type/ecdh_symkey

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

Encoded symmetric key for ECDH (incl. legacy x25519)

+ + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ + + + + + + \ No newline at end of file diff --git a/docs/module-type_kdf_params-KDFParams.html b/docs/module-type_kdf_params-KDFParams.html index 62c65074..efa1ab8f 100644 --- a/docs/module-type_kdf_params-KDFParams.html +++ b/docs/module-type_kdf_params-KDFParams.html @@ -163,7 +163,7 @@
Source:
@@ -322,7 +322,7 @@
Source:
@@ -434,7 +434,7 @@
Source:
@@ -502,13 +502,13 @@
diff --git a/docs/module-type_keyid-KeyID.html b/docs/module-type_keyid-KeyID.html index fc2120c4..bb3e2898 100644 --- a/docs/module-type_keyid-KeyID.html +++ b/docs/module-type_keyid-KeyID.html @@ -28,7 +28,8 @@
-

KeyID()

+

+ type/keyid~KeyID()

Implementation of type key id

RFC4880 3.3: @@ -100,7 +101,7 @@ formed.

Source:
@@ -294,7 +295,7 @@ formed.

Source:
@@ -384,7 +385,7 @@ formed.

Source:
@@ -496,7 +497,7 @@ formed.

Source:
@@ -657,7 +658,7 @@ formed.

Source:
@@ -747,7 +748,7 @@ formed.

Source:
@@ -859,7 +860,7 @@ formed.

Source:
@@ -927,13 +928,13 @@ formed.


diff --git a/docs/module-type_keyid.html b/docs/module-type_keyid.html new file mode 100644 index 00000000..35a85bf5 --- /dev/null +++ b/docs/module-type_keyid.html @@ -0,0 +1,92 @@ + + + + + JSDoc: Module: type/keyid + + + + + + + + + + +
+ +

Module: type/keyid

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

Classes

+ +
+
KeyID
+
+
+ + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ + + + + + + \ No newline at end of file diff --git a/docs/module-type_oid.html b/docs/module-type_oid.html new file mode 100644 index 00000000..27a5dcd4 --- /dev/null +++ b/docs/module-type_oid.html @@ -0,0 +1,178 @@ + + + + + JSDoc: Module: type/oid + + + + + + + + + + +
+ +

Module: type/oid

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

Wrapper to an OID value

+

RFC6637, section 11: +The sequence of octets in the third column is the result of applying +the Distinguished Encoding Rules (DER) to the ASN.1 Object Identifier +with subsequent truncation. The truncation removes the two fields of +encoded Object Identifier. The first omitted field is one octet +representing the Object Identifier tag, and the second omitted field +is the length of the Object Identifier body. For example, the +complete ASN.1 DER encoding for the NIST P-256 curve OID is "06 08 2A +86 48 CE 3D 03 01 07", from which the first entry in the table above +is constructed by omitting the first two octets. Only the truncated +sequence of octets is the valid representation of a curve OID.

+ + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ + + + + + + \ No newline at end of file diff --git a/docs/module-type_s2k-S2K.html b/docs/module-type_s2k-GenericS2K.html similarity index 51% rename from docs/module-type_s2k-S2K.html rename to docs/module-type_s2k-GenericS2K.html index 50233346..07287091 100644 --- a/docs/module-type_s2k-S2K.html +++ b/docs/module-type_s2k-GenericS2K.html @@ -2,7 +2,7 @@ - JSDoc: Class: S2K + JSDoc: Class: GenericS2K @@ -17,7 +17,7 @@
-

Class: S2K

+

Class: GenericS2K

@@ -28,7 +28,8 @@
-

S2K(configopt)

+

+ type/s2k~GenericS2K(configopt)

@@ -41,7 +42,7 @@ -

new S2K(configopt)

+

new GenericS2K(configopt)

@@ -152,7 +153,7 @@
Source:
@@ -261,7 +262,7 @@
Source:
@@ -331,7 +332,7 @@
Source:
@@ -405,7 +406,7 @@
Source:
@@ -479,7 +480,7 @@
Source:
@@ -611,7 +612,7 @@ hashAlgorithm

Source:
@@ -773,7 +774,7 @@ hashAlgorithm hash length

Source:
@@ -885,7 +886,7 @@ hashAlgorithm hash length

Source:
@@ -953,13 +954,13 @@ hashAlgorithm hash length


diff --git a/docs/module-type_s2k.html b/docs/module-type_s2k.html new file mode 100644 index 00000000..25caf336 --- /dev/null +++ b/docs/module-type_s2k.html @@ -0,0 +1,180 @@ + + + + + JSDoc: Module: type/s2k + + + + + + + + + + +
+ +

Module: type/s2k

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

Implementation of the String-to-key specifier

+

RFC4880 3.7: +String-to-key (S2K) specifiers are used to convert passphrase strings +into symmetric-key encryption/decryption keys. They are used in two +places, currently: to encrypt the secret part of private keys in the +private keyring, and to convert passphrases to encryption keys for +symmetrically encrypted messages.

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

Classes

+ +
+
GenericS2K
+
+
+ + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ + + + + + + \ No newline at end of file diff --git a/docs/module-type_x25519x448_symkey.html b/docs/module-type_x25519x448_symkey.html index 76ed380e..4e92f253 100644 --- a/docs/module-type_x25519x448_symkey.html +++ b/docs/module-type_x25519x448_symkey.html @@ -91,7 +91,7 @@ the former includes an algorithm byte preceeding the encrypted session key.

<
Source:
@@ -154,13 +154,13 @@ the former includes an algorithm byte preceeding the encrypted session key.

<
diff --git a/docs/module-util.html b/docs/module-util.html new file mode 100644 index 00000000..977a0736 --- /dev/null +++ b/docs/module-util.html @@ -0,0 +1,167 @@ + + + + + JSDoc: Module: util + + + + + + + + + + +
+ +

Module: util

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

This object contains utility functions

+ + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ + + + + + + \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 1c9d18f1..243cd2ff 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "openpgp", - "version": "5.11.0", + "version": "6.0.0-alpha.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "openpgp", - "version": "5.11.0", + "version": "6.0.0-alpha.0", "license": "LGPL-3.0+", "dependencies": { "asn1.js": "^5.0.0" diff --git a/package.json b/package.json index cd04fb7a..d55dedc6 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": "5.11.0", + "version": "6.0.0-alpha.0", "license": "LGPL-3.0+", "homepage": "https://openpgpjs.org/", "engines": {