diff --git a/doc/JXG.Util.html b/doc/JXG.Util.html index 1d882d58..19ab8810 100644 --- a/doc/JXG.Util.html +++ b/doc/JXG.Util.html @@ -4,12 +4,12 @@ JSDoc: Class: Util - - + + - + @@ -35,7 +35,9 @@ Class for gunzipping, unzipping and base64 decoding of files. It is used for reading GEONExT, Geogebra and Intergeo files. Only Huffman codes are decoded in gunzip. -The code is based on the source code for gunzip.c by Pasi Ojala +The code is based on the source code for gunzip.c by Pasi Ojala +http://www.cs.tut.fi/~albert/Dev/gunzip/gunzip.c +http://www.cs.tut.fi/~albert @@ -46,13 +48,15 @@ The code is based on the source code for gunzip.c by Pasi Ojala
-

new Util

+

new Util()

+ + @@ -62,43 +66,42 @@ The code is based on the source code for gunzip.c by Pasi Ojala
- - - - - - - - - - - - - - - -
Source:
-
  • openpgp.js, line 10985
- - - -
See:
-
- -
- - - + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + +
+ + + + @@ -134,6 +137,7 @@ The code is based on the source code for gunzip.c by Pasi Ojala
Base64 encoding / decoding + http://www.webtoolkit.info/
@@ -141,37 +145,34 @@ The code is based on the source code for gunzip.c by Pasi Ojala
- - - - - - - - - - - - - - - -
Source:
-
  • openpgp.js, line 11876
- - - -
See:
-
- -
- - - + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + +
@@ -187,7 +188,7 @@ The code is based on the source code for gunzip.c by Pasi Ojala
-

<static> genUUID

+

<static> genUUID()

@@ -207,6 +208,8 @@ EXAMPLES: "92329D39-6F5C-4520-ABFC-AAB64544E172" + + @@ -216,34 +219,42 @@ EXAMPLES:
- - - - - - - - - - - - - - - -
Source:
-
  • openpgp.js, line 12152
- - - - - + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + +
+ + + + @@ -255,7 +266,7 @@ EXAMPLES:
-

<static> Unzip

+

<static> Unzip()

@@ -266,6 +277,8 @@ EXAMPLES: Unzip zip files + + @@ -275,34 +288,42 @@ EXAMPLES:
- - - - - - - - - - - - - - - -
Source:
-
  • openpgp.js, line 10990
- - - - - + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + +
+ + + + @@ -314,7 +335,7 @@ EXAMPLES:
-

<static> utf8Decode

+

<static> utf8Decode(string) → {String}

@@ -325,6 +346,8 @@ EXAMPLES: Decoding string into utf-8 + + @@ -359,9 +382,11 @@ EXAMPLES: - String - - + +String + + + @@ -380,34 +405,42 @@ EXAMPLES:
- - - - - - - - - - - - - - - -
Source:
-
  • openpgp.js, line 12114
- - - - - + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + +
+ + + + @@ -421,15 +454,15 @@ EXAMPLES: -
Type
- String - +String + +
@@ -454,15 +487,15 @@ EXAMPLES:
- Documentation generated by JSDoc 3 on Tue Sep 11 2012 21:45:26 GMT-0400 (EDT) + Documentation generated by JSDoc 3.2.0-dev on Fri Apr 12 2013 14:20:34 GMT+0200 (CEST)
- + diff --git a/doc/_openpgp_packet.html b/doc/_openpgp_packet.html index ef93ab29..3057dac2 100644 --- a/doc/_openpgp_packet.html +++ b/doc/_openpgp_packet.html @@ -4,12 +4,12 @@ JSDoc: Class: _openpgp_packet - - + + - + @@ -30,8 +30,8 @@ _openpgp_packet -
Parent openpgp packet class. Operations focus on determining packet types - and packet header.
+
Parent openpgp packet class. Operations focus on determining +packet types and packet header.
@@ -42,13 +42,15 @@
-

new _openpgp_packet

+

new _openpgp_packet()

+ + @@ -58,34 +60,42 @@
- - - - - - - - - - - - - - - -
Source:
-
  • openpgp.js, line 2108
- - - - - + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + +
+ + + + @@ -115,7 +125,7 @@
-

<inner> encode_length

+

<inner> encode_length(length) → {String}

@@ -127,6 +137,8 @@ string + + @@ -161,16 +173,18 @@ string - Integer - - + +Integer + + + - of the length to encode + The length to encode @@ -182,34 +196,42 @@ string
- - - - - - - - - - - - - - - -
Source:
-
  • openpgp.js, line 2116
- - - - - + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + +
+ + + + @@ -218,20 +240,20 @@ string
- string with openpgp length representation + String with openpgp length representation
-
Type
- string - +String + +
@@ -243,7 +265,7 @@ string
-

<inner> read_packet

+

<inner> read_packet(input, position, len) → {Object}

@@ -254,6 +276,8 @@ string Generic static Packet Parser function + + @@ -288,16 +312,18 @@ string - String - - + +String + + + - input stream as string + Input stream as string @@ -309,16 +335,18 @@ string - integer - - + +integer + + + - position to start parsing + Position to start parsing @@ -330,16 +358,18 @@ string - integer - - + +integer + + + - length of the input from position on + Length of the input from position on @@ -351,34 +381,42 @@ string
- - - - - - - - - - - - - - - -
Source:
-
  • openpgp.js, line 2190
- - - - - + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + +
+ + + + @@ -387,20 +425,20 @@ string
- returns a parsed openpgp_packet + Returns a parsed openpgp_packet
-
Type
- openpgp_packet_* - +Object + +
@@ -412,7 +450,7 @@ string
-

<inner> write_old_packet_header

+

<inner> write_old_packet_header(tag_type, length) → {String}

@@ -424,6 +462,8 @@ string string + + @@ -458,16 +498,18 @@ string - integer - - + +Integer + + + - tag type + Tag type @@ -479,16 +521,18 @@ string - integer - - + +Integer + + + - length of the payload + Length of the payload @@ -500,34 +544,42 @@ string
- - - - - - - - - - - - - - - -
Source:
-
  • openpgp.js, line 2162
- - - - - + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + +
+ + + + @@ -536,20 +588,20 @@ string
- string of the header + String of the header
-
Type
- string - +String + +
@@ -561,7 +613,7 @@ string
-

<inner> write_packet_header

+

<inner> write_packet_header(tag_type, length) → {String}

@@ -573,6 +625,8 @@ string string + + @@ -607,16 +661,18 @@ string - integer - - + +Integer + + + - tag type + Tag type @@ -628,16 +684,18 @@ string - integer - - + +Integer + + + - length of the payload + Length of the payload @@ -649,34 +707,42 @@ string
- - - - - - - - - - - - - - - -
Source:
-
  • openpgp.js, line 2146
- - - - - + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + +
+ + + + @@ -685,20 +751,20 @@ string
- string of the header + String of the header
-
Type
- string - +String + +
@@ -723,15 +789,15 @@ string
- Documentation generated by JSDoc 3 on Tue Sep 11 2012 21:45:26 GMT-0400 (EDT) + Documentation generated by JSDoc 3.2.0-dev on Fri Apr 12 2013 14:20:34 GMT+0200 (CEST)
- + diff --git a/doc/global.html b/doc/global.html index db1fa8dd..0f55353d 100644 --- a/doc/global.html +++ b/doc/global.html @@ -84,12 +84,4188 @@ +

Members

+ +
+ +
+

crc_table

+ + +
+
+ +
+ Internal function to calculate a CRC-24 checksum over a given string (data) +
+ + + +
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + +
+ + + +
+

hash_headers

+ + +
+
+ +
+ ASN1 object identifiers for hashes (See RFC4880 5.2.2) +
+ + + +
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + +
+ + + +
+

util

+ + +
+
+ +
+ an instance that should be used. +
+ + + +
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + +
+ +
+

Methods

+
+

bin2str(bin) → {String}

+ + +
+
+ + +
+ Convert an array of integers(0.255) to a string +
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
bin + + +Integer[] + + + + An array of (binary) integers to convert
+ + + +
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + +
Returns:
+ + +
+ The string representation of the array +
+ + + +
+
+ Type +
+
+ +String + + +
+
+ + + + +
+ + + +
+

calc_checksum(text) → {Integer}

+ + +
+
+ + +
+ Calculates a 16bit sum of a string by adding each character +codes modulus 65535 +
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
text + + +String + + + + String to create a sum of
+ + + +
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + +
Returns:
+ + +
+ An integer containing the sum of all character +codes % 65535 +
+ + + +
+
+ Type +
+
+ +Integer + + +
+
+ + + + +
+ + + +
+

get_hashAlgorithmString() → {String}

+ + +
+
+ + +
+ Return the algorithm type as string +
+ + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + +
Returns:
+ + +
+ String representing the message type +
+ + + +
+
+ Type +
+
+ +String + + +
+
+ + + + +
+ + + +
+

getCheckSum(data) → {String}

+ + +
+
+ + +
+ Calculates a checksum over the given data and returns it base64 encoded +
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
data + + +String + + + + Data to create a CRC-24 checksum for
+ + + +
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + +
Returns:
+ + +
+ Base64 encoded checksum +
+ + + +
+
+ Type +
+
+ +String + + +
+
+ + + + +
+ + + +
+

getPGPMessageType(text) → {Integer}

+ + +
+
+ + +
+ Finds out which Ascii Armoring type is used. This is an internal function +
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
text + + +String + + + + [String] ascii armored text
+ + + +
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + +
Returns:
+ + +
+ 0 = MESSAGE PART n of m + 1 = MESSAGE PART n + 2 = SIGNED MESSAGE + 3 = PGP MESSAGE + 4 = PUBLIC KEY BLOCK + 5 = PRIVATE KEY BLOCK + null = unknown +
+ + + +
+
+ Type +
+
+ +Integer + + +
+
+ + + + +
+ + + +
+

hex2bin(str) → {String}

+ + +
+
+ + +
+ Create binary string from a hex encoded string +
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
str + + +String + + + + Hex string to convert
+ + + +
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + +
Returns:
+ + +
+ String containing the binary values +
+ + + +
+
+ Type +
+
+ +String + + +
+
+ + + + +
+ + + +
+

hexidump(str) → {String}

+ + +
+
+ + +
+ Creating a hex string from an binary array of integers (0..255) +
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
str + + +String + + + + Array of bytes to convert
+ + + +
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + +
Returns:
+ + +
+ Hexadecimal representation of the array +
+ + + +
+
+ Type +
+
+ +String + + +
+
+ + + + +
+ + + +
+

hexstrdump(str) → {String}

+ + +
+
+ + +
+ Create hexstring from a binary +
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
str + + +String + + + + String to convert
+ + + +
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + +
Returns:
+ + +
+ String containing the hexadecimal values +
+ + + +
+
+ Type +
+
+ +String + + +
+
+ + + + +
+ + + +
+

MD5()

+ + +
+
+ + +
+ A fast MD5 JavaScript implementation +Copyright (c) 2012 Joseph Myers +http://www.myersdaily.org/joseph/javascript/md5-text.html + +Permission to use, copy, modify, and distribute this software +and its documentation for any purposes and without +fee is hereby granted provided that this copyright notice +appears in all copies. + +Of course, this soft is provided "as is" without express or implied +warranty of any kind. +
+ + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
+ + + +
+

openpgp_cfb_decrypt(blockcipherfn, block_size, plaintext, key, resync) → {String}

+ + +
+
+ + +
+ This function decrypts a given plaintext using the specified +blockcipher to decrypt a message +
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
blockcipherfn + + +openpgp_cipher_block_fn + + + + The algorithm _encrypt_ function to encrypt + data in one block_size encryption.
block_size + + +Integer + + + + the block size in bytes of the algorithm used
plaintext + + +String + + + + ciphertext to be decrypted provided as a string
key + + +openpgp_byte_array + + + + key to be used to decrypt the ciphertext. This will be passed to the + blockcipherfn
resync + + +Boolean + + + + a boolean value specifying if a resync of the + IV should be used or not. The encrypteddatapacket uses the + "old" style with a resync. Decryption within an + encryptedintegrityprotecteddata packet is not resyncing the IV.
+ + + +
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + +
Returns:
+ + +
+ a string with the plaintext data +
+ + + +
+
+ Type +
+
+ +String + + +
+
+ + + + +
+ + + +
+

openpgp_cfb_encrypt(prefixrandom, blockcipherfn, block_size, plaintext, key, resync) → {String}

+ + +
+
+ + +
+ This function encrypts a given with the specified prefixrandom +using the specified blockcipher to encrypt a message +
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
prefixrandom + + +String + + + + random bytes of block_size length provided + as a string to be used in prefixing the data
blockcipherfn + + +openpgp_cipher_block_fn + + + + the algorithm encrypt function to encrypt + data in one block_size encryption.
block_size + + +Integer + + + + the block size in bytes of the algorithm used
plaintext + + +String + + + + data to be encrypted provided as a string
key + + +openpgp_byte_array + + + + key to be used to encrypt the data. This will be passed to the + blockcipherfn
resync + + +Boolean + + + + a boolean value specifying if a resync of the + IV should be used or not. The encrypteddatapacket uses the + "old" style with a resync. Encryption within an + encryptedintegrityprotecteddata packet is not resyncing the IV.
+ + + +
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + +
Returns:
+ + +
+ a string with the encrypted data +
+ + + +
+
+ Type +
+
+ +String + + +
+
+ + + + +
+ + + +
+

openpgp_cfb_mdc(blockcipherencryptfn, block_size, key, ciphertext) → {String}

+ + +
+
+ + +
+ Decrypts the prefixed data for the Modification Detection Code (MDC) computation +
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
blockcipherencryptfn + + +openpgp_block_cipher_fn + + + + Cipher function to use
block_size + + +Integer + + + + Blocksize of the algorithm
key + + +openpgp_byte_array + + + + The key for encryption
ciphertext + + +String + + + + The encrypted data
+ + + +
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + +
Returns:
+ + +
+ plaintext Data of D(ciphertext) with blocksize length +2 +
+ + + +
+
+ Type +
+
+ +String + + +
+
+ + + + +
+ + + +
+

openpgp_crypto_asymetricDecrypt(algo, publicMPIs, secretMPIs, data) → {BigInteger}

+ + +
+
+ + +
+ Decrypts data using the specified public key multiprecision integers of the private key, +the specified secretMPIs of the private key and the specified algorithm. +
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
algo + + +Integer + + + + Algorithm to be used (See RFC4880 9.1)
publicMPIs + + +openpgp_type_mpi[] + + + + Algorithm dependent multiprecision integers +of the public key part of the private key
secretMPIs + + +openpgp_type_mpi[] + + + + Algorithm dependent multiprecision integers +of the private key used
data + + +openpgp_type_mpi + + + + Data to be encrypted as MPI
+ + + +
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + +
Returns:
+ + +
+ returns a big integer containing the decrypted data; otherwise null +
+ + + +
+
+ Type +
+
+ +BigInteger + + +
+
+ + + + +
+ + + +
+

openpgp_crypto_asymetricEncrypt(algo, publicMPIs, data) → {openpgp_type_mpi|Array.<openpgp_type_mpi>}

+ + +
+
+ + +
+ Encrypts data using the specified public key multiprecision integers +and the specified algorithm. +
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
algo + + +Integer + + + + Algorithm to be used (See RFC4880 9.1)
publicMPIs + + +openpgp_type_mpi[] + + + + Algorithm dependent multiprecision integers
data + + +openpgp_type_mpi + + + + Data to be encrypted as MPI
+ + + +
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + +
Returns:
+ + +
+ if RSA an openpgp_type_mpi; +if elgamal encryption an array of two openpgp_type_mpi is returned; otherwise null +
+ + + +
+
+ Type +
+
+ +openpgp_type_mpi +| + +Array.<openpgp_type_mpi> + + +
+
+ + + + +
+ + + +
+

openpgp_crypto_generateKeyPair(keyType, numBits) → {openpgp_keypair}

+ + +
+
+ + +
+ Calls the necessary crypto functions to generate a keypair. +Called directly by openpgp.js +
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
keyType + + +Integer + + + + Follows OpenPGP algorithm convention.
numBits + + +Integer + + + + Number of bits to make the key to be generated
+ + + +
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +openpgp_keypair + + +
+
+ + + + +
+ + + +
+

openpgp_crypto_generateSessionKey(algo) → {String}

+ + +
+
+ + +
+ Generating a session key for the specified symmetric algorithm +
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
algo + + +Integer + + + + Algorithm to use (see RFC4880 9.2)
+ + + +
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + +
Returns:
+ + +
+ Random bytes as a string to be used as a key +
+ + + +
+
+ Type +
+
+ +String + + +
+
+ + + + +
+ + + +
+

openpgp_crypto_getHashByteLength(algo) → {Integer}

+ + +
+
+ + +
+ Returns the hash size in bytes of the specified hash algorithm type +
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
algo + + +Integer + + + + Hash algorithm type (See RFC4880 9.4)
+ + + +
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + +
Returns:
+ + +
+ Size in bytes of the resulting hash +
+ + + +
+
+ Type +
+
+ +Integer + + +
+
+ + + + +
+ + + +
+

openpgp_crypto_getPrefixRandom(algo) → {String}

+ + +
+
+ + +
+ generate random byte prefix as string for the specified algorithm +
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
algo + + +Integer + + + + Algorithm to use (see RFC4880 9.2)
+ + + +
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + +
Returns:
+ + +
+ Random bytes with length equal to the block +size of the cipher +
+ + + +
+
+ Type +
+
+ +String + + +
+
+ + + + +
+ + + +
+

openpgp_crypto_getPseudoRandom(from, to) → {Integer}

+ + +
+
+ + +
+ Return a pseudo-random number in the specified range +
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
from + + +Integer + + + + Min of the random number
to + + +Integer + + + + Max of the random number (max 32bit)
+ + + +
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + +
Returns:
+ + +
+ A pseudo random number +
+ + + +
+
+ Type +
+
+ +Integer + + +
+
+ + + + +
+ + + +
+

openpgp_crypto_getRandomBigInteger(bits) → {BigInteger}

+ + +
+
+ + +
+ Create a secure random big integer of bits length +
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
bits + + +Integer + + + + Bit length of the MPI to create
+ + + +
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + +
Returns:
+ + +
+ Resulting big integer +
+ + + +
+
+ Type +
+
+ +BigInteger + + +
+
+ + + + +
+ + + +
+

openpgp_crypto_getRandomBytes(length) → {String}

+ + +
+
+ + +
+ Retrieve secure random byte string of the specified length +
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
length + + +Integer + + + + Length in bytes to generate
+ + + +
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + +
Returns:
+ + +
+ Random byte string +
+ + + +
+
+ Type +
+
+ +String + + +
+
+ + + + +
+ + + +
+

openpgp_crypto_getSecureRandom(from, to) → {Integer}

+ + +
+
+ + +
+ Return a secure random number in the specified range +
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
from + + +Integer + + + + Min of the random number
to + + +Integer + + + + Max of the random number (max 32bit)
+ + + +
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + +
Returns:
+ + +
+ A secure random number +
+ + + +
+
+ Type +
+
+ +Integer + + +
+
+ + + + +
+ + + +
+

openpgp_crypto_hashData(algo, data) → {String}

+ + +
+
+ + +
+ Create a hash on the specified data using the specified algorithm +
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
algo + + +Integer + + + + Hash algorithm type (see RFC4880 9.4)
data + + +String + + + + Data to be hashed
+ + + +
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + +
Returns:
+ + +
+ hash value +
+ + + +
+
+ Type +
+
+ +String + + +
+
+ + + + +
+ + + +
+

openpgp_crypto_MDCSystemBytes(algo, key, data) → {String}

+ + +
+
+ + +
+ retrieve the MDC prefixed bytes by decrypting them +
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
algo + + +Integer + + + + Algorithm to use (see RFC4880 9.2)
key + + +String + + + + Key as string. length is depending on the algorithm used
data + + +String + + + + Encrypted data where the prefix is decrypted from
+ + + +
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + +
Returns:
+ + +
+ Plain text data of the prefixed data +
+ + + +
+
+ Type +
+
+ +String + + +
+
+ + + + +
+ + + +
+

openpgp_crypto_signData(hash_algo, algo, publicMPIs, secretMPIs, data) → {String|openpgp_type_mpi}

+ + +
+
+ + +
+ Create a signature on data using the specified algorithm +
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
hash_algo + + +Integer + + + + hash Algorithm to use (See RFC4880 9.4)
algo + + +Integer + + + + Asymmetric cipher algorithm to use (See RFC4880 9.1)
publicMPIs + + +openpgp_type_mpi[] + + + + Public key multiprecision integers +of the private key
secretMPIs + + +openpgp_type_mpi[] + + + + Private key multiprecision +integers which is used to sign the data
data + + +String + + + + Data to be signed
+ + + +
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +String +| + +openpgp_type_mpi + + +
+
+ + + + +
+ + +

openpgp_crypto_symmetricDecrypt(algo, key, data, openpgp_cfb) → {String}

@@ -251,7 +4427,7 @@ otherwise use without the resync (for MDC encrypted data)
Source:
@@ -486,7 +4662,7 @@ openpgp_crypto_getPrefixRandom(algo) to retrieve that string
Source:
@@ -531,12 +4707,3396 @@ openpgp_crypto_getPrefixRandom(algo) to retrieve that string +
+ + + +
+

openpgp_crypto_verifySignature(algo, hash_algo, msg_MPIs, publickey_MPIs, data) → {Boolean}

+ + +
+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
algo + + +Integer + + + + public Key algorithm
hash_algo + + +Integer + + + + Hash algorithm
msg_MPIs + + +openpgp_type_mpi[] + + + + Signature multiprecision integers
publickey_MPIs + + +openpgp_type_mpi[] + + + + Public key multiprecision integers
data + + +String + + + + Data on where the signature was computed on.
+ + + +
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + +
Returns:
+ + +
+ true if signature (sig_data was equal to data over hash) +
+ + + +
+
+ Type +
+
+ +Boolean + + +
+
+ + + + +
+ + + +
+

openpgp_encoding_armor(messagetype, data, partindex, parttotal) → {String}

+ + +
+
+ + +
+ Armor an OpenPGP binary packet block +
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
messagetype + + +Integer + + + + type of the message
data + +
partindex + + +Integer + + + +
parttotal + + +Integer + + + +
+ + + +
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + +
Returns:
+ + +
+ Armored text +
+ + + +
+
+ Type +
+
+ +String + + +
+
+ + + + +
+ + + +
+

openpgp_encoding_armor_addheader() → {String}

+ + +
+
+ + +
+ Add additional information to the armor version of an OpenPGP binary +packet block. +
+ + + + + + + + + +
+ + + +
Version:
+
  • 2011-12-16
+ + + + + + + + + +
Author:
+
+
    +
  • Alex
  • +
+
+ + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + +
Returns:
+ + +
+ The header information +
+ + + +
+
+ Type +
+
+ +String + + +
+
+ + + + +
+ + + +
+

openpgp_encoding_base64_decode(message) → {String}

+ + +
+
+ + +
+ Wrapper function for the base64 codec. +This function decodes a String(message) in base64 (radix-64) +
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
message + + +String + + + + Base64 encoded data
+ + + +
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + +
Returns:
+ + +
+ Raw data after decoding +
+ + + +
+
+ Type +
+
+ +String + + +
+
+ + + + +
+ + + +
+

openpgp_encoding_base64_encode(message) → {String}

+ + +
+
+ + +
+ Wrapper function for the base64 codec. +This function encodes a String (message) in base64 (radix-64) +
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
message + + +String + + + + The message to encode
+ + + +
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + +
Returns:
+ + +
+ The base64 encoded data +
+ + + +
+
+ Type +
+
+ +String + + +
+
+ + + + +
+ + + +
+

openpgp_encoding_deArmor(text) → {String|Object}

+ + +
+
+ + +
+ DeArmor an OpenPGP armored message; verify the checksum and return +the encoded bytes +
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
text + + +String + + + + OpenPGP armored message
+ + + +
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + +
Returns:
+ + +
+ Either the bytes of the decoded message +or an object with attribute "text" containing the message text +and an attribute "openpgp" containing the bytes. +
+ + + +
+
+ Type +
+
+ +String +| + +Object + + +
+
+ + + + +
+ + + +
+

openpgp_encoding_eme_pkcs1_decode(message) → {String}

+ + +
+
+ + +
+ decodes a EME-PKCS1-v1_5 padding (See RFC4880 13.1.2) +
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
message + + +String + + + + EME-PKCS1 padded message
+ + + +
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + +
Returns:
+ + +
+ decoded message +
+ + + +
+
+ Type +
+
+ +String + + +
+
+ + + + +
+ + + +
+

openpgp_encoding_eme_pkcs1_encode(message, length) → {String}

+ + +
+
+ + +
+ create a EME-PKCS1-v1_5 padding (See RFC4880 13.1.1) +
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
message + + +String + + + + message to be padded
length + + +Integer + + + + Length to the resulting message
+ + + +
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + +
Returns:
+ + +
+ EME-PKCS1 padded message +
+ + + +
+
+ Type +
+
+ +String + + +
+
+ + + + +
+ + + +
+

openpgp_encoding_emsa_pkcs1_decode(data) → {String}

+ + +
+
+ + +
+ extract the hash out of an EMSA-PKCS1-v1.5 padding (See RFC4880 13.1.3) +
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
data + + +String + + + + Hash in pkcs1 encoding
+ + + +
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + +
Returns:
+ + +
+ The hash as string +
+ + + +
+
+ Type +
+
+ +String + + +
+
+ + + + +
+ + + +
+

openpgp_encoding_emsa_pkcs1_encode(algo, data, keylength) → {String}

+ + +
+
+ + +
+ create a EMSA-PKCS1-v1_5 padding (See RFC4880 13.1.3) +
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
algo + + +Integer + + + + Hash algorithm type used
data + + +String + + + + Data to be hashed
keylength + + +Integer + + + + Key size of the public mpi in bytes
+ + + +
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + +
Returns:
+ + +
+ Hashcode with pkcs1padding as string +
+ + + +
+
+ Type +
+
+ +String + + +
+
+ + + + +
+ + + +
+

openpgp_encoding_html_encode(message) → {String}

+ + +
+
+ + +
+ Wrapper function for jquery library. +This function escapes HTML characters within a string. This is used +to prevent XSS. +
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
message + + +String + + + + Message to escape
+ + + +
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + +
Returns:
+ + +
+ Html encoded string +
+ + + +
+
+ Type +
+
+ +String + + +
+
+ + + + +
+ + + +
+ + + +
+
+ + +
+ Helper function to print a debug message. Debug +messages are only printed if +openpgp.config.debug is set to true. The calling +Javascript context MUST define +a "showMessages(text)" function. Line feeds ('\n') +are automatically converted to HTML line feeds '
' +
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
str + + +String + + + + String of the debug message
+ + + +
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + +
Returns:
+ + +
+ An HTML tt entity containing a paragraph with a +style attribute where the debug message is HTMLencoded in. +
+ + + +
+
+ Type +
+
+ +String + + +
+
+ + + + +
+ + + +
+ + + +
+
+ + +
+ Helper function to print a debug message. Debug +messages are only printed if +openpgp.config.debug is set to true. The calling +Javascript context MUST define +a "showMessages(text)" function. Line feeds ('\n') +are automatically converted to HTML line feeds '
' +Different than print_debug because will call hexstrdump iff necessary. +
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
str + + +String + + + + String of the debug message
+ + + +
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + +
Returns:
+ + +
+ An HTML tt entity containing a paragraph with a +style attribute where the debug message is HTMLencoded in. +
+ + + +
+
+ Type +
+
+ +String + + +
+
+ + + + +
+ + + +
+ + + +
+
+ + +
+ Helper function to print an error message. +The calling Javascript context MUST define +a "showMessages(text)" function. Line feeds ('\n') +are automatically converted to HTML line feeds '
' +
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
str + + +String + + + + String of the error message
+ + + +
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + +
Returns:
+ + +
+ A HTML paragraph entity with a style attribute +containing the HTML encoded error message +
+ + + +
+
+ Type +
+
+ +String + + +
+
+ + + + +
+ + + +
+ + + +
+
+ + +
+ Helper function to print an info message. +The calling Javascript context MUST define +a "showMessages(text)" function. Line feeds ('\n') +are automatically converted to HTML line feeds '
'. +
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
str + + +String + + + + String of the info message
+ + + +
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + +
Returns:
+ + +
+ A HTML paragraph entity with a style attribute +containing the HTML encoded info message +
+ + + +
+
+ Type +
+
+ +String + + +
+
+ + + + +
+ + + +
+

shiftRight(value, bitcount) → {String}

+ + +
+
+ + +
+ Shifting a string to n bits right +
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
value + + +String + + + + The string to shift
bitcount + + +Integer + + + + Amount of bits to shift (MUST be smaller +than 9)
+ + + +
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + +
Returns:
+ + +
+ Resulting string. +
+ + + +
+
+ Type +
+
+ +String + + +
+
+ + + + +
+ + + +
+

str2bin(str) → {Integer[]}

+ + +
+
+ + +
+ Convert a string to an array of integers(0.255) +
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
str + + +String + + + + String to convert
+ + + +
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + +
Returns:
+ + +
+ An array of (binary) integers +
+ + + +
+
+ Type +
+
+ +Integer[] + + +
+
+ + + + +
+ + + +
+

str2Uint8Array(str) → {Uint8Array}

+ + +
+
+ + +
+ Convert a string to a Uint8Array +
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
str + + +String + + + + String to convert
+ + + +
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + +
Returns:
+ + +
+ The array of (binary) integers +
+ + + +
+
+ Type +
+
+ +Uint8Array + + +
+
+ + + + +
+ + + +
+

Uint8Array2str(bin) → {String}

+ + +
+
+ + +
+ Convert a Uint8Array to a string. This currently functions +the same as bin2str. +
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
bin + + +Uint8Array + + + + An array of (binary) integers to convert
+ + + +
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + +
Returns:
+ + +
+ String representation of the array +
+ + + +
+
+ Type +
+
+ +String + + +
+
+ + + + +
+ + + +
+

verifyCheckSum(data, checksum) → {Boolean}

+ + +
+
+ + +
+ Calculates the checksum over the given data and compares it with the +given base64 encoded checksum +
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
data + + +String + + + + Data to create a CRC-24 checksum for
checksum + + +String + + + + Base64 encoded checksum
+ + + +
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + +
Returns:
+ + +
+ True if the given checksum is correct; otherwise false +
+ + + +
+
+ Type +
+
+ +Boolean + + +
+
+ + + +
+

Type Definitions

+ +
+ +
+

openpgp_byte_array

+ + +
+
+ +
+ An array of bytes, that is integers with values from 0 to 255 +
+ + + +
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + +
+ + + +
+

openpgp_cipher_block_fn(block, key) → {openpgp_byte_array}

+ + +
+
+ + +
+ Block cipher function +
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
block + + +openpgp_byte_array + + + + A block to perform operations on
key + + +openpgp_byte_array + + + + to use in encryption/decryption
+ + + +
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + +
Returns:
+ + +
+ Encrypted/decrypted block +
+ + + +
+
+ Type +
+
+ +openpgp_byte_array + + +
+
+ + + + +
+ + + +
+

openpgp_keypair

+ + +
+
+ + + +
+ + +
Properties:
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
privateKey + + +openpgp_packet_keymaterial + + + +
publicKey + + +openpgp_packet_keymaterial + + + +
+ + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + +
+ +
+ @@ -549,13 +8109,13 @@ openpgp_crypto_getPrefixRandom(algo) to retrieve that string
diff --git a/doc/index.html b/doc/index.html index b1030897..e32350ac 100644 --- a/doc/index.html +++ b/doc/index.html @@ -45,16 +45,101 @@ + + +
+ +
+

+ src/openpgp.js +

+ +
+ +
+
+ + + + +
The openpgp base class should provide all of the functionality +to consume the openpgp.js library. All additional classes are documented +for extending and developing on top of the base library.
+ + + +
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + +
+ +
+ + + +
diff --git a/doc/openpgp.cfb.js.html b/doc/openpgp.cfb.js.html index 106dfb52..f9613e13 100644 --- a/doc/openpgp.cfb.js.html +++ b/doc/openpgp.cfb.js.html @@ -2,7 +2,7 @@ - JSDoc: Source: openpgp.cfb.js + JSDoc: Source: ciphers/openpgp.cfb.js @@ -17,7 +17,7 @@
-

Source: openpgp.cfb.js

+

Source: ciphers/openpgp.cfb.js

@@ -60,7 +60,7 @@ /** * This function encrypts a given with the specified prefixrandom * using the specified blockcipher to encrypt a message - * @param {String[]} prefixrandom random bytes of block_size length provided + * @param {String} prefixrandom random bytes of block_size length provided * as a string to be used in prefixing the data * @param {openpgp_cipher_block_fn} blockcipherfn the algorithm encrypt function to encrypt * data in one block_size encryption. @@ -325,13 +325,13 @@ function normal_cfb_decrypt(blockcipherencryptfn, block_size, key, ciphertext, i

diff --git a/doc/openpgp.crypto.js.html b/doc/openpgp.crypto.js.html index 7a80d7b9..3a6d889e 100644 --- a/doc/openpgp.crypto.js.html +++ b/doc/openpgp.crypto.js.html @@ -2,7 +2,7 @@ - JSDoc: Source: openpgp.crypto.js + JSDoc: Source: ciphers/openpgp.crypto.js @@ -17,7 +17,7 @@
-

Source: openpgp.crypto.js

+

Source: ciphers/openpgp.crypto.js

@@ -465,13 +465,13 @@ function openpgp_crypto_generateKeyPair(keyType, numBits, passphrase, s2kHash, s

diff --git a/doc/openpgp.html b/doc/openpgp.html index 5cec5ebe..f5e389de 100644 --- a/doc/openpgp.html +++ b/doc/openpgp.html @@ -4,12 +4,12 @@ JSDoc: Class: openpgp - - + + - + @@ -41,7 +41,7 @@
-

new openpgp

+

new openpgp()

@@ -53,6 +53,8 @@ from the beginning. To use this library call "openpgp.init()" + + @@ -62,34 +64,42 @@ from the beginning. To use this library call "openpgp.init()"
- - - - - - - - - - - - - - - -
Source:
-
- - - - - + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + +
+ + + + @@ -119,7 +129,7 @@ from the beginning. To use this library call "openpgp.init()"
-

<inner> generate_key_pair

+

<inner> generate_key_pair(keyType, numBits, userId) → {Object}

@@ -127,9 +137,12 @@ from the beginning. To use this library call "openpgp.init()"
- generates a new key pair for openpgp. Beta stage. Currently only supports RSA keys, and no subkeys. + generates a new key pair for openpgp. Beta stage. Currently only +supports RSA keys, and no subkeys.
+ + @@ -164,16 +177,19 @@ from the beginning. To use this library call "openpgp.init()" - int - - + +Integer + + + - to indicate what type of key to make. RSA is 1. Follows algorithms outlined in OpenPGP. + to indicate what type of key to make. +RSA is 1. Follows algorithms outlined in OpenPGP. @@ -185,16 +201,19 @@ from the beginning. To use this library call "openpgp.init()" - int - - + +Integer + + + - number of bits for the key creation. (should be 1024+, generally) + number of bits for the key creation. (should +be 1024+, generally) @@ -206,16 +225,19 @@ from the beginning. To use this library call "openpgp.init()" - string - - + +String + + + - assumes already in form of "User Name " + assumes already in form of "User Name +" @@ -227,34 +249,42 @@ from the beginning. To use this library call "openpgp.init()"
- - - - - - - - - - - - - - - -
Source:
-
  • openpgp.js, line 9925
- - - - - + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + +
+ + + + @@ -262,6 +292,10 @@ from the beginning. To use this library call "openpgp.init()"
Returns:
+
+ {privateKey: [openpgp_msg_privatekey], +privateKeyArmored: [string], publicKeyArmored: [string]} +
@@ -271,8 +305,9 @@ from the beginning. To use this library call "openpgp.init()"
- privateKey: [openpgp_msg_privatekey], privateKeyArmored: [string], publicKeyArmored: [string] - +Object + +
@@ -284,7 +319,7 @@ from the beginning. To use this library call "openpgp.init()"
-

<inner> init

+

<inner> init()

@@ -297,6 +332,8 @@ from the beginning. To use this library call "openpgp.init()" - reading the config from local storage + + @@ -306,48 +343,46 @@ from the beginning. To use this library call "openpgp.init()"
- - - - - - - - - - - - - - - -
Source:
-
- - - - - + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + +
- - - - -
Returns:
- - -
- [void] -
+ - - + + + + + @@ -355,7 +390,7 @@ from the beginning. To use this library call "openpgp.init()"
-

<inner> read_message

+

<inner> read_message(armoredText) → {openpgp_msg_message[]}

@@ -367,6 +402,8 @@ from the beginning. To use this library call "openpgp.init()" returns an array of message objects + + @@ -401,9 +438,11 @@ returns an array of message objects - String - - + +String + + + @@ -422,34 +461,42 @@ returns an array of message objects
- - - - - - - - - - - - - - - -
Source:
-
- - - - - + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + +
+ + + + @@ -464,15 +511,15 @@ returns null -
Type
- Array[openpgp_msg_message] - +openpgp_msg_message[] + +
@@ -484,7 +531,150 @@ returns null
-

<inner> read_privateKey

+

<inner> read_messages_dearmored(input) → {openpgp_msg_message[]}

+ + +
+
+ + +
+ reads message packets out of an OpenPGP armored text and +returns an array of message objects. Can be called externally or internally. +External call will parse a de-armored messaged and return messages found. +Internal will be called to read packets wrapped in other packets (i.e. compressed) +
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
input + + +String + + + + dearmored text of OpenPGP packets, to be parsed
+ + + +
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + +
Returns:
+ + +
+ on error the function +returns null +
+ + + +
+
+ Type +
+
+ +openpgp_msg_message[] + + +
+
+ + + + +
+ + + +
+

<inner> read_privateKey(armoredText) → {openpgp_msg_privatekey[]}

@@ -496,6 +686,8 @@ returns null representation an returns openpgp_msg_privatekey objects + + @@ -530,9 +722,11 @@ representation an returns openpgp_msg_privatekey objects - String - - + +String + + + @@ -552,34 +746,42 @@ the private key(s)
- - - - - - - - - - - - - - - -
Source:
-
- - - - - + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + +
+ + + + @@ -594,15 +796,15 @@ returns null -
Type
- Array[openpgp_msg_privatekey] - +openpgp_msg_privatekey[] + +
@@ -614,7 +816,7 @@ returns null
-

<inner> read_publicKey

+

<inner> read_publicKey(armoredText) → {openpgp_msg_publickey[]}

@@ -626,6 +828,8 @@ returns null representation an returns openpgp_msg_publickey packets + + @@ -660,9 +864,11 @@ representation an returns openpgp_msg_publickey packets - String - - + +String + + + @@ -682,34 +888,42 @@ the public key(s)
- - - - - - - - - - - - - - - -
Source:
-
- - - - - + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + +
+ + + + @@ -724,15 +938,15 @@ returns null -
Type
- Array[openpgp_msg_publickey] - +openpgp_msg_publickey[] + +
@@ -744,7 +958,7 @@ returns null
-

<inner> write_encrypted_message

+

<inner> write_encrypted_message(publickeys, messagetext) → {String}

@@ -756,6 +970,8 @@ returns null The message will be encrypted with the public keys specified + + @@ -790,17 +1006,19 @@ The message will be encrypted with the public keys specified - Array {obj: [openpgp_msg_publickey]} - - + +Object[] + + + - public -keys to be used to encrypt the message + An array of {obj: [openpgp_msg_publickey]} +-public keys to be used to encrypt the message @@ -812,9 +1030,11 @@ keys to be used to encrypt the message - String - - + +String + + + @@ -833,34 +1053,42 @@ keys to be used to encrypt the message
- - - - - - - - - - - - - - - -
Source:
-
- - - - - + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + +
+ + + + @@ -875,15 +1103,15 @@ which can be OpenPGP armored -
Type
- String - +String + +
@@ -895,7 +1123,7 @@ which can be OpenPGP armored
-

<inner> write_signed_and_encrypted_message

+

<inner> write_signed_and_encrypted_message(privatekey, publickeys, messagetext) → {String}

@@ -908,6 +1136,8 @@ The message will be encrypted with the public keys specified and signed with the specified private key. + + @@ -942,16 +1172,19 @@ with the specified private key. - obj: [openpgp_msg_privatekey] - - + +Object + + + - private key to be used to sign the message + {obj: [openpgp_msg_privatekey]} Private key +to be used to sign the message @@ -963,16 +1196,19 @@ with the specified private key. - Array {obj: [openpgp_msg_publickey]} - - + +Object[] + + + - public keys to be used to encrypt the message + An arraf of {obj: [openpgp_msg_publickey]} +- public keys to be used to encrypt the message @@ -984,9 +1220,11 @@ with the specified private key. - String - - + +String + + + @@ -1005,34 +1243,42 @@ with the specified private key.
- - - - - - - - - - - - - - - -
Source:
-
- - - - - + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + +
+ + + + @@ -1041,20 +1287,21 @@ with the specified private key.
- a binary string representation of the message which can be OpenPGP armored + a binary string representation of the message which +can be OpenPGP armored
-
Type
- String - +String + +
@@ -1066,7 +1313,7 @@ with the specified private key.
-

<inner> write_signed_message

+

<inner> write_signed_message(privatekey, messagetext) → {Object}

@@ -1078,6 +1325,8 @@ with the specified private key. The message will be signed with the specified private key. + + @@ -1112,17 +1361,19 @@ The message will be signed with the specified private key. - obj: [openpgp_msg_privatekey] - - + +Object + + + - private -key to be used to sign the message + {obj: [openpgp_msg_privatekey]} +- the private key to be used to sign the message @@ -1134,9 +1385,11 @@ key to be used to sign the message - String - - + +String + + + @@ -1155,34 +1408,42 @@ key to be used to sign the message
- - - - - - - - - - - - - - - -
Source:
-
- - - - - + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + +
+ + + + @@ -1191,22 +1452,23 @@ key to be used to sign the message
- , openpgp: {String} a binary + {Object: text [String]}, openpgp: {String} a binary string representation of the message which can be OpenPGP - armored(openpgp) and a text representation of the message (text). This can be directly used to OpenPGP armor the message + armored(openpgp) and a text representation of the message (text). +This can be directly used to OpenPGP armor the message
-
Type
- Object: text [String] - +Object + +
@@ -1231,15 +1493,15 @@ key to be used to sign the message
- + diff --git a/doc/openpgp_config.html b/doc/openpgp_config.html index ee08b0d8..b831a797 100644 --- a/doc/openpgp_config.html +++ b/doc/openpgp_config.html @@ -4,12 +4,12 @@ JSDoc: Class: openpgp_config - - + + - + @@ -41,7 +41,7 @@
-

new openpgp_config

+

new openpgp_config()

@@ -58,6 +58,8 @@ Stored config parameters can be accessed using openpgp.config.config + + @@ -67,34 +69,42 @@ openpgp.config.config
- - - - - - - - - - - - - - - -
Source:
-
- - - - - + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + +
+ + + + @@ -122,14 +132,14 @@ openpgp.config.config
-

debug

+

config

- if enabled, debug messages will be printed + The variable with the actual configuration
@@ -137,30 +147,298 @@ openpgp.config.config
+
Properties:
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -
Source:
-
  • openpgp.js, line 10289
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
prefer_hash_algorithm + + +Integer + + + +
encryption_cipher + + +Integer + + + +
compression + + +Integer + + + +
show_version + + +Boolean + + + +
show_comment + + +Boolean + + + +
integrity_protect + + +Boolean + + + +
composition_behavior + + +Integer + + + +
keyserver + + +String + + + +
+ + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + +
+ + + +
+

debug

+ + +
+
+ +
+ If enabled, debug messages will be printed +
+ + + +
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + - - - -
@@ -177,7 +455,7 @@ openpgp.config.config
- the default config object which is used if no + The default config object which is used if no configuration was in place
@@ -186,30 +464,34 @@ configuration was in place
- - - - - - - - - - - - - - - -
Source:
-
  • openpgp.js, line 10257
- - - - - + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + +
@@ -225,7 +507,7 @@ configuration was in place
-

<inner> read

+

<inner> read()

@@ -233,11 +515,13 @@ configuration was in place
- reads the config out of the HTML5 local storage + Reads the config out of the HTML5 local storage and initializes the object config. if config is null the default config will be used
+ + @@ -247,48 +531,46 @@ if config is null the default config will be used
- - - - - - - - - - - - - - - -
Source:
-
  • openpgp.js, line 10276
- - - - - + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + +
- - - - -
Returns:
- - -
- [void] -
+ - - + + + + +
@@ -296,7 +578,7 @@ if config is null the default config will be used
-

<inner> write

+

<inner> write()

@@ -304,9 +586,11 @@ if config is null the default config will be used
- writes the config to HTML5 local storage + Writes the config to HTML5 local storage
+ + @@ -316,48 +600,46 @@ if config is null the default config will be used
- - - - - - - - - - - - - - - -
Source:
-
  • openpgp.js, line 10295
- - - - - + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + +
- - - - -
Returns:
- - -
- [void] -
+ - - + + + + + @@ -378,15 +660,15 @@ if config is null the default config will be used
- + diff --git a/doc/openpgp_keyring.html b/doc/openpgp_keyring.html index 50359e18..e577d36b 100644 --- a/doc/openpgp_keyring.html +++ b/doc/openpgp_keyring.html @@ -4,12 +4,12 @@ JSDoc: Class: openpgp_keyring - - + + - + @@ -41,13 +41,15 @@
-

new openpgp_keyring

+

new openpgp_keyring()

+ + @@ -57,34 +59,42 @@
- - - - - - - - - - - - - - - -
Source:
-
  • openpgp.js, line 12660
- - - - - + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + +
+ + + + @@ -114,7 +124,7 @@
-

<inner> exportPrivateKey

+

<inner> exportPrivateKey(index) → {openpgp_msg_privatekey}

@@ -125,6 +135,8 @@ returns the openpgp_msg_privatekey representation of the private key at private key ring index + + @@ -159,9 +171,11 @@ - Integer - - + +Integer + + + @@ -180,34 +194,42 @@
- - - - - - - - - - - - - - - -
Source:
-
  • openpgp.js, line 12876
- - - - - + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + +
+ + + + @@ -221,15 +243,15 @@ -
Type
- openpgp_msg_privatekey - +openpgp_msg_privatekey + +
@@ -241,7 +263,7 @@
-

<inner> exportPublicKey

+

<inner> exportPublicKey(index) → {openpgp_msg_privatekey}

@@ -252,6 +274,8 @@ returns the openpgp_msg_privatekey representation of the public key at public key ring index + + @@ -286,9 +310,11 @@ - Integer - - + +Integer + + + @@ -307,34 +333,42 @@
- - - - - - - - - - - - - - - -
Source:
-
  • openpgp.js, line 12853
- - - - - + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + +
+ + + + @@ -348,15 +382,15 @@ -
Type
- openpgp_msg_privatekey - +openpgp_msg_privatekey + +
@@ -368,7 +402,7 @@
-

<inner> getPrivateKeyForAddress

+

<inner> getPrivateKeyForAddress(email_address) → {openpgp_msg_privatekey[]}

@@ -379,6 +413,8 @@ Searches the keyring for a private key containing the specified email address + + @@ -413,9 +449,11 @@ - String - - + +String + + + @@ -434,34 +472,42 @@
- - - - - - - - - - - - - - - -
Source:
-
  • openpgp.js, line 12757
- - - - - + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + +
+ + + + @@ -475,15 +521,15 @@ -
Type
- Array[openpgp_msg_privatekey - +openpgp_msg_privatekey[] + +
@@ -495,7 +541,7 @@
-

<inner> getPrivateKeyForKeyId

+

<inner> getPrivateKeyForKeyId(keyId) → {openpgp_msg_privatekey[]}

@@ -506,6 +552,8 @@ Searches the keyring for private keys having the specified key id + + @@ -540,9 +588,11 @@ - String - - + +String + + + @@ -561,34 +611,42 @@
- - - - - - - - - - - - - - - -
Source:
-
  • openpgp.js, line 12799
- - - - - + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + +
+ + + + @@ -602,15 +660,15 @@ -
Type
- Array[openpgp_msg_privatekey] - +openpgp_msg_privatekey[] + +
@@ -622,7 +680,7 @@
-

<inner> getPublicKeyForAddress

+

<inner> getPublicKeyForAddress(email_address) → {openpgp_msg_publickey[]}

@@ -633,6 +691,8 @@ searches all public keys in the keyring matching the address or address part of the user ids + + @@ -667,6 +727,11 @@ + +String + + + @@ -685,34 +750,42 @@
- - - - - - - - - - - - - - - -
Source:
-
  • openpgp.js, line 12729
- - - - - + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + +
+ + + + @@ -721,20 +794,20 @@
- the public keys associated with provided email address. + The public keys associated with provided email address.
-
Type
- array[openpgp_msg_publickey] - +openpgp_msg_publickey[] + +
@@ -746,7 +819,7 @@
-

<inner> getPublicKeysForKeyId

+

<inner> getPublicKeysForKeyId(keyId) → {openpgp_msg_privatekey[]}

@@ -757,6 +830,8 @@ Searches the keyring for public keys having the specified key id + + @@ -791,6 +866,11 @@ + +String + + + @@ -809,34 +889,42 @@
- - - - - - - - - - - - - - - -
Source:
-
  • openpgp.js, line 12785
- - - - - + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + +
+ + + + @@ -850,15 +938,15 @@ -
Type
- Array[openpgp_msg_privatekey] - +openpgp_msg_privatekey[] + +
@@ -870,7 +958,7 @@
-

<inner> hasPrivateKey

+

<inner> hasPrivateKey() → {Boolean}

@@ -881,6 +969,8 @@ Checks if at least one private key is in the keyring + + @@ -890,34 +980,42 @@
- - - - - - - - - - - - - - - -
Source:
-
  • openpgp.js, line 12701
- - - - - + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + +
+ + + + @@ -931,15 +1029,15 @@ -
Type
- boolean - +Boolean + +
@@ -951,7 +1049,7 @@
-

<inner> importPrivateKey

+

<inner> importPrivateKey(armored_text)

@@ -962,6 +1060,8 @@ Imports a private key from an exported ascii armored message + + @@ -996,9 +1096,11 @@ - String - - + +String + + + @@ -1017,60 +1119,46 @@
- - - - - - - - - - - - - - - -
Source:
-
  • openpgp.js, line 12835
- - - - - + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + +
+ + + -
Returns:
- -
- nothing -
- - - - -
-
- Type -
-
- - null - -
-
- -
@@ -1078,7 +1166,7 @@
-

<inner> importPublicKey

+

<inner> importPublicKey(armored_text)

@@ -1089,6 +1177,8 @@ Imports a public key from an exported ascii armored message + + @@ -1123,9 +1213,11 @@ - String - - + +String + + + @@ -1144,60 +1236,46 @@
- - - - - - - - - - - - - - - -
Source:
-
  • openpgp.js, line 12822
- - - - - + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + +
+ + + -
Returns:
- -
- nothing -
- - - - -
-
- Type -
-
- - null - -
-
- - @@ -1205,7 +1283,7 @@
-

<inner> init

+

<inner> init()

@@ -1218,6 +1296,8 @@ keyring from HTML5 local storage and initializes this instance. This method is called by openpgp.init(). + + @@ -1227,60 +1307,46 @@ This method is called by openpgp.init().
- - - - - - - - - - - - - - - -
Source:
-
  • openpgp.js, line 12668
- - - - - + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + +
+ + + -
Returns:
- -
- undefined -
- - - - -
-
- Type -
-
- - null - -
-
- - @@ -1288,7 +1354,7 @@ This method is called by openpgp.init().
-

<inner> removePrivateKey

+

<inner> removePrivateKey(index) → {openpgp_msg_privatekey}

@@ -1299,6 +1365,8 @@ This method is called by openpgp.init(). Removes a private key from the private key keyring at the specified index + + @@ -1333,9 +1401,11 @@ This method is called by openpgp.init(). - Integer - - + +Integer + + + @@ -1354,34 +1424,42 @@ This method is called by openpgp.init().
- - - - - - - - - - - - - - - -
Source:
-
  • openpgp.js, line 12886
- - - - - + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + +
+ + + + @@ -1395,15 +1473,15 @@ This method is called by openpgp.init(). -
Type
- openpgp_msg_privatekey - +openpgp_msg_privatekey + +
@@ -1415,7 +1493,7 @@ This method is called by openpgp.init().
-

<inner> removePublicKey

+

<inner> removePublicKey(index) → {openpgp_msg_privatekey}

@@ -1426,6 +1504,8 @@ This method is called by openpgp.init(). Removes a public key from the public key keyring at the specified index + + @@ -1460,9 +1540,11 @@ This method is called by openpgp.init(). - Integer - - + +Integer + + + @@ -1481,34 +1563,42 @@ This method is called by openpgp.init().
- - - - - - - - - - - - - - - -
Source:
-
  • openpgp.js, line 12864
- - - - - + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + +
+ + + + @@ -1522,15 +1612,15 @@ This method is called by openpgp.init(). -
Type
- openpgp_msg_privatekey - +openpgp_msg_privatekey + +
@@ -1542,7 +1632,7 @@ This method is called by openpgp.init().
-

<inner> store

+

<inner> store()

@@ -1554,6 +1644,8 @@ This method is called by openpgp.init(). The privateKeys array and publicKeys array gets Stringified using JSON + + @@ -1563,60 +1655,46 @@ The privateKeys array and publicKeys array gets Stringified using JSON
- - - - - - - - - - - - - - - -
Source:
-
  • openpgp.js, line 12711
- - - - - + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + +
+ + + -
Returns:
- -
- undefined -
- - - - -
-
- Type -
-
- - null - -
-
- - @@ -1637,15 +1715,15 @@ The privateKeys array and publicKeys array gets Stringified using JSON
- + diff --git a/doc/openpgp_msg_message.html b/doc/openpgp_msg_message.html index 50c9f6e6..cdf458d9 100644 --- a/doc/openpgp_msg_message.html +++ b/doc/openpgp_msg_message.html @@ -4,12 +4,12 @@ JSDoc: Class: openpgp_msg_message - - + + - + @@ -41,13 +41,15 @@
-

<protected> new openpgp_msg_message

+

<protected> new openpgp_msg_message()

+ + @@ -57,34 +59,42 @@
- - - - - - - - - - - - - - - -
Source:
-
  • openpgp.js, line 12196
- - - - - + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + +
+ + + + @@ -114,7 +124,7 @@
-

<inner> decrypt

+

<inner> decrypt(private_key, sessionkey) → {String}

@@ -126,6 +136,8 @@ MDC will be verified as well as message signatures + + @@ -160,9 +172,11 @@ MDC will be verified as well as message signatures - openpgp_msg_privatekey - - + +openpgp_msg_privatekey + + + @@ -181,9 +195,11 @@ MDC will be verified as well as message signatures - openpgp_packet_encryptedsessionkey - - + +openpgp_packet_encryptedsessionkey + + + @@ -202,34 +218,42 @@ MDC will be verified as well as message signatures
- - - - - - - - - - - - - - - -
Source:
-
  • openpgp.js, line 12211
- - - - - + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + +
+ + + + @@ -243,15 +267,15 @@ MDC will be verified as well as message signatures -
Type
- String - +String + +
@@ -263,7 +287,7 @@ MDC will be verified as well as message signatures
-

<inner> decryptAndVerifySignature

+

<inner> decryptAndVerifySignature(private_key, sessionkey, pubkey) → {String}

@@ -275,6 +299,8 @@ MDC will be verified as well as message signatures MDC will be verified as well as message signatures + + @@ -309,9 +335,11 @@ MDC will be verified as well as message signatures - openpgp_msg_privatekey - - + +openpgp_msg_privatekey + + + @@ -330,9 +358,11 @@ MDC will be verified as well as message signatures - openpgp_packet_encryptedsessionkey - - + +openpgp_packet_encryptedsessionkey + + + @@ -351,9 +381,11 @@ MDC will be verified as well as message signatures - openpgp_msg_publickey - - + +openpgp_msg_publickey + + + @@ -372,34 +404,42 @@ MDC will be verified as well as message signatures
- - - - - - - - - - - - - - - -
Source:
-
  • openpgp.js, line 12223
- - - - - + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + +
+ + + + @@ -413,15 +453,15 @@ MDC will be verified as well as message signatures -
Type
- String - +String + +
@@ -433,7 +473,7 @@ MDC will be verified as well as message signatures
-

<inner> verifySignature

+

<inner> verifySignature(pubkey) → {boolean}

@@ -444,6 +484,8 @@ MDC will be verified as well as message signatures Verifies a message signature. This function can be called after read_message if the message was signed only. + + @@ -478,9 +520,11 @@ MDC will be verified as well as message signatures - openpgp_msg_publickey - - + +openpgp_msg_publickey + + + @@ -499,34 +543,42 @@ MDC will be verified as well as message signatures
- - - - - - - - - - - - - - - -
Source:
-
  • openpgp.js, line 12282
- - - - - + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + +
+ + + + @@ -540,15 +592,15 @@ MDC will be verified as well as message signatures -
Type
- boolean - +boolean + +
@@ -573,15 +625,15 @@ MDC will be verified as well as message signatures
- Documentation generated by JSDoc 3 on Tue Sep 11 2012 21:45:27 GMT-0400 (EDT) + Documentation generated by JSDoc 3.2.0-dev on Fri Apr 12 2013 14:20:35 GMT+0200 (CEST)
- + diff --git a/doc/openpgp_msg_privatekey.html b/doc/openpgp_msg_privatekey.html index e2e5441a..55edc36e 100644 --- a/doc/openpgp_msg_privatekey.html +++ b/doc/openpgp_msg_privatekey.html @@ -4,12 +4,12 @@ JSDoc: Class: openpgp_msg_privatekey - - + + - + @@ -41,13 +41,15 @@
-

new openpgp_msg_privatekey

+

new openpgp_msg_privatekey()

+ + @@ -57,34 +59,42 @@
- - - - - - - - - - - - - - - -
Source:
-
  • openpgp.js, line 10324
- - - - - + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + +
+ + + + @@ -114,7 +124,7 @@
-

<inner> extractPublicKey

+

<inner> extractPublicKey() → {String}

@@ -125,6 +135,8 @@ extracts the public key part + + @@ -134,34 +146,42 @@
- - - - - - - - - - - - - - - -
Source:
-
  • openpgp.js, line 10448
- - - - - + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + +
+ + + + @@ -176,15 +196,15 @@ -
Type
- String - +String + +
@@ -196,13 +216,15 @@
-

<inner> read_nodes

+

<inner> read_nodes()

+ + @@ -212,34 +234,42 @@
- - - - - - - - - - - - - - - -
Source:
-
  • openpgp.js, line 10336
- - - - - + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + +
+ + + + @@ -274,15 +304,15 @@
- Documentation generated by JSDoc 3 on Tue Sep 11 2012 21:45:27 GMT-0400 (EDT) + Documentation generated by JSDoc 3.2.0-dev on Fri Apr 12 2013 14:20:35 GMT+0200 (CEST)
- + diff --git a/doc/openpgp_msg_publickey.html b/doc/openpgp_msg_publickey.html index 2c2f38dd..3c5fe904 100644 --- a/doc/openpgp_msg_publickey.html +++ b/doc/openpgp_msg_publickey.html @@ -4,12 +4,12 @@ JSDoc: Class: openpgp_msg_publickey - - + + - + @@ -41,13 +41,15 @@
-

new openpgp_msg_publickey

+

new openpgp_msg_publickey()

+ + @@ -57,34 +59,42 @@
- - - - - - - - - - - - - - - -
Source:
-
  • openpgp.js, line 9986
- - - - - + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + +
+ + + + @@ -114,7 +124,7 @@
-

<inner> getEncryptionKey

+

<inner> getEncryptionKey()

@@ -125,6 +135,8 @@ finds an encryption key for this public key + + @@ -134,34 +146,42 @@
- - - - - - - - - - - - - - - -
Source:
-
  • openpgp.js, line 10183
- - - - - + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + +
+ + + + @@ -183,13 +203,15 @@
-

<inner> read_nodes

+

<inner> read_nodes()

+ + @@ -199,34 +221,42 @@
- - - - - - - - - - - - - - - -
Source:
-
  • openpgp.js, line 10003
- - - - - + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + +
+ + + + @@ -248,7 +278,7 @@
-

<inner> verifyBasicSignatures

+

<inner> verifyBasicSignatures() → {Boolean}

@@ -264,6 +294,8 @@ This is useful for validating the key + + @@ -273,34 +305,42 @@
- - - - - - - - - - - - - - - -
Source:
-
  • openpgp.js, line 10124
- - - - - + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + +
+ + + + @@ -314,6 +354,18 @@ +
+
+ Type +
+
+ +Boolean + + +
+
+ @@ -322,7 +374,7 @@
-

<inner> verifyCertificationSignatures

+

<inner> verifyCertificationSignatures()

@@ -333,6 +385,8 @@ verifies all signatures + + @@ -342,34 +396,42 @@
- - - - - - - - - - - - - - - -
Source:
-
  • openpgp.js, line 10106
- - - - - + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + +
+ + + + @@ -404,15 +466,15 @@
- Documentation generated by JSDoc 3 on Tue Sep 11 2012 21:45:27 GMT-0400 (EDT) + Documentation generated by JSDoc 3.2.0-dev on Fri Apr 12 2013 14:20:35 GMT+0200 (CEST)
- + diff --git a/doc/openpgp_packet_compressed.html b/doc/openpgp_packet_compressed.html index 456ff6db..251d24b3 100644 --- a/doc/openpgp_packet_compressed.html +++ b/doc/openpgp_packet_compressed.html @@ -4,12 +4,12 @@ JSDoc: Class: openpgp_packet_compressed - - + + - + @@ -47,13 +47,15 @@ packet.
-

new openpgp_packet_compressed

+

new openpgp_packet_compressed()

+ + @@ -63,34 +65,42 @@ packet.
- - - - - - - - - - - - - - - -
Source:
-
  • openpgp.js, line 2519
- - - - - + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + +
+ + + + @@ -120,7 +130,7 @@ packet.
-

<inner> compress

+

<inner> compress(type, data) → {String}

@@ -131,6 +141,8 @@ packet. Compress the packet data (member decompressedData) + + @@ -165,16 +177,18 @@ packet. - integer - - + +Integer + + + - algorithm to be used // See RFC 4880 9.3 + Algorithm to be used // See RFC 4880 9.3 @@ -186,16 +200,18 @@ packet. - String - - + +String + + + - data to be compressed + Data to be compressed @@ -207,34 +223,42 @@ packet.
- - - - - - - - - - - - - - - -
Source:
-
  • openpgp.js, line 2599
- - - - - + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + +
+ + + + @@ -248,15 +272,15 @@ packet. -
Type
- String - +String + +
@@ -268,7 +292,7 @@ packet.
-

<inner> decompress

+

<inner> decompress() → {String}

@@ -276,10 +300,12 @@ packet.
- decompression method for decompressing the compressed data + Decompression method for decompressing the compressed data read by read_packet
+ + @@ -289,34 +315,42 @@ read by read_packet
- - - - - - - - - - - - - - - -
Source:
-
  • openpgp.js, line 2543
- - - - - + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + +
+ + + + @@ -325,20 +359,20 @@ read by read_packet
- the decompressed data + The decompressed data
-
Type
- String - +String + +
@@ -350,7 +384,7 @@ read by read_packet
-

<inner> read_packet

+

<inner> read_packet(input, position, len) → {openpgp_packet_compressed}

@@ -358,9 +392,11 @@ read by read_packet
- parsing function for the packet. + Parsing function for the packet.
+ + @@ -395,16 +431,18 @@ read by read_packet - string - - + +String + + + - payload of a tag 8 packet + Payload of a tag 8 packet @@ -416,16 +454,18 @@ read by read_packet - integer - - + +Integer + + + - position to start reading from the input string + Position to start reading from the input string @@ -437,16 +477,19 @@ read by read_packet - integer - - + +Integer + + + - length of the packet or the remaining length of input at position + Length of the packet or the remaining length of +input at position @@ -458,34 +501,42 @@ read by read_packet
- - - - - - - - - - - - - - - -
Source:
-
  • openpgp.js, line 2529
- - - - - + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + +
+ + + + @@ -494,20 +545,20 @@ read by read_packet
- object representation + Object representation
-
Type
- openpgp_packet_compressed - +openpgp_packet_compressed + +
@@ -519,7 +570,7 @@ read by read_packet
-

<inner> toString

+

<inner> toString() → {String}

@@ -527,9 +578,11 @@ read by read_packet
- pretty printing the packet (useful for debug purposes) + Pretty printing the packet (useful for debug purposes)
+ + @@ -539,34 +592,42 @@ read by read_packet
- - - - - - - - - - - - - - - -
Source:
-
  • openpgp.js, line 2644
- - - - - + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + +
+ + + + @@ -576,15 +637,15 @@ read by read_packet -
Type
- String - +String + +
@@ -596,7 +657,7 @@ read by read_packet
-

<inner> write_packet

+

<inner> write_packet(algorithm, data) → {String}

@@ -604,9 +665,11 @@ read by read_packet
- creates a string representation of the packet + Creates a string representation of the packet
+ + @@ -641,16 +704,18 @@ read by read_packet - integer - - + +Integer + + + - algorithm to be used // See RFC 4880 9.3 + Algorithm to be used // See RFC 4880 9.3 @@ -662,16 +727,18 @@ read by read_packet - String - - + +String + + + - data to be compressed + Data to be compressed @@ -683,34 +750,42 @@ read by read_packet
- - - - - - - - - - - - - - - -
Source:
-
  • openpgp.js, line 2631
- - - - - + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + +
+ + + + @@ -719,20 +794,20 @@ read by read_packet
- string-representation of the packet + String-representation of the packet
-
Type
- String - +String + +
@@ -757,15 +832,15 @@ read by read_packet
- Documentation generated by JSDoc 3 on Tue Sep 11 2012 21:45:27 GMT-0400 (EDT) + Documentation generated by JSDoc 3.2.0-dev on Fri Apr 12 2013 14:20:35 GMT+0200 (CEST)
- + diff --git a/doc/openpgp_packet_encrypteddata.html b/doc/openpgp_packet_encrypteddata.html index 93ba2c04..60049e41 100644 --- a/doc/openpgp_packet_encrypteddata.html +++ b/doc/openpgp_packet_encrypteddata.html @@ -4,12 +4,12 @@ JSDoc: Class: openpgp_packet_encrypteddata - - + + - + @@ -47,13 +47,15 @@ that form whole OpenPGP messages).
-

new openpgp_packet_encrypteddata

+

new openpgp_packet_encrypteddata()

+ + @@ -63,34 +65,42 @@ that form whole OpenPGP messages).
- - - - - - - - - - - - - - - -
Source:
-
  • openpgp.js, line 1860
- - - - - + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + +
+ + + + @@ -120,7 +130,7 @@ that form whole OpenPGP messages).
-

<inner> decrypt_sym

+

<inner> decrypt_sym(symmetric_algorithm_type, key)

@@ -128,9 +138,11 @@ that form whole OpenPGP messages).
- symmetrically decrypt the packet data + Symmetrically decrypt the packet data
+ + @@ -165,16 +177,18 @@ that form whole OpenPGP messages). - integer - - + +Integer + + + - symmetric key algorithm to use // See RFC4880 9.2 + Symmetric key algorithm to use // See RFC4880 9.2 @@ -186,16 +200,18 @@ that form whole OpenPGP messages). - String - - + +String + + + - key as string with the corresponding length to the + Key as string with the corresponding length to the algorithm @@ -208,34 +224,42 @@ that form whole OpenPGP messages).
- - - - - - - - - - - - - - - -
Source:
-
  • openpgp.js, line 1894
- - - - - + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + +
+ + + + @@ -244,7 +268,7 @@ that form whole OpenPGP messages).
- the decrypted data; + The decrypted data;
@@ -257,7 +281,7 @@ that form whole OpenPGP messages).
-

<inner> read_packet

+

<inner> read_packet(input, position, len) → {openpgp_packet_encrypteddata}

@@ -265,9 +289,11 @@ that form whole OpenPGP messages).
- parsing function for the packet. + Parsing function for the packet.
+ + @@ -302,16 +328,18 @@ that form whole OpenPGP messages). - string - - + +String + + + - payload of a tag 9 packet + Payload of a tag 9 packet @@ -323,16 +351,18 @@ that form whole OpenPGP messages). - integer - - + +Integer + + + - position to start reading from the input string + Position to start reading from the input string @@ -344,16 +374,18 @@ that form whole OpenPGP messages). - integer - - + +Integer + + + - length of the packet or the remaining length of + Length of the packet or the remaining length of input at position @@ -366,34 +398,42 @@ that form whole OpenPGP messages).
- - - - - - - - - - - - - - - -
Source:
-
  • openpgp.js, line 1875
- - - - - + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + +
+ + + + @@ -402,20 +442,20 @@ that form whole OpenPGP messages).
- object representation + Object representation
-
Type
- openpgp_packet_encrypteddata - +openpgp_packet_encrypteddata + +
@@ -427,7 +467,7 @@ that form whole OpenPGP messages).
-

<inner> write_packet

+

<inner> write_packet(algo, key, data) → {String}

@@ -438,6 +478,8 @@ that form whole OpenPGP messages). Creates a string representation of the packet + + @@ -472,16 +514,18 @@ that form whole OpenPGP messages). - Integer - - + +Integer + + + - symmetric key algorithm to use // See RFC4880 9.2 + Symmetric key algorithm to use // See RFC4880 9.2 @@ -493,16 +537,18 @@ that form whole OpenPGP messages). - String - - + +String + + + - key as string with the corresponding length to the + Key as string with the corresponding length to the algorithm @@ -515,16 +561,18 @@ that form whole OpenPGP messages). - String - - + +String + + + - data to be + Data to be @@ -536,34 +584,42 @@ that form whole OpenPGP messages).
- - - - - - - - - - - - - - - -
Source:
-
  • openpgp.js, line 1911
- - - - - + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + +
+ + + + @@ -572,20 +628,20 @@ that form whole OpenPGP messages).
- string-representation of the packet + String-representation of the packet
-
Type
- String - +String + +
@@ -610,15 +666,15 @@ that form whole OpenPGP messages).
- Documentation generated by JSDoc 3 on Tue Sep 11 2012 21:45:27 GMT-0400 (EDT) + Documentation generated by JSDoc 3.2.0-dev on Fri Apr 12 2013 14:20:35 GMT+0200 (CEST)
- + diff --git a/doc/openpgp_packet_encryptedintegrityprotecteddata.html b/doc/openpgp_packet_encryptedintegrityprotecteddata.html index 7fc78d6e..6711c584 100644 --- a/doc/openpgp_packet_encryptedintegrityprotecteddata.html +++ b/doc/openpgp_packet_encryptedintegrityprotecteddata.html @@ -4,12 +4,12 @@ JSDoc: Class: openpgp_packet_encryptedintegrityprotecteddata - - + + - + @@ -30,7 +30,8 @@ openpgp_packet_encryptedintegrityprotecteddata -
Implementation of the Sym. Encrypted Integrity Protected Data Packet (Tag 18) +
Implementation of the Sym. Encrypted Integrity Protected Data +Packet (Tag 18) RFC4880 5.13: The Symmetrically Encrypted Integrity Protected Data packet is a variant of the Symmetrically Encrypted Data packet. It is a new feature @@ -47,13 +48,15 @@ packet.
-

new openpgp_packet_encryptedintegrityprotecteddata

+

new openpgp_packet_encryptedintegrityprotecteddata()

+ + @@ -63,34 +66,42 @@ packet.
- - - - - - - - - - - - - - - -
Source:
-
  • openpgp.js, line 968
- - - - - + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + +
+ + + + @@ -120,7 +131,7 @@ packet.
-

<inner> decrypt

+

<inner> decrypt(symmetric_algorithm_type, key) → {String}

@@ -132,6 +143,8 @@ packet. have been called before + + @@ -166,16 +179,18 @@ have been called before - integer - - + +Integer + + + - the selected symmetric encryption algorithm to be used + The selected symmetric encryption algorithm to be used @@ -187,16 +202,18 @@ have been called before - String - - + +String + + + - the key of cipher blocksize length to be used + The key of cipher blocksize length to be used @@ -208,34 +225,42 @@ have been called before
- - - - - - - - - - - - - - - -
Source:
-
  • openpgp.js, line 1054
- - - - - + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + +
+ + + + @@ -244,11 +269,23 @@ have been called before
- the decrypted data of this packet + The decrypted data of this packet
+
+
+ Type +
+
+ +String + + +
+
+ @@ -257,7 +294,7 @@ have been called before
-

<inner> read_packet

+

<inner> read_packet(input, position, len) → {openpgp_packet_encryptedintegrityprotecteddata}

@@ -265,9 +302,11 @@ have been called before
- parsing function for the packet. + Parsing function for the packet.
+ + @@ -302,16 +341,18 @@ have been called before - string - - + +String + + + - payload of a tag 18 packet + Payload of a tag 18 packet @@ -323,9 +364,11 @@ have been called before - integer - - + +Integer + + + @@ -344,16 +387,18 @@ have been called before - integer - - + +Integer + + + - length of the packet or the remaining length of + Length of the packet or the remaining length of input at position @@ -366,34 +411,42 @@ have been called before
- - - - - - - - - - - - - - - -
Source:
-
  • openpgp.js, line 986
- - - - - + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + +
+ + + + @@ -408,15 +461,15 @@ have been called before -
Type
- openpgp_packet_encryptedintegrityprotecteddata - +openpgp_packet_encryptedintegrityprotecteddata + +
@@ -428,7 +481,7 @@ have been called before
-

<inner> write_packet

+

<inner> write_packet(symmetric_algorithm, key, data) → {String}

@@ -440,6 +493,8 @@ have been called before Data Packet (tag 18) (see RFC4880 5.13) + + @@ -474,16 +529,18 @@ Data Packet (tag 18) (see RFC4880 5.13) - integer - - + +Integer + + + - the selected symmetric encryption algorithm to be used + The selected symmetric encryption algorithm to be used @@ -495,16 +552,18 @@ Data Packet (tag 18) (see RFC4880 5.13) - String - - + +String + + + - the key of cipher blocksize length to be used + The key of cipher blocksize length to be used @@ -516,13 +575,18 @@ Data Packet (tag 18) (see RFC4880 5.13) + +String + + + - plaintext data to be encrypted within the packet + Plaintext data to be encrypted within the packet @@ -534,34 +598,42 @@ Data Packet (tag 18) (see RFC4880 5.13)
- - - - - - - - - - - - - - - -
Source:
-
  • openpgp.js, line 1021
- - - - - + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + +
+ + + + @@ -570,11 +642,23 @@ Data Packet (tag 18) (see RFC4880 5.13)
- a string representation of the packet + A string representation of the packet
+
+
+ Type +
+
+ +String + + +
+
+ @@ -596,15 +680,15 @@ Data Packet (tag 18) (see RFC4880 5.13)
- Documentation generated by JSDoc 3 on Tue Sep 11 2012 21:45:27 GMT-0400 (EDT) + Documentation generated by JSDoc 3.2.0-dev on Fri Apr 12 2013 14:20:35 GMT+0200 (CEST)
- + diff --git a/doc/openpgp_packet_encryptedsessionkey.html b/doc/openpgp_packet_encryptedsessionkey.html index 37923a22..1f3076ae 100644 --- a/doc/openpgp_packet_encryptedsessionkey.html +++ b/doc/openpgp_packet_encryptedsessionkey.html @@ -4,12 +4,12 @@ JSDoc: Class: openpgp_packet_encryptedsessionkey - - + + - + @@ -53,13 +53,15 @@ decrypt the message.
-

new openpgp_packet_encryptedsessionkey

+

new openpgp_packet_encryptedsessionkey()

+ + @@ -69,34 +71,42 @@ decrypt the message.
- - - - - - - - - - - - - - - -
Source:
-
  • openpgp.js, line 1542
- - - - - + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + +
+ + + + @@ -126,7 +136,7 @@ decrypt the message.
-

<inner> decrypt

+

<inner> decrypt(msg, key) → {String}

@@ -138,6 +148,8 @@ decrypt the message. packets (tag 1) + + @@ -172,16 +184,18 @@ packets (tag 1) - openpgp_msg_message - - + +openpgp_msg_message + + + - the message object (with member encryptedData + The message object (with member encryptedData @@ -193,16 +207,18 @@ packets (tag 1) - openpgp_msg_privatekey - - + +openpgp_msg_privatekey + + + - private key with secMPIs unlocked + Private key with secMPIs unlocked @@ -214,34 +230,42 @@ packets (tag 1)
- - - - - - - - - - - - - - - -
Source:
-
  • openpgp.js, line 1673
- - - - - + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + +
+ + + + @@ -250,20 +274,20 @@ packets (tag 1)
- the unencrypted session key + The unencrypted session key
-
Type
- String - +String + +
@@ -275,7 +299,7 @@ packets (tag 1)
-

<inner> read_pub_key_packet

+

<inner> read_pub_key_packet(input, position, len) → {openpgp_packet_encrypteddata}

@@ -283,9 +307,11 @@ packets (tag 1)
- parsing function for a publickey encrypted session key packet (tag 1). + Parsing function for a publickey encrypted session key packet (tag 1).
+ + @@ -320,16 +346,18 @@ packets (tag 1) - string - - + +String + + + - payload of a tag 1 packet + Payload of a tag 1 packet @@ -341,16 +369,18 @@ packets (tag 1) - integer - - + +Integer + + + - position to start reading from the input string + Position to start reading from the input string @@ -362,16 +392,18 @@ packets (tag 1) - integer - - + +Integer + + + - length of the packet or the remaining length of + Length of the packet or the remaining length of input at position @@ -384,34 +416,42 @@ packets (tag 1)
- - - - - - - - - - - - - - - -
Source:
-
  • openpgp.js, line 1553
- - - - - + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + +
+ + + + @@ -420,20 +460,20 @@ packets (tag 1)
- object representation + Object representation
-
Type
- openpgp_packet_encrypteddata - +openpgp_packet_encrypteddata + +
@@ -445,7 +485,7 @@ packets (tag 1)
-

<inner> read_symmetric_key_packet

+

<inner> read_symmetric_key_packet(input, position, len) → {openpgp_packet_encrypteddata}

@@ -453,9 +493,11 @@ packets (tag 1)
- parsing function for a symmetric encrypted session key packet (tag 3). + Parsing function for a symmetric encrypted session key packet (tag 3).
+ + @@ -490,16 +532,18 @@ packets (tag 1) - string - - + +String + + + - payload of a tag 1 packet + Payload of a tag 1 packet @@ -511,16 +555,18 @@ packets (tag 1) - integer - - + +Integer + + + - position to start reading from the input string + Position to start reading from the input string @@ -532,16 +578,18 @@ packets (tag 1) - integer - - + +Integer + + + - length of the packet or the remaining length of + Length of the packet or the remaining length of input at position @@ -554,34 +602,42 @@ packets (tag 1)
- - - - - - - - - - - - - - - -
Source:
-
  • openpgp.js, line 1641
- - - - - + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + +
+ + + + @@ -590,20 +646,20 @@ packets (tag 1)
- object representation + Object representation
-
Type
- openpgp_packet_encrypteddata - +openpgp_packet_encrypteddata + +
@@ -615,7 +671,7 @@ packets (tag 1)
-

<inner> toString

+

<inner> toString() → {String}

@@ -627,6 +683,8 @@ packets (tag 1) purposes) + + @@ -636,34 +694,42 @@ purposes)
- - - - - - - - - - - - - - - -
Source:
-
  • openpgp.js, line 1700
- - - - - + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + +
+ + + + @@ -672,11 +738,23 @@ purposes)
- the string containing a openpgp description + The string containing a openpgp description
+
+
+ Type +
+
+ +String + + +
+
+ @@ -685,7 +763,7 @@ purposes)
-

<inner> write_pub_key_packet

+

<inner> write_pub_key_packet(publicKeyId, publicMPIs, pubalgo, symmalgo, sessionkey) → {String}

@@ -693,9 +771,11 @@ purposes)
- create a string representation of a tag 1 packet + Create a string representation of a tag 1 packet
+ + @@ -730,16 +810,18 @@ purposes) - String - - + +String + + + - the public key id corresponding to publicMPIs key as string + The public key id corresponding to publicMPIs key as string @@ -751,16 +833,18 @@ purposes) - Array[openpgp_type_mpi] - - + +openpgp_type_mpi[] + + + - multiprecision integer objects describing the public key + Multiprecision integer objects describing the public key @@ -772,16 +856,18 @@ purposes) - integer - - + +Integer + + + - the corresponding public key algorithm // See RFC4880 9.1 + The corresponding public key algorithm // See RFC4880 9.1 @@ -793,17 +879,20 @@ purposes) - integer - - + +Integer + + + - the symmetric cipher algorithm used to encrypt the data within - an encrypteddatapacket or encryptedintegrityprotecteddatapacket + The symmetric cipher algorithm used to encrypt the data + within an encrypteddatapacket or encryptedintegrity- + protecteddatapacket following this packet //See RFC4880 9.2 @@ -816,16 +905,18 @@ purposes) - String - - + +String + + + - a string of randombytes representing the session key + A string of randombytes representing the session key @@ -837,34 +928,42 @@ purposes)
- - - - - - - - - - - - - - - -
Source:
-
  • openpgp.js, line 1610
- - - - - + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + +
+ + + + @@ -873,20 +972,20 @@ purposes)
- the string representation + The string representation
-
Type
- String - +String + +
@@ -911,15 +1010,15 @@ purposes)
- Documentation generated by JSDoc 3 on Tue Sep 11 2012 21:45:27 GMT-0400 (EDT) + Documentation generated by JSDoc 3.2.0-dev on Fri Apr 12 2013 14:20:35 GMT+0200 (CEST)
- + diff --git a/doc/openpgp_packet_keymaterial.html b/doc/openpgp_packet_keymaterial.html index c64e2485..c9f16cf7 100644 --- a/doc/openpgp_packet_keymaterial.html +++ b/doc/openpgp_packet_keymaterial.html @@ -4,12 +4,12 @@ JSDoc: Class: openpgp_packet_keymaterial - - + + - + @@ -46,13 +46,15 @@ major versions. Consequently, this section is complex.
-

new openpgp_packet_keymaterial

+

new openpgp_packet_keymaterial()

+ + @@ -62,34 +64,42 @@ major versions. Consequently, this section is complex.
- - - - - - - - - - - - - - - -
Source:
-
  • openpgp.js, line 2683
- - - - - + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + +
+ + + + @@ -119,7 +129,7 @@ major versions. Consequently, this section is complex.
-

<inner> decryptSecretMPIs

+

<inner> decryptSecretMPIs(str_passphrase) → {Boolean}

@@ -128,10 +138,13 @@ major versions. Consequently, this section is complex.
Decrypts the private key MPIs which are needed to use the key. -openpgp_packet_keymaterial.hasUnencryptedSecretKeyData should be false otherwise +openpgp_packet_keymaterial.hasUnencryptedSecretKeyData should be +false otherwise a call to this function is not needed
+ + @@ -166,13 +179,19 @@ a call to this function is not needed + +String + + + - the passphrase for this private key as string + The passphrase for this private key +as string @@ -184,34 +203,42 @@ a call to this function is not needed
- - - - - - - - - - - - - - - -
Source:
-
  • openpgp.js, line 3024
- - - - - + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + +
+ + + + @@ -220,89 +247,20 @@ a call to this function is not needed
- true if the passphrase was correct; false if not + True if the passphrase was correct; false if not
- - - -
- - - -
-

<inner> getFingerprint

- - -
-
- - -
- calculates the fingerprint of the key -
- - - - - - - -
- - - - - - - - - - - - - - - - - -
Source:
-
  • openpgp.js, line 3334
- - - - - - - -
- - - - - - - -
Returns:
- - -
- a string containing the fingerprint -
- - - -
Type
- String - +Boolean + +
@@ -314,7 +272,7 @@ a call to this function is not needed
-

<inner> getKeyId

+

<inner> getFingerprint() → {String}

@@ -322,9 +280,11 @@ a call to this function is not needed
- calculates the key id of they key + Calculates the fingerprint of the key
+ + @@ -334,34 +294,42 @@ a call to this function is not needed
- - - - - - - - - - - - - - - -
Source:
-
  • openpgp.js, line 3319
- - - - - + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + +
+ + + + @@ -370,20 +338,20 @@ a call to this function is not needed
- a 8 byte key id + A string containing the fingerprint
-
Type
- String - +String + +
@@ -395,7 +363,98 @@ a call to this function is not needed
-

<inner> read_nodes

+

<inner> getKeyId() → {String}

+ + +
+
+ + +
+ Calculates the key id of they key +
+ + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + +
Returns:
+ + +
+ A 8 byte key id +
+ + + +
+
+ Type +
+
+ +String + + +
+
+ + + + +
+ + + +
+

<inner> read_nodes(parent_node, input, position, len) → {Integer}

@@ -406,6 +465,8 @@ a call to this function is not needed Continue parsing packets belonging to the key material such as signatures + + @@ -440,16 +501,18 @@ a call to this function is not needed - openpgp_* - - + +Object + + + - the parent object + The parent object @@ -461,16 +524,18 @@ a call to this function is not needed - String - - + +String + + + - input string to read the packet(s) from + Input string to read the packet(s) from @@ -482,16 +547,18 @@ a call to this function is not needed - integer - - + +Integer + + + - start position for the parser + Start position for the parser @@ -503,16 +570,18 @@ a call to this function is not needed - integer - - + +Integer + + + - length of the packet(s) or remaining length of input + Length of the packet(s) or remaining length of input @@ -524,34 +593,42 @@ a call to this function is not needed
- - - - - - - - - - - - - - - -
Source:
-
  • openpgp.js, line 3211
- - - - - + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + +
+ + + + @@ -560,20 +637,20 @@ a call to this function is not needed
- length of nodes read + Length of nodes read
-
Type
- integer - +Integer + +
@@ -585,7 +662,7 @@ a call to this function is not needed
-

<inner> read_priv_key

+

<inner> read_priv_key(input, position, len) → {Object}

@@ -596,6 +673,8 @@ a call to this function is not needed Internal parser for private keys as specified in RFC 4880 section 5.5.3 + + @@ -630,13 +709,18 @@ a call to this function is not needed + +String + + + - input string to read the packet from + Input string to read the packet from @@ -648,13 +732,18 @@ a call to this function is not needed + +Integer + + + - start position for the parser + Start position for the parser @@ -666,13 +755,18 @@ a call to this function is not needed + +Integer + + + - length of the packet or remaining length of input + Length of the packet or remaining length of input @@ -684,34 +778,42 @@ a call to this function is not needed
- - - - - - - - - - - - - - - -
Source:
-
  • openpgp.js, line 2890
- - - - - + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + +
+ + + + @@ -720,11 +822,23 @@ a call to this function is not needed
- this object with attributes set by the parser + This object with attributes set by the parser
+
+
+ Type +
+
+ +Object + + +
+
+ @@ -733,7 +847,7 @@ a call to this function is not needed
-

<inner> read_pub_key

+

<inner> read_pub_key(input, position, len) → {Object}

@@ -741,158 +855,12 @@ a call to this function is not needed
- Internal Parser for public keys as specified in RFC 4880 section 5.5.2 Public-Key Packet Formats + Internal Parser for public keys as specified in RFC 4880 section +5.5.2 Public-Key Packet Formats called by read_tag<num>
- - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
input - - input string to read the packet from
position - - start position for the parser
len - - length of the packet or remaining length of input
- - - -
- - - - - - - - - - - - - - - - - -
Source:
-
  • openpgp.js, line 2780
- - - - - - - -
- - - - - - - -
Returns:
- - -
- this object with attributes set by the parser -
- - - - - - -
- - - -
-

<inner> read_tag14

- - -
-
- - -
- This function reads the payload of a public key sub packet (Tag 14) -and initializes the openpgp_packet_keymaterial -
@@ -928,13 +896,18 @@ and initializes the openpgp_packet_keymaterial + +String + + + - input string to read the packet from + Input string to read the packet from @@ -946,13 +919,18 @@ and initializes the openpgp_packet_keymaterial + +Integer + + + - start position for the parser + Start position for the parser @@ -964,13 +942,18 @@ and initializes the openpgp_packet_keymaterial + +Integer + + + - length of the packet or remaining length of input + Length of the packet or remaining length of input @@ -982,34 +965,42 @@ and initializes the openpgp_packet_keymaterial
- - - - - - - - - - - - - - - -
Source:
-
  • openpgp.js, line 2763
- - - - - + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + +
+ + + + @@ -1018,11 +1009,23 @@ and initializes the openpgp_packet_keymaterial
- openpgp_packet_keymaterial object + This object with attributes set by the parser
+
+
+ Type +
+
+ +Object + + +
+
+ @@ -1031,7 +1034,7 @@ and initializes the openpgp_packet_keymaterial
-

<inner> read_tag5

+

<inner> read_tag5(input, position, len) → {openpgp_packet_keymaterial}

@@ -1043,6 +1046,8 @@ and initializes the openpgp_packet_keymaterial and initializes the openpgp_packet_keymaterial + + @@ -1077,13 +1082,18 @@ and initializes the openpgp_packet_keymaterial + +String + + + - input string to read the packet from + Input string to read the packet from @@ -1095,13 +1105,18 @@ and initializes the openpgp_packet_keymaterial + +Integer + + + - start position for the parser + Start position for the parser @@ -1113,13 +1128,18 @@ and initializes the openpgp_packet_keymaterial + +Intefer + + + - length of the packet or remaining length of input + Length of the packet or remaining length of input @@ -1131,34 +1151,42 @@ and initializes the openpgp_packet_keymaterial
- - - - - - - - - - - - - - - -
Source:
-
  • openpgp.js, line 2714
- - - - - + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + +
+ + + + @@ -1166,11 +1194,19 @@ and initializes the openpgp_packet_keymaterial
Returns:
-
- openpgp_packet_keymaterial object -
+
+
+ Type +
+
+ +openpgp_packet_keymaterial + + +
+
@@ -1180,7 +1216,7 @@ and initializes the openpgp_packet_keymaterial
-

<inner> read_tag6

+

<inner> read_tag6(input, position, len) → {openpgp_packet_keymaterial}

@@ -1192,6 +1228,8 @@ and initializes the openpgp_packet_keymaterial and initializes the openpgp_packet_keymaterial + + @@ -1226,13 +1264,18 @@ and initializes the openpgp_packet_keymaterial + +String + + + - input string to read the packet from + Input string to read the packet from @@ -1244,13 +1287,18 @@ and initializes the openpgp_packet_keymaterial + +Integer + + + - start position for the parser + Start position for the parser @@ -1262,13 +1310,18 @@ and initializes the openpgp_packet_keymaterial + +Integer + + + - length of the packet or remaining length of input + Length of the packet or remaining length of input @@ -1280,34 +1333,42 @@ and initializes the openpgp_packet_keymaterial
- - - - - - - - - - - - - - - -
Source:
-
  • openpgp.js, line 2729
- - - - - + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + +
+ + + + @@ -1315,11 +1376,19 @@ and initializes the openpgp_packet_keymaterial
Returns:
-
- openpgp_packet_keymaterial object -
+
+
+ Type +
+
+ +openpgp_packet_keymaterial + + +
+
@@ -1329,7 +1398,7 @@ and initializes the openpgp_packet_keymaterial
-

<inner> read_tag7

+

<inner> read_tag7(input, position, len) → {openpgp_packet_keymaterial}

@@ -1341,6 +1410,8 @@ and initializes the openpgp_packet_keymaterial and initializes the openpgp_packet_keymaterial + + @@ -1375,13 +1446,18 @@ and initializes the openpgp_packet_keymaterial + +String + + + - input string to read the packet from + Input string to read the packet from @@ -1393,13 +1469,18 @@ and initializes the openpgp_packet_keymaterial + +Integer + + + - start position for the parser + Start position for the parser @@ -1411,13 +1492,18 @@ and initializes the openpgp_packet_keymaterial + +Integer + + + - length of the packet or remaining length of input + Length of the packet or remaining length of input @@ -1429,34 +1515,42 @@ and initializes the openpgp_packet_keymaterial
- - - - - - - - - - - - - - - -
Source:
-
  • openpgp.js, line 2748
- - - - - + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + +
+ + + + @@ -1464,11 +1558,19 @@ and initializes the openpgp_packet_keymaterial
Returns:
-
- openpgp_packet_keymaterial object -
+
+
+ Type +
+
+ +openpgp_packet_keymaterial + + +
+
@@ -1478,7 +1580,189 @@ and initializes the openpgp_packet_keymaterial
-

<inner> toString

+

<inner> read_tag14(input, position, len) → {openpgp_packet_keymaterial}

+ + +
+
+ + +
+ This function reads the payload of a public key sub packet (Tag 14) +and initializes the openpgp_packet_keymaterial +
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
input + + +String + + + + Input string to read the packet from
position + + +Integer + + + + Start position for the parser
len + + +Integer + + + + Length of the packet or remaining length of input
+ + + +
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +openpgp_packet_keymaterial + + +
+
+ + + + +
+ + + +
+

<inner> toString()

@@ -1489,6 +1773,8 @@ and initializes the openpgp_packet_keymaterial Generates Debug output + + @@ -1498,34 +1784,42 @@ and initializes the openpgp_packet_keymaterial
- - - - - - - - - - - - - - - -
Source:
-
  • openpgp.js, line 3138
- - - - - + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + +
+ + + + @@ -1547,7 +1841,7 @@ and initializes the openpgp_packet_keymaterial
-

<inner> verifyKey

+

<inner> verifyKey() → {Integer}

@@ -1558,6 +1852,8 @@ and initializes the openpgp_packet_keymaterial Checks the validity for usage of this (sub)key + + @@ -1567,34 +1863,42 @@ and initializes the openpgp_packet_keymaterial
- - - - - - - - - - - - - - - -
Source:
-
  • openpgp.js, line 3288
- - - - - + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + +
+ + + + @@ -1608,6 +1912,18 @@ and initializes the openpgp_packet_keymaterial +
+
+ Type +
+
+ +Integer + + +
+
+ @@ -1629,15 +1945,15 @@ and initializes the openpgp_packet_keymaterial
- Documentation generated by JSDoc 3 on Tue Sep 11 2012 21:45:27 GMT-0400 (EDT) + Documentation generated by JSDoc 3.2.0-dev on Fri Apr 12 2013 14:20:35 GMT+0200 (CEST)
- + diff --git a/doc/openpgp_packet_literaldata.html b/doc/openpgp_packet_literaldata.html index 2ad78e2f..5478d758 100644 --- a/doc/openpgp_packet_literaldata.html +++ b/doc/openpgp_packet_literaldata.html @@ -4,12 +4,12 @@ JSDoc: Class: openpgp_packet_literaldata - - + + - + @@ -44,13 +44,15 @@ is not to be further interpreted.
-

new openpgp_packet_literaldata

+

new openpgp_packet_literaldata()

+ + @@ -60,34 +62,42 @@ is not to be further interpreted.
- - - - - - - - - - - - - - - -
Source:
-
  • openpgp.js, line 1758
- - - - - + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + +
+ + + + @@ -117,7 +127,7 @@ is not to be further interpreted.
-

<inner> read_packet

+

<inner> read_packet(input, position, len) → {openpgp_packet_encrypteddata}

@@ -125,9 +135,11 @@ is not to be further interpreted.
- parsing function for a literal data packet (tag 11). + Parsing function for a literal data packet (tag 11).
+ + @@ -162,16 +174,18 @@ is not to be further interpreted. - string - - + +String + + + - payload of a tag 11 packet + Payload of a tag 11 packet @@ -183,16 +197,18 @@ is not to be further interpreted. - integer - - + +Integer + + + - position to start reading from the input string + Position to start reading from the input string @@ -204,16 +220,18 @@ is not to be further interpreted. - integer - - + +Integer + + + - length of the packet or the remaining length of + Length of the packet or the remaining length of input at position @@ -226,34 +244,42 @@ is not to be further interpreted.
- - - - - - - - - - - - - - - -
Source:
-
  • openpgp.js, line 1772
- - - - - + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + +
+ + + + @@ -267,15 +293,15 @@ is not to be further interpreted. -
Type
- openpgp_packet_encrypteddata - +openpgp_packet_encrypteddata + +
@@ -287,7 +313,7 @@ is not to be further interpreted.
-

<inner> toString

+

<inner> toString() → {String}

@@ -295,9 +321,11 @@ is not to be further interpreted.
- generates debug output (pretty print) + Generates debug output (pretty print)
+ + @@ -307,34 +335,42 @@ is not to be further interpreted.
- - - - - - - - - - - - - - - -
Source:
-
  • openpgp.js, line 1820
- - - - - + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + +
+ + + + @@ -348,15 +384,15 @@ is not to be further interpreted. -
Type
- string - +String + +
@@ -368,7 +404,7 @@ is not to be further interpreted.
-

<inner> write_packet

+

<inner> write_packet(data) → {String}

@@ -379,6 +415,8 @@ is not to be further interpreted. Creates a string representation of the packet + + @@ -413,16 +451,18 @@ is not to be further interpreted. - String - - + +String + + + - the data to be inserted as body + The data to be inserted as body @@ -434,34 +474,42 @@ is not to be further interpreted.
- - - - - - - - - - - - - - - -
Source:
-
  • openpgp.js, line 1792
- - - - - + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + +
+ + + + @@ -475,15 +523,15 @@ is not to be further interpreted. -
Type
- String - +String + +
@@ -508,15 +556,15 @@ is not to be further interpreted.
- Documentation generated by JSDoc 3 on Tue Sep 11 2012 21:45:27 GMT-0400 (EDT) + Documentation generated by JSDoc 3.2.0-dev on Fri Apr 12 2013 14:20:35 GMT+0200 (CEST)
- + diff --git a/doc/openpgp_packet_marker.html b/doc/openpgp_packet_marker.html index 5e615422..4bd2a4e2 100644 --- a/doc/openpgp_packet_marker.html +++ b/doc/openpgp_packet_marker.html @@ -4,12 +4,12 @@ JSDoc: Class: openpgp_packet_marker - - + + - + @@ -48,13 +48,15 @@ Such a packet MUST be ignored when received.
-

new openpgp_packet_marker

+

new openpgp_packet_marker()

+ + @@ -64,34 +66,42 @@ Such a packet MUST be ignored when received.
- - - - - - - - - - - - - - - -
Source:
-
  • openpgp.js, line 148
- - - - - + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + +
+ + + + @@ -121,7 +131,7 @@ Such a packet MUST be ignored when received.
-

<inner> read_packet

+

<inner> read_packet(input, position, len) → {openpgp_packet_encrypteddata}

@@ -129,9 +139,11 @@ Such a packet MUST be ignored when received.
- parsing function for a literal data packet (tag 10). + Parsing function for a literal data packet (tag 10).
+ + @@ -166,16 +178,18 @@ Such a packet MUST be ignored when received. - string - - + +String + + + - payload of a tag 10 packet + Payload of a tag 10 packet @@ -187,16 +201,18 @@ Such a packet MUST be ignored when received. - integer - - + +Integer + + + - position to start reading from the input string + Position to start reading from the input string @@ -208,16 +224,18 @@ Such a packet MUST be ignored when received. - integer - - + +Integer + + + - length of the packet or the remaining length of + Length of the packet or the remaining length of input at position @@ -230,34 +248,42 @@ Such a packet MUST be ignored when received.
- - - - - - - - - - - - - - - -
Source:
-
  • openpgp.js, line 161
- - - - - + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + +
+ + + + @@ -266,20 +292,20 @@ Such a packet MUST be ignored when received.
- object representation + Object representation
-
Type
- openpgp_packet_encrypteddata - +openpgp_packet_encrypteddata + +
@@ -291,7 +317,7 @@ Such a packet MUST be ignored when received.
-

<inner> toString

+

<inner> toString() → {String}

@@ -302,6 +328,8 @@ Such a packet MUST be ignored when received. Generates Debug output + + @@ -311,34 +339,42 @@ Such a packet MUST be ignored when received.
- - - - - - - - - - - - - - - -
Source:
-
  • openpgp.js, line 176
- - - - - + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + +
+ + + + @@ -347,20 +383,21 @@ Such a packet MUST be ignored when received.
- String which gives some information about the keymaterial + String which gives some information about the +keymaterial
-
Type
- string - +String + +
@@ -385,15 +422,15 @@ Such a packet MUST be ignored when received.
- Documentation generated by JSDoc 3 on Tue Sep 11 2012 21:45:27 GMT-0400 (EDT) + Documentation generated by JSDoc 3.2.0-dev on Fri Apr 12 2013 14:20:35 GMT+0200 (CEST)
- + diff --git a/doc/openpgp_packet_modificationdetectioncode.html b/doc/openpgp_packet_modificationdetectioncode.html index 2f23b379..3eaddaea 100644 --- a/doc/openpgp_packet_modificationdetectioncode.html +++ b/doc/openpgp_packet_modificationdetectioncode.html @@ -4,12 +4,12 @@ JSDoc: Class: openpgp_packet_modificationdetectioncode - - + + - + @@ -48,13 +48,15 @@ Data packet, and MUST appear in no other place.
-

new openpgp_packet_modificationdetectioncode

+

new openpgp_packet_modificationdetectioncode()

+ + @@ -64,34 +66,42 @@ Data packet, and MUST appear in no other place.
- - - - - - - - - - - - - - - -
Source:
-
  • openpgp.js, line 1123
- - - - - + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + +
+ + + + @@ -121,7 +131,7 @@ Data packet, and MUST appear in no other place.
-

<inner> read_packet

+

<inner> read_packet(input, position, len) → {openpgp_packet_encrypteddata}

@@ -132,6 +142,8 @@ Data packet, and MUST appear in no other place. parsing function for a modification detection code packet (tag 19). + + @@ -166,9 +178,11 @@ Data packet, and MUST appear in no other place. - String - - + +String + + + @@ -187,9 +201,11 @@ Data packet, and MUST appear in no other place. - Integer - - + +Integer + + + @@ -208,9 +224,11 @@ Data packet, and MUST appear in no other place. - Integer - - + +Integer + + + @@ -230,34 +248,42 @@ Data packet, and MUST appear in no other place.
- - - - - - - - - - - - - - - -
Source:
-
  • openpgp.js, line 1137
- - - - - + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + +
+ + + + @@ -271,15 +297,15 @@ Data packet, and MUST appear in no other place. -
Type
- openpgp_packet_encrypteddata - +openpgp_packet_encrypteddata + +
@@ -291,7 +317,7 @@ Data packet, and MUST appear in no other place.
-

<inner> toString

+

<inner> toString() → {String}

@@ -302,6 +328,8 @@ Data packet, and MUST appear in no other place. generates debug output (pretty print) + + @@ -311,34 +339,42 @@ Data packet, and MUST appear in no other place.
- - - - - - - - - - - - - - - -
Source:
-
  • openpgp.js, line 1166
- - - - - + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + +
+ + + + @@ -347,21 +383,21 @@ Data packet, and MUST appear in no other place.
- String which gives some information about the modification - detection code + String which gives some information about the +modification detection code
-
Type
- string - +String + +
@@ -386,15 +422,15 @@ Data packet, and MUST appear in no other place.
- Documentation generated by JSDoc 3 on Tue Sep 11 2012 21:45:27 GMT-0400 (EDT) + Documentation generated by JSDoc 3.2.0-dev on Fri Apr 12 2013 14:20:35 GMT+0200 (CEST)
- + diff --git a/doc/openpgp_packet_onepasssignature.html b/doc/openpgp_packet_onepasssignature.html index e962a9c3..e5be7319 100644 --- a/doc/openpgp_packet_onepasssignature.html +++ b/doc/openpgp_packet_onepasssignature.html @@ -4,12 +4,12 @@ JSDoc: Class: openpgp_packet_onepasssignature - - + + - + @@ -48,13 +48,15 @@ can compute the entire signed message in one pass.
-

new openpgp_packet_onepasssignature

+

new openpgp_packet_onepasssignature()

+ + @@ -64,34 +66,42 @@ can compute the entire signed message in one pass.
- - - - - - - - - - - - - - - -
Source:
-
  • openpgp.js, line 29
- - - - - + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + +
+ + + + @@ -121,7 +131,7 @@ can compute the entire signed message in one pass.
-

<inner> read_packet

+

<inner> read_packet(input, position, len) → {openpgp_packet_encrypteddata}

@@ -132,6 +142,8 @@ can compute the entire signed message in one pass. parsing function for a one-pass signature packet (tag 4). + + @@ -166,9 +178,11 @@ can compute the entire signed message in one pass. - string - - + +String + + + @@ -187,9 +201,11 @@ can compute the entire signed message in one pass. - integer - - + +Integer + + + @@ -208,9 +224,11 @@ can compute the entire signed message in one pass. - integer - - + +Integer + + + @@ -229,34 +247,42 @@ can compute the entire signed message in one pass.
- - - - - - - - - - - - - - - -
Source:
-
  • openpgp.js, line 45
- - - - - + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + +
+ + + + @@ -270,15 +296,15 @@ can compute the entire signed message in one pass. -
Type
- openpgp_packet_encrypteddata - +openpgp_packet_encrypteddata + +
@@ -290,7 +316,7 @@ can compute the entire signed message in one pass.
-

<inner> toString

+

<inner> toString() → {String}

@@ -301,6 +327,8 @@ can compute the entire signed message in one pass. generates debug output (pretty print) + + @@ -310,34 +338,42 @@ can compute the entire signed message in one pass.
- - - - - - - - - - - - - - - -
Source:
-
  • openpgp.js, line 105
- - - - - + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + +
+ + + + @@ -351,15 +387,15 @@ can compute the entire signed message in one pass. -
Type
- string - +String + +
@@ -371,7 +407,7 @@ can compute the entire signed message in one pass.
-

<inner> write_packet

+

<inner> write_packet(type, hashalgorithm, privatekey, length, nested) → {String}

@@ -382,6 +418,8 @@ can compute the entire signed message in one pass. creates a string representation of a one-pass signature packet + + @@ -416,9 +454,11 @@ can compute the entire signed message in one pass. - integer - - + +Integer + + + @@ -437,9 +477,11 @@ can compute the entire signed message in one pass. - integer - - + +Integer + + + @@ -458,9 +500,11 @@ can compute the entire signed message in one pass. - openpgp_msg_privatekey - - + +openpgp_msg_privatekey + + + @@ -479,9 +523,11 @@ can compute the entire signed message in one pass. - integer - - + +Integer + + + @@ -500,9 +546,11 @@ can compute the entire signed message in one pass. - boolean - - + +boolean + + + @@ -523,34 +571,42 @@ can compute the entire signed message in one pass.
- - - - - - - - - - - - - - - -
Source:
-
  • openpgp.js, line 84
- - - - - + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + +
+ + + + @@ -564,15 +620,15 @@ can compute the entire signed message in one pass. -
Type
- String - +String + +
@@ -597,15 +653,15 @@ can compute the entire signed message in one pass.
- Documentation generated by JSDoc 3 on Tue Sep 11 2012 21:45:27 GMT-0400 (EDT) + Documentation generated by JSDoc 3.2.0-dev on Fri Apr 12 2013 14:20:35 GMT+0200 (CEST)
- + diff --git a/doc/openpgp_packet_signature.html b/doc/openpgp_packet_signature.html index ead5abf2..61d62fb2 100644 --- a/doc/openpgp_packet_signature.html +++ b/doc/openpgp_packet_signature.html @@ -4,12 +4,12 @@ JSDoc: Class: openpgp_packet_signature - - + + - + @@ -46,13 +46,15 @@ block of text, and a signature that is a certification of a User ID.
-

new openpgp_packet_signature

+

new openpgp_packet_signature()

+ + @@ -62,34 +64,42 @@ block of text, and a signature that is a certification of a User ID.
- - - - - - - - - - - - - - - -
Source:
-
  • openpgp.js, line 210
- - - - - + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + +
+ + + + @@ -119,7 +129,7 @@ block of text, and a signature that is a certification of a User ID.
-

<inner> getIssuer

+

<inner> getIssuer() → {String}

@@ -130,6 +140,8 @@ block of text, and a signature that is a certification of a User ID. gets the issuer key id of this signature + + @@ -139,34 +151,42 @@ block of text, and a signature that is a certification of a User ID.
- - - - - - - - - - - - - - - -
Source:
-
  • openpgp.js, line 910
- - - - - + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + +
+ + + + @@ -180,15 +200,15 @@ block of text, and a signature that is a certification of a User ID. -
Type
- String - +String + +
@@ -200,7 +220,7 @@ block of text, and a signature that is a certification of a User ID.
-

<inner> getIssuerKey

+

<inner> getIssuerKey() → {Object}

@@ -211,6 +231,8 @@ block of text, and a signature that is a certification of a User ID. Tries to get the corresponding public key out of the public keyring for the issuer created this signature + + @@ -220,34 +242,42 @@ block of text, and a signature that is a certification of a User ID.
- - - - - - - - - - - - - - - -
Source:
-
  • openpgp.js, line 922
- - - - - + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + +
+ + + + @@ -256,20 +286,20 @@ block of text, and a signature that is a certification of a User ID.
- if found the public key will be returned. null otherwise + {obj: [openpgp_msg_publickey], text: [String]} if found the public key will be returned. null otherwise
-
Type
- obj: [openpgp_msg_publickey], text: [String] - +Object + +
@@ -281,7 +311,7 @@ block of text, and a signature that is a certification of a User ID.
-

<inner> read_packet

+

<inner> read_packet(input, position, len) → {openpgp_packet_encrypteddata}

@@ -292,6 +322,8 @@ block of text, and a signature that is a certification of a User ID. parsing function for a signature packet (tag 2). + + @@ -326,9 +358,11 @@ block of text, and a signature that is a certification of a User ID. - string - - + +String + + + @@ -347,9 +381,11 @@ block of text, and a signature that is a certification of a User ID. - integer - - + +Integer + + + @@ -368,9 +404,11 @@ block of text, and a signature that is a certification of a User ID. - integer - - + +Integer + + + @@ -389,34 +427,42 @@ block of text, and a signature that is a certification of a User ID.
- - - - - - - - - - - - - - - -
Source:
-
  • openpgp.js, line 260
- - - - - + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + +
+ + + + @@ -430,15 +476,15 @@ block of text, and a signature that is a certification of a User ID. -
Type
- openpgp_packet_encrypteddata - +openpgp_packet_encrypteddata + +
@@ -450,7 +496,7 @@ block of text, and a signature that is a certification of a User ID.
-

<inner> toString

+

<inner> toString() → {String}

@@ -461,6 +507,8 @@ block of text, and a signature that is a certification of a User ID. generates debug output (pretty print) + + @@ -470,34 +518,42 @@ block of text, and a signature that is a certification of a User ID.
- - - - - - - - - - - - - - - -
Source:
-
  • openpgp.js, line 852
- - - - - + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + +
+ + + + @@ -511,15 +567,15 @@ block of text, and a signature that is a certification of a User ID. -
Type
- string - +String + +
@@ -531,7 +587,7 @@ block of text, and a signature that is a certification of a User ID.
-

<inner> verify

+

<inner> verify(data, key) → {boolean}

@@ -542,6 +598,8 @@ block of text, and a signature that is a certification of a User ID. verifys the signature packet. Note: not signature types are implemented + + @@ -576,9 +634,11 @@ block of text, and a signature that is a certification of a User ID. - String - - + +String + + + @@ -597,9 +657,11 @@ block of text, and a signature that is a certification of a User ID. - openpgp_msg_privatekey - - + +openpgp_msg_privatekey + + + @@ -618,34 +680,42 @@ block of text, and a signature that is a certification of a User ID.
- - - - - - - - - - - - - - - -
Source:
-
  • openpgp.js, line 668
- - - - - + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + +
+ + + + @@ -659,15 +729,15 @@ block of text, and a signature that is a certification of a User ID. -
Type
- boolean - +boolean + +
@@ -679,7 +749,7 @@ block of text, and a signature that is a certification of a User ID.
-

<inner> write_message_signature

+

<inner> write_message_signature(signature_type, data, privatekey) → {String}

@@ -691,6 +761,8 @@ block of text, and a signature that is a certification of a User ID. This can be only used on text data + + @@ -725,9 +797,11 @@ This can be only used on text data - integer - - + +Integer + + + @@ -746,9 +820,11 @@ This can be only used on text data - String - - + +String + + + @@ -767,9 +843,11 @@ This can be only used on text data - openpgp_msg_privatekey - - + +openpgp_msg_privatekey + + + @@ -788,34 +866,42 @@ This can be only used on text data
- - - - - - - - - - - - - - - -
Source:
-
  • openpgp.js, line 400
- - - - - + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + +
+ + + + @@ -829,15 +915,15 @@ This can be only used on text data -
Type
- string - +String + +
@@ -849,7 +935,7 @@ This can be only used on text data
-

<inner> write_sub_signature_packet

+

<inner> write_sub_signature_packet(type, data) → {String}

@@ -860,6 +946,8 @@ This can be only used on text data creates a string representation of a sub signature packet (See RFC 4880 5.2.3.1) + + @@ -894,9 +982,11 @@ This can be only used on text data - integer - - + +Integer + + + @@ -915,9 +1005,11 @@ This can be only used on text data - String - - + +String + + + @@ -936,34 +1028,42 @@ This can be only used on text data
- - - - - - - - - - - - - - - -
Source:
-
  • openpgp.js, line 445
- - - - - + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + +
+ + + + @@ -977,15 +1077,15 @@ This can be only used on text data -
Type
- String - +String + +
@@ -1010,15 +1110,15 @@ This can be only used on text data
- Documentation generated by JSDoc 3 on Tue Sep 11 2012 21:45:27 GMT-0400 (EDT) + Documentation generated by JSDoc 3.2.0-dev on Fri Apr 12 2013 14:20:36 GMT+0200 (CEST)
- + diff --git a/doc/openpgp_packet_userattribute.html b/doc/openpgp_packet_userattribute.html index 49e583de..50b06340 100644 --- a/doc/openpgp_packet_userattribute.html +++ b/doc/openpgp_packet_userattribute.html @@ -4,12 +4,12 @@ JSDoc: Class: openpgp_packet_userattribute - - + + - + @@ -54,13 +54,15 @@
-

new openpgp_packet_userattribute

+

new openpgp_packet_userattribute()

+ + @@ -70,34 +72,42 @@
- - - - - - - - - - - - - - - -
Source:
-
  • openpgp.js, line 1965
- - - - - + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + +
+ + + + @@ -127,7 +137,7 @@
-

<inner> read_nodes

+

<inner> read_nodes(parent_node, input, position, len) → {Integer}

@@ -138,6 +148,8 @@ Continue parsing packets belonging to the user attribute packet such as signatures + + @@ -172,9 +184,11 @@ - openpgp_* - - + +Object + + + @@ -193,9 +207,11 @@ - String - - + +String + + + @@ -214,9 +230,11 @@ - integer - - + +Integer + + + @@ -235,9 +253,11 @@ - integer - - + +Integer + + + @@ -256,34 +276,42 @@
- - - - - - - - - - - - - - - -
Source:
-
  • openpgp.js, line 2041
- - - - - + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + +
+ + + + @@ -297,15 +325,15 @@ -
Type
- integer - +Integer + +
@@ -317,7 +345,7 @@
-

<inner> read_packet

+

<inner> read_packet(input, position, len) → {openpgp_packet_encrypteddata}

@@ -328,6 +356,8 @@ parsing function for a user attribute packet (tag 17). + + @@ -362,9 +392,11 @@ - string - - + +String + + + @@ -383,9 +415,11 @@ - integer - - + +Integer + + + @@ -404,9 +438,11 @@ - integer - - + +Integer + + + @@ -425,34 +461,42 @@
- - - - - - - - - - - - - - - -
Source:
-
  • openpgp.js, line 1979
- - - - - + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + +
+ + + + @@ -466,15 +510,15 @@ -
Type
- openpgp_packet_encrypteddata - +openpgp_packet_encrypteddata + +
@@ -486,7 +530,7 @@
-

<inner> toString

+

<inner> toString() → {String}

@@ -497,6 +541,8 @@ generates debug output (pretty print) + + @@ -506,34 +552,42 @@
- - - - - - - - - - - - - - - -
Source:
-
  • openpgp.js, line 2024
- - - - - + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + +
+ + + + @@ -547,15 +601,15 @@ -
Type
- string - +String + +
@@ -580,15 +634,15 @@
- Documentation generated by JSDoc 3 on Tue Sep 11 2012 21:45:27 GMT-0400 (EDT) + Documentation generated by JSDoc 3.2.0-dev on Fri Apr 12 2013 14:20:36 GMT+0200 (CEST)
- + diff --git a/doc/openpgp_packet_userid.html b/doc/openpgp_packet_userid.html index 74057b4b..cfdc374d 100644 --- a/doc/openpgp_packet_userid.html +++ b/doc/openpgp_packet_userid.html @@ -4,12 +4,12 @@ JSDoc: Class: openpgp_packet_userid - - + + - + @@ -46,13 +46,15 @@ specifies the length of the User ID.
-

new openpgp_packet_userid

+

new openpgp_packet_userid()

+ + @@ -62,34 +64,42 @@ specifies the length of the User ID.
- - - - - - - - - - - - - - - -
Source:
-
  • openpgp.js, line 1200
- - - - - + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + +
+ + + + @@ -119,7 +129,7 @@ specifies the length of the User ID.
-

<inner> hasCertificationRevocationSignature

+

<inner> hasCertificationRevocationSignature(keyId)

@@ -130,6 +140,8 @@ specifies the length of the User ID. lookup function to find certification revocation signatures + + @@ -164,9 +176,11 @@ specifies the length of the User ID. - string - - + +String + + + @@ -185,34 +199,42 @@ specifies the length of the User ID.
- - - - - - - - - - - - - - - -
Source:
-
  • openpgp.js, line 1344
- - - - - + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + +
+ + + + @@ -234,7 +256,7 @@ specifies the length of the User ID.
-

<inner> read_nodes

+

<inner> read_nodes(parent_node, input, position, len) → {Integer}

@@ -245,6 +267,8 @@ specifies the length of the User ID. Continue parsing packets belonging to the userid packet such as signatures + + @@ -279,9 +303,11 @@ specifies the length of the User ID. - openpgp_* - - + +Object + + + @@ -300,9 +326,11 @@ specifies the length of the User ID. - String - - + +String + + + @@ -321,9 +349,11 @@ specifies the length of the User ID. - integer - - + +Integer + + + @@ -342,9 +372,11 @@ specifies the length of the User ID. - integer - - + +Integer + + + @@ -363,34 +395,42 @@ specifies the length of the User ID.
- - - - - - - - - - - - - - - -
Source:
-
  • openpgp.js, line 1244
- - - - - + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + +
+ + + + @@ -404,15 +444,15 @@ specifies the length of the User ID. -
Type
- integer - +Integer + +
@@ -424,7 +464,7 @@ specifies the length of the User ID.
-

<inner> read_packet

+

<inner> read_packet(input, position, len) → {openpgp_packet_encrypteddata}

@@ -435,6 +475,8 @@ specifies the length of the User ID. parsing function for a user id packet (tag 13). + + @@ -469,9 +511,11 @@ specifies the length of the User ID. - string - - + +String + + + @@ -490,9 +534,11 @@ specifies the length of the User ID. - integer - - + +Integer + + + @@ -511,9 +557,11 @@ specifies the length of the User ID. - integer - - + +Integer + + + @@ -532,34 +580,42 @@ specifies the length of the User ID.
- - - - - - - - - - - - - - - -
Source:
-
  • openpgp.js, line 1214
- - - - - + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + +
+ + + + @@ -573,15 +629,15 @@ specifies the length of the User ID. -
Type
- openpgp_packet_encrypteddata - +openpgp_packet_encrypteddata + +
@@ -593,7 +649,7 @@ specifies the length of the User ID.
-

<inner> toString

+

<inner> toString() → {String}

@@ -604,6 +660,8 @@ specifies the length of the User ID. generates debug output (pretty print) + + @@ -613,34 +671,42 @@ specifies the length of the User ID.
- - - - - - - - - - - - - - - -
Source:
-
  • openpgp.js, line 1324
- - - - - + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + +
+ + + + @@ -654,15 +720,15 @@ specifies the length of the User ID. -
Type
- string - +String + +
@@ -674,7 +740,7 @@ specifies the length of the User ID.
-

<inner> verify

+

<inner> verify()

@@ -685,6 +751,8 @@ specifies the length of the User ID. verifies the signatures of the user id + + @@ -694,34 +762,42 @@ specifies the length of the User ID.
- - - - - - - - - - - - - - - -
Source:
-
  • openpgp.js, line 1482
- - - - - + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + +
+ + + + @@ -743,7 +819,7 @@ specifies the length of the User ID.
-

<inner> verifyCertificationSignatures

+

<inner> verifyCertificationSignatures(publicKeyPacket) → {Integer[]}

@@ -754,6 +830,8 @@ specifies the length of the User ID. Verifies all certification signatures. This method does not consider possible revocation signatures. + + @@ -788,6 +866,11 @@ specifies the length of the User ID. + +Object + + + @@ -806,34 +889,42 @@ specifies the length of the User ID.
- - - - - - - - - - - - - - - -
Source:
-
  • openpgp.js, line 1367
- - - - - + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + +
+ + + + @@ -842,7 +933,7 @@ specifies the length of the User ID.
- an array of integers corresponding to the array of certification signatures. The meaning of each integer is the following: + An array of integers corresponding to the array of certification signatures. The meaning of each integer is the following: 0 = bad signature 1 = signature expired 2 = issuer key not available @@ -854,6 +945,18 @@ specifies the length of the User ID.
+
+
+ Type +
+
+ +Integer[] + + +
+
+ @@ -862,7 +965,7 @@ specifies the length of the User ID.
-

<inner> write_packet

+

<inner> write_packet(user_id) → {String}

@@ -873,6 +976,8 @@ specifies the length of the User ID. creates a string representation of the user id packet + + @@ -907,9 +1012,11 @@ specifies the length of the User ID. - String - - + +String + + + @@ -928,34 +1035,42 @@ specifies the length of the User ID.
- - - - - - - - - - - - - - - -
Source:
-
  • openpgp.js, line 1229
- - - - - + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + +
+ + + + @@ -969,15 +1084,15 @@ specifies the length of the User ID. -
Type
- String - +String + +
@@ -1002,15 +1117,15 @@ specifies the length of the User ID.
- Documentation generated by JSDoc 3 on Tue Sep 11 2012 21:45:27 GMT-0400 (EDT) + Documentation generated by JSDoc 3.2.0-dev on Fri Apr 12 2013 14:20:36 GMT+0200 (CEST)
- + diff --git a/doc/openpgp_type_keyid.html b/doc/openpgp_type_keyid.html index 5c3f5061..f2edcc5e 100644 --- a/doc/openpgp_type_keyid.html +++ b/doc/openpgp_type_keyid.html @@ -4,12 +4,12 @@ JSDoc: Class: openpgp_type_keyid - - + + - + @@ -45,13 +45,15 @@
-

new openpgp_type_keyid

+

new openpgp_type_keyid()

+ + @@ -61,34 +63,42 @@
- - - - - - - - - - - - - - - -
Source:
-
  • openpgp.js, line 12495
- - - - - + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + +
+ + + + @@ -118,7 +128,7 @@
-

<inner> read_packet

+

<inner> read_packet(input, position) → {openpgp_type_keyid}

@@ -126,9 +136,11 @@
- parsing method for a key id + Parsing method for a key id
+ + @@ -163,16 +175,18 @@ - String - - + +String + + + - input to read the key id from + Input to read the key id from @@ -184,16 +198,19 @@ - integer - - + +integer + + + - position where to start reading the key id from input + Position where to start reading the key +id from input @@ -205,34 +222,42 @@
- - - - - - - - - - - - - - - -
Source:
-
  • openpgp.js, line 12502
- - - - - + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + +
+ + + + @@ -241,11 +266,23 @@
- this object + This object
+
+
+ Type +
+
+ +openpgp_type_keyid + + +
+
+ @@ -254,7 +291,7 @@
-

<inner> toString

+

<inner> toString() → {String}

@@ -262,9 +299,11 @@
- generates debug output (pretty print) + Generates debug output (pretty print)
+ + @@ -274,34 +313,42 @@
- - - - - - - - - - - - - - - -
Source:
-
  • openpgp.js, line 12511
- - - - - + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + +
+ + + + @@ -315,15 +362,15 @@ -
Type
- String - +String + +
@@ -348,15 +395,15 @@
- Documentation generated by JSDoc 3 on Tue Sep 11 2012 21:45:27 GMT-0400 (EDT) + Documentation generated by JSDoc 3.2.0-dev on Fri Apr 12 2013 14:20:36 GMT+0200 (CEST)
- + diff --git a/doc/openpgp_type_mpi.html b/doc/openpgp_type_mpi.html index 8fe53dbe..72a53519 100644 --- a/doc/openpgp_type_mpi.html +++ b/doc/openpgp_type_mpi.html @@ -4,12 +4,12 @@ JSDoc: Class: openpgp_type_mpi - - + + - + @@ -39,13 +39,15 @@
-

new openpgp_type_mpi

+

new openpgp_type_mpi()

+ + @@ -55,34 +57,42 @@
- - - - - - - - - - - - - - - -
Source:
-
  • openpgp.js, line 12369
- - - - - + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + +
+ + + + @@ -112,7 +122,7 @@
-

<inner> create

+

<inner> create(data) → {openpgp_type_mpi}

@@ -120,9 +130,11 @@
- creates an mpi from the specified string + Creates an mpi from the specified string
+ + @@ -157,16 +169,18 @@ - String - - + +String + + + - data to read the mpi from + Data to read the mpi from @@ -178,34 +192,42 @@
- - - - - - - - - - - - - - - -
Source:
-
  • openpgp.js, line 12444
- - - - - + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + +
+ + + + @@ -215,15 +237,15 @@ -
Type
- openpgp_type_mpi - +openpgp_type_mpi + +
@@ -235,7 +257,7 @@
-

<inner> getBigInteger

+

<inner> getBigInteger() → {BigInteger}

@@ -243,9 +265,11 @@
- converts the mpi to an BigInteger object + Converts the mpi to an BigInteger object
+ + @@ -255,34 +279,42 @@
- - - - - - - - - - - - - - - -
Source:
-
  • openpgp.js, line 12420
- - - - - + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + +
+ + + + @@ -292,15 +324,15 @@ -
Type
- BigInteger - +BigInteger + +
@@ -312,7 +344,7 @@
-

<inner> getByteLength

+

<inner> getByteLength() → {Integer}

@@ -320,9 +352,11 @@
- gets the length of the mpi in bytes + Gets the length of the mpi in bytes
+ + @@ -332,34 +366,42 @@
- - - - - - - - - - - - - - - -
Source:
-
  • openpgp.js, line 12435
- - - - - + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + +
+ + + + @@ -368,20 +410,20 @@
- mpi byte length + Mpi byte length
-
Type
- integer - +Integer + +
@@ -393,7 +435,7 @@
-

<inner> read

+

<inner> read(input, position, len) → {openpgp_type_mpi}

@@ -401,9 +443,11 @@
- parsing function for a mpi (RFC 4880 3.2). + Parsing function for a mpi (RFC 4880 3.2).
+ + @@ -438,16 +482,18 @@ - string - - + +String + + + - payload of mpi data + Payload of mpi data @@ -459,16 +505,19 @@ - integer - - + +Integer + + + - position to start reading from the input string + Position to start reading from the input +string @@ -480,16 +529,19 @@ - integer - - + +Integer + + + - length of the packet or the remaining length of input at position + Length of the packet or the remaining length of +input at position @@ -501,34 +553,42 @@
- - - - - - - - - - - - - - - -
Source:
-
  • openpgp.js, line 12381
- - - - - + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + +
+ + + + @@ -537,20 +597,20 @@
- object representation + Object representation
-
Type
- openpgp_type_mpi - +openpgp_type_mpi + +
@@ -562,7 +622,7 @@
-

<inner> toBin

+

<inner> toBin() → {String}

@@ -570,9 +630,11 @@
- converts the mpi object to a string as specified in RFC4880 3.2 + Converts the mpi object to a string as specified in RFC4880 3.2
+ + @@ -582,34 +644,42 @@
- - - - - - - - - - - - - - - -
Source:
-
  • openpgp.js, line 12455
- - - - - + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + +
+ + + + @@ -618,20 +688,20 @@
- mpi byte representation + mpi Byte representation
-
Type
- String - +String + +
@@ -643,7 +713,7 @@
-

<inner> toString

+

<inner> toString() → {String}

@@ -651,9 +721,11 @@
- generates debug output (pretty print) + Generates debug output (pretty print)
+ + @@ -663,34 +735,42 @@
- - - - - - - - - - - - - - - -
Source:
-
  • openpgp.js, line 12410
- - - - - + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + +
+ + + + @@ -704,15 +784,15 @@ -
Type
- string - +String + +
@@ -737,15 +817,15 @@
- Documentation generated by JSDoc 3 on Tue Sep 11 2012 21:45:27 GMT-0400 (EDT) + Documentation generated by JSDoc 3.2.0-dev on Fri Apr 12 2013 14:20:36 GMT+0200 (CEST)
- + diff --git a/doc/openpgp_type_s2k.html b/doc/openpgp_type_s2k.html index 51ff8b47..a353ec02 100644 --- a/doc/openpgp_type_s2k.html +++ b/doc/openpgp_type_s2k.html @@ -4,12 +4,12 @@ JSDoc: Class: openpgp_type_s2k - - + + - + @@ -46,13 +46,15 @@ String-to-key (S2K) specifiers are used to convert passphrase strings
-

new openpgp_type_s2k

+

new openpgp_type_s2k()

+ + @@ -62,34 +64,42 @@ String-to-key (S2K) specifiers are used to convert passphrase strings
- - - - - - - - - - - - - - - -
Source:
-
  • openpgp.js, line 12544
- - - - - + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + +
+ + + + @@ -119,7 +129,7 @@ String-to-key (S2K) specifiers are used to convert passphrase strings
-

<inner> produce_key

+

<inner> produce_key(passphrase) → {String}

@@ -127,9 +137,12 @@ String-to-key (S2K) specifiers are used to convert passphrase strings
- produces a key using the specified passphrase and the defined hashAlgorithm + Produces a key using the specified passphrase and the defined +hashAlgorithm
+ + @@ -164,13 +177,18 @@ String-to-key (S2K) specifiers are used to convert passphrase strings + +String + + + - {String} passphrase containing user input + Passphrase containing user input @@ -182,34 +200,42 @@ String-to-key (S2K) specifiers are used to convert passphrase strings
- - - - - - - - - - - - - - - -
Source:
-
  • openpgp.js, line 12614
- - - - - + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + +
+ + + + @@ -218,20 +244,21 @@ String-to-key (S2K) specifiers are used to convert passphrase strings
- produced key with a length corresponding to hashAlgorithm hash length + Produced key with a length corresponding to +hashAlgorithm hash length
-
Type
- String - +String + +
@@ -243,7 +270,7 @@ String-to-key (S2K) specifiers are used to convert passphrase strings
-

<inner> read

+

<inner> read(input, position) → {openpgp_type_s2k}

@@ -251,9 +278,11 @@ String-to-key (S2K) specifiers are used to convert passphrase strings
- parsing function for a string-to-key specifier (RFC 4880 3.7). + Parsing function for a string-to-key specifier (RFC 4880 3.7).
+ + @@ -288,16 +317,18 @@ String-to-key (S2K) specifiers are used to convert passphrase strings - string - - + +String + + + - payload of string-to-key specifier + Payload of string-to-key specifier @@ -309,16 +340,18 @@ String-to-key (S2K) specifiers are used to convert passphrase strings - integer - - + +Integer + + + - position to start reading from the input string + Position to start reading from the input string @@ -330,34 +363,42 @@ String-to-key (S2K) specifiers are used to convert passphrase strings
- - - - - - - - - - - - - - - -
Source:
-
  • openpgp.js, line 12551
- - - - - + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + +
+ + + + @@ -366,20 +407,20 @@ String-to-key (S2K) specifiers are used to convert passphrase strings
- object representation + Object representation
-
Type
- openpgp_type_s2k - +openpgp_type_s2k + +
@@ -391,7 +432,7 @@ String-to-key (S2K) specifiers are used to convert passphrase strings
-

<inner> write

+

<inner> write() → {String}

@@ -402,6 +443,8 @@ String-to-key (S2K) specifiers are used to convert passphrase strings writes an s2k hash based on the inputs. + + @@ -411,34 +454,42 @@ String-to-key (S2K) specifiers are used to convert passphrase strings
- - - - - - - - - - - - - - - -
Source:
-
  • openpgp.js, line 12599
- - - - - + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + +
+ + + + @@ -447,20 +498,20 @@ String-to-key (S2K) specifiers are used to convert passphrase strings
- produced key of hashAlgorithm hash length + Produced key of hashAlgorithm hash length
-
Type
- String - +String + +
@@ -485,15 +536,15 @@ String-to-key (S2K) specifiers are used to convert passphrase strings
- Documentation generated by JSDoc 3 on Tue Sep 11 2012 21:45:27 GMT-0400 (EDT) + Documentation generated by JSDoc 3.2.0-dev on Fri Apr 12 2013 14:20:36 GMT+0200 (CEST)
- + diff --git a/doc/styles/node-dark.css b/doc/styles/node-dark.css deleted file mode 100644 index 5849e234..00000000 --- a/doc/styles/node-dark.css +++ /dev/null @@ -1,150 +0,0 @@ - .sh_sourceCode { - background-color: #ffffff; - color: #000000; - font-weight: normal; - font-style: normal; -} - - .sh_sourceCode .sh_keyword { - color: #000000; - font-weight: bold; - font-style: normal; -} - - .sh_sourceCode .sh_type { - color: #a52a2a; - font-weight: bold; - font-style: normal; -} - - .sh_sourceCode .sh_string { - color: #006400; - font-weight: normal; - font-style: normal; -} - - .sh_sourceCode .sh_regexp { - color: #006400; - font-weight: normal; - font-style: normal; -} - - .sh_sourceCode .sh_specialchar { - color: #2e8b57; - font-weight: normal; - font-style: normal; -} - - .sh_sourceCode .sh_comment { - color: #000000; - font-weight: normal; - font-style: italic; -} - - .sh_sourceCode .sh_number { - color: #006400; - font-weight: normal; - font-style: normal; -} - - .sh_sourceCode .sh_preproc { - color: #27408b; - font-weight: normal; - font-style: normal; -} - - .sh_sourceCode .sh_symbol { - color: #000000; - font-weight: bold; - font-style: normal; -} - - .sh_sourceCode .sh_function { - color: #000000; - font-weight: normal; - font-style: normal; -} - - .sh_sourceCode .sh_cbracket { - color: #000000; - font-weight: bold; - font-style: normal; -} - - .sh_sourceCode .sh_url { - color: #006400; - font-weight: normal; - font-style: normal; -} - - .sh_sourceCode .sh_date { - color: #000000; - font-weight: bold; - font-style: normal; -} - - .sh_sourceCode .sh_time { - color: #000000; - font-weight: bold; - font-style: normal; -} - - .sh_sourceCode .sh_file { - color: #000000; - font-weight: bold; - font-style: normal; -} - - .sh_sourceCode .sh_ip { - color: #006400; - font-weight: normal; - font-style: normal; -} - - .sh_sourceCode .sh_name { - color: #006400; - font-weight: normal; - font-style: normal; -} - - .sh_sourceCode .sh_variable { - color: #dda0dd; - font-weight: bold; - font-style: normal; -} - - .sh_sourceCode .sh_oldfile { - color: #2e8b57; - font-weight: normal; - font-style: normal; -} - - .sh_sourceCode .sh_newfile { - color: #006400; - font-weight: normal; - font-style: normal; -} - - .sh_sourceCode .sh_difflines { - color: #000000; - font-weight: bold; - font-style: normal; -} - - .sh_sourceCode .sh_selector { - color: #dda0dd; - font-weight: bold; - font-style: normal; -} - - .sh_sourceCode .sh_property { - color: #000000; - font-weight: bold; - font-style: normal; -} - - .sh_sourceCode .sh_value { - color: #006400; - font-weight: normal; - font-style: normal; -} diff --git a/resources/openpgp.js b/resources/openpgp.js index d2b1647a..941635f3 100644 --- a/resources/openpgp.js +++ b/resources/openpgp.js @@ -197,595 +197,6 @@ function Elgamal() { this.encrypt = encrypt; this.decrypt = decrypt; }/* - * Copyright (c) 2003-2005 Tom Wu (tjw@cs.Stanford.EDU) - * All Rights Reserved. - * - * Modified by Recurity Labs GmbH - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, - * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * - * IN NO EVENT SHALL TOM WU BE LIABLE FOR ANY SPECIAL, INCIDENTAL, - * INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY DAMAGES WHATSOEVER - * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER OR NOT ADVISED OF - * THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF LIABILITY, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - * - * In addition, the following condition applies: - * - * All redistributions must retain an intact copy of this copyright notice - * and disclaimer. - */ - -// Basic JavaScript BN library - subset useful for RSA encryption. - -// Bits per digit -var dbits; - -// JavaScript engine analysis -var canary = 0xdeadbeefcafe; -var j_lm = ((canary&0xffffff)==0xefcafe); - -// (public) Constructor -function BigInteger(a,b,c) { - if(a != null) - if("number" == typeof a) this.fromNumber(a,b,c); - else if(b == null && "string" != typeof a) this.fromString(a,256); - else this.fromString(a,b); -} - -// return new, unset BigInteger -function nbi() { return new BigInteger(null); } - -// am: Compute w_j += (x*this_i), propagate carries, -// c is initial carry, returns final carry. -// c < 3*dvalue, x < 2*dvalue, this_i < dvalue -// We need to select the fastest one that works in this environment. - -// am1: use a single mult and divide to get the high bits, -// max digit bits should be 26 because -// max internal value = 2*dvalue^2-2*dvalue (< 2^53) -function am1(i,x,w,j,c,n) { - while(--n >= 0) { - var v = x*this[i++]+w[j]+c; - c = Math.floor(v/0x4000000); - w[j++] = v&0x3ffffff; - } - return c; -} -// am2 avoids a big mult-and-extract completely. -// Max digit bits should be <= 30 because we do bitwise ops -// on values up to 2*hdvalue^2-hdvalue-1 (< 2^31) -function am2(i,x,w,j,c,n) { - var xl = x&0x7fff, xh = x>>15; - while(--n >= 0) { - var l = this[i]&0x7fff; - var h = this[i++]>>15; - var m = xh*l+h*xl; - l = xl*l+((m&0x7fff)<<15)+w[j]+(c&0x3fffffff); - c = (l>>>30)+(m>>>15)+xh*h+(c>>>30); - w[j++] = l&0x3fffffff; - } - return c; -} -// Alternately, set max digit bits to 28 since some -// browsers slow down when dealing with 32-bit numbers. -function am3(i,x,w,j,c,n) { - var xl = x&0x3fff, xh = x>>14; - while(--n >= 0) { - var l = this[i]&0x3fff; - var h = this[i++]>>14; - var m = xh*l+h*xl; - l = xl*l+((m&0x3fff)<<14)+w[j]+c; - c = (l>>28)+(m>>14)+xh*h; - w[j++] = l&0xfffffff; - } - return c; -} -if(j_lm && (navigator.appName == "Microsoft Internet Explorer")) { - BigInteger.prototype.am = am2; - dbits = 30; -} -else if(j_lm && (navigator.appName != "Netscape")) { - BigInteger.prototype.am = am1; - dbits = 26; -} -else { // Mozilla/Netscape seems to prefer am3 - BigInteger.prototype.am = am3; - dbits = 28; -} - -BigInteger.prototype.DB = dbits; -BigInteger.prototype.DM = ((1<= 0; --i) r[i] = this[i]; - r.t = this.t; - r.s = this.s; -} - -// (protected) set from integer value x, -DV <= x < DV -function bnpFromInt(x) { - this.t = 1; - this.s = (x<0)?-1:0; - if(x > 0) this[0] = x; - else if(x < -1) this[0] = x+DV; - else this.t = 0; -} - -// return bigint initialized to value -function nbv(i) { var r = nbi(); r.fromInt(i); return r; } - -// (protected) set from string and radix -function bnpFromString(s,b) { - var k; - if(b == 16) k = 4; - else if(b == 8) k = 3; - else if(b == 256) k = 8; // byte array - else if(b == 2) k = 1; - else if(b == 32) k = 5; - else if(b == 4) k = 2; - else { this.fromRadix(s,b); return; } - this.t = 0; - this.s = 0; - var i = s.length, mi = false, sh = 0; - while(--i >= 0) { - var x = (k==8)?s[i]&0xff:intAt(s,i); - if(x < 0) { - if(s.charAt(i) == "-") mi = true; - continue; - } - mi = false; - if(sh == 0) - this[this.t++] = x; - else if(sh+k > this.DB) { - this[this.t-1] |= (x&((1<<(this.DB-sh))-1))<>(this.DB-sh)); - } - else - this[this.t-1] |= x<= this.DB) sh -= this.DB; - } - if(k == 8 && (s[0]&0x80) != 0) { - this.s = -1; - if(sh > 0) this[this.t-1] |= ((1<<(this.DB-sh))-1)< 0 && this[this.t-1] == c) --this.t; -} - -// (public) return string representation in given radix -function bnToString(b) { - if(this.s < 0) return "-"+this.negate().toString(b); - var k; - if(b == 16) k = 4; - else if(b == 8) k = 3; - else if(b == 2) k = 1; - else if(b == 32) k = 5; - else if(b == 4) k = 2; - else return this.toRadix(b); - var km = (1< 0) { - if(p < this.DB && (d = this[i]>>p) > 0) { m = true; r = int2char(d); } - while(i >= 0) { - if(p < k) { - d = (this[i]&((1<>(p+=this.DB-k); - } - else { - d = (this[i]>>(p-=k))&km; - if(p <= 0) { p += this.DB; --i; } - } - if(d > 0) m = true; - if(m) r += int2char(d); - } - } - return m?r:"0"; -} - -// (public) -this -function bnNegate() { var r = nbi(); BigInteger.ZERO.subTo(this,r); return r; } - -// (public) |this| -function bnAbs() { return (this.s<0)?this.negate():this; } - -// (public) return + if this > a, - if this < a, 0 if equal -function bnCompareTo(a) { - var r = this.s-a.s; - if(r != 0) return r; - var i = this.t; - r = i-a.t; - if(r != 0) return r; - while(--i >= 0) if((r=this[i]-a[i]) != 0) return r; - return 0; -} - -// returns bit length of the integer x -function nbits(x) { - var r = 1, t; - if((t=x>>>16) != 0) { x = t; r += 16; } - if((t=x>>8) != 0) { x = t; r += 8; } - if((t=x>>4) != 0) { x = t; r += 4; } - if((t=x>>2) != 0) { x = t; r += 2; } - if((t=x>>1) != 0) { x = t; r += 1; } - return r; -} - -// (public) return the number of bits in "this" -function bnBitLength() { - if(this.t <= 0) return 0; - return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM)); -} - -// (protected) r = this << n*DB -function bnpDLShiftTo(n,r) { - var i; - for(i = this.t-1; i >= 0; --i) r[i+n] = this[i]; - for(i = n-1; i >= 0; --i) r[i] = 0; - r.t = this.t+n; - r.s = this.s; -} - -// (protected) r = this >> n*DB -function bnpDRShiftTo(n,r) { - for(var i = n; i < this.t; ++i) r[i-n] = this[i]; - r.t = Math.max(this.t-n,0); - r.s = this.s; -} - -// (protected) r = this << n -function bnpLShiftTo(n,r) { - var bs = n%this.DB; - var cbs = this.DB-bs; - var bm = (1<= 0; --i) { - r[i+ds+1] = (this[i]>>cbs)|c; - c = (this[i]&bm)<= 0; --i) r[i] = 0; - r[ds] = c; - r.t = this.t+ds+1; - r.s = this.s; - r.clamp(); -} - -// (protected) r = this >> n -function bnpRShiftTo(n,r) { - r.s = this.s; - var ds = Math.floor(n/this.DB); - if(ds >= this.t) { r.t = 0; return; } - var bs = n%this.DB; - var cbs = this.DB-bs; - var bm = (1<>bs; - for(var i = ds+1; i < this.t; ++i) { - r[i-ds-1] |= (this[i]&bm)<>bs; - } - if(bs > 0) r[this.t-ds-1] |= (this.s&bm)<>= this.DB; - } - if(a.t < this.t) { - c -= a.s; - while(i < this.t) { - c += this[i]; - r[i++] = c&this.DM; - c >>= this.DB; - } - c += this.s; - } - else { - c += this.s; - while(i < a.t) { - c -= a[i]; - r[i++] = c&this.DM; - c >>= this.DB; - } - c -= a.s; - } - r.s = (c<0)?-1:0; - if(c < -1) r[i++] = this.DV+c; - else if(c > 0) r[i++] = c; - r.t = i; - r.clamp(); -} - -// (protected) r = this * a, r != this,a (HAC 14.12) -// "this" should be the larger one if appropriate. -function bnpMultiplyTo(a,r) { - var x = this.abs(), y = a.abs(); - var i = x.t; - r.t = i+y.t; - while(--i >= 0) r[i] = 0; - for(i = 0; i < y.t; ++i) r[i+x.t] = x.am(0,y[i],r,i,0,x.t); - r.s = 0; - r.clamp(); - if(this.s != a.s) BigInteger.ZERO.subTo(r,r); -} - -// (protected) r = this^2, r != this (HAC 14.16) -function bnpSquareTo(r) { - var x = this.abs(); - var i = r.t = 2*x.t; - while(--i >= 0) r[i] = 0; - for(i = 0; i < x.t-1; ++i) { - var c = x.am(i,x[i],r,2*i,0,1); - if((r[i+x.t]+=x.am(i+1,2*x[i],r,2*i+1,c,x.t-i-1)) >= x.DV) { - r[i+x.t] -= x.DV; - r[i+x.t+1] = 1; - } - } - if(r.t > 0) r[r.t-1] += x.am(i,x[i],r,2*i,0,1); - r.s = 0; - r.clamp(); -} - -// (protected) divide this by m, quotient and remainder to q, r (HAC 14.20) -// r != q, this != m. q or r may be null. -function bnpDivRemTo(m,q,r) { - var pm = m.abs(); - if(pm.t <= 0) return; - var pt = this.abs(); - if(pt.t < pm.t) { - if(q != null) q.fromInt(0); - if(r != null) this.copyTo(r); - return; - } - if(r == null) r = nbi(); - var y = nbi(), ts = this.s, ms = m.s; - var nsh = this.DB-nbits(pm[pm.t-1]); // normalize modulus - if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); } - else { pm.copyTo(y); pt.copyTo(r); } - var ys = y.t; - var y0 = y[ys-1]; - if(y0 == 0) return; - var yt = y0*(1<1)?y[ys-2]>>this.F2:0); - var d1 = this.FV/yt, d2 = (1<= 0) { - r[r.t++] = 1; - r.subTo(t,r); - } - BigInteger.ONE.dlShiftTo(ys,t); - t.subTo(y,y); // "negative" y so we can replace sub with am later - while(y.t < ys) y[y.t++] = 0; - while(--j >= 0) { - // Estimate quotient digit - var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2); - if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out - y.dlShiftTo(j,t); - r.subTo(t,r); - while(r[i] < --qd) r.subTo(t,r); - } - } - if(q != null) { - r.drShiftTo(ys,q); - if(ts != ms) BigInteger.ZERO.subTo(q,q); - } - r.t = ys; - r.clamp(); - if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder - if(ts < 0) BigInteger.ZERO.subTo(r,r); -} - -// (public) this mod a -function bnMod(a) { - var r = nbi(); - this.abs().divRemTo(a,null,r); - if(this.s < 0 && r.compareTo(BigInteger.ZERO) > 0) a.subTo(r,r); - return r; -} - -// Modular reduction using "classic" algorithm -function Classic(m) { this.m = m; } -function cConvert(x) { - if(x.s < 0 || x.compareTo(this.m) >= 0) return x.mod(this.m); - else return x; -} -function cRevert(x) { return x; } -function cReduce(x) { x.divRemTo(this.m,null,x); } -function cMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); } -function cSqrTo(x,r) { x.squareTo(r); this.reduce(r); } - -Classic.prototype.convert = cConvert; -Classic.prototype.revert = cRevert; -Classic.prototype.reduce = cReduce; -Classic.prototype.mulTo = cMulTo; -Classic.prototype.sqrTo = cSqrTo; - -// (protected) return "-1/this % 2^DB"; useful for Mont. reduction -// justification: -// xy == 1 (mod m) -// xy = 1+km -// xy(2-xy) = (1+km)(1-km) -// x[y(2-xy)] = 1-k^2m^2 -// x[y(2-xy)] == 1 (mod m^2) -// if y is 1/x mod m, then y(2-xy) is 1/x mod m^2 -// should reduce x and y(2-xy) by m^2 at each step to keep size bounded. -// JS multiply "overflows" differently from C/C++, so care is needed here. -function bnpInvDigit() { - if(this.t < 1) return 0; - var x = this[0]; - if((x&1) == 0) return 0; - var y = x&3; // y == 1/x mod 2^2 - y = (y*(2-(x&0xf)*y))&0xf; // y == 1/x mod 2^4 - y = (y*(2-(x&0xff)*y))&0xff; // y == 1/x mod 2^8 - y = (y*(2-(((x&0xffff)*y)&0xffff)))&0xffff; // y == 1/x mod 2^16 - // last step - calculate inverse mod DV directly; - // assumes 16 < DB <= 32 and assumes ability to handle 48-bit ints - y = (y*(2-x*y%this.DV))%this.DV; // y == 1/x mod 2^dbits - // we really want the negative inverse, and -DV < y < DV - return (y>0)?this.DV-y:-y; -} - -// Montgomery reduction -function Montgomery(m) { - this.m = m; - this.mp = m.invDigit(); - this.mpl = this.mp&0x7fff; - this.mph = this.mp>>15; - this.um = (1<<(m.DB-15))-1; - this.mt2 = 2*m.t; -} - -// xR mod m -function montConvert(x) { - var r = nbi(); - x.abs().dlShiftTo(this.m.t,r); - r.divRemTo(this.m,null,r); - if(x.s < 0 && r.compareTo(BigInteger.ZERO) > 0) this.m.subTo(r,r); - return r; -} - -// x/R mod m -function montRevert(x) { - var r = nbi(); - x.copyTo(r); - this.reduce(r); - return r; -} - -// x = x/R mod m (HAC 14.32) -function montReduce(x) { - while(x.t <= this.mt2) // pad x so am has enough room later - x[x.t++] = 0; - for(var i = 0; i < this.m.t; ++i) { - // faster way of calculating u0 = x[i]*mp mod DV - var j = x[i]&0x7fff; - var u0 = (j*this.mpl+(((j*this.mph+(x[i]>>15)*this.mpl)&this.um)<<15))&x.DM; - // use am to combine the multiply-shift-add into one call - j = i+this.m.t; - x[j] += this.m.am(0,u0,x,i,0,this.m.t); - // propagate carry - while(x[j] >= x.DV) { x[j] -= x.DV; x[++j]++; } - } - x.clamp(); - x.drShiftTo(this.m.t,x); - if(x.compareTo(this.m) >= 0) x.subTo(this.m,x); -} - -// r = "x^2/R mod m"; x != r -function montSqrTo(x,r) { x.squareTo(r); this.reduce(r); } - -// r = "xy/R mod m"; x,y != r -function montMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); } - -Montgomery.prototype.convert = montConvert; -Montgomery.prototype.revert = montRevert; -Montgomery.prototype.reduce = montReduce; -Montgomery.prototype.mulTo = montMulTo; -Montgomery.prototype.sqrTo = montSqrTo; - -// (protected) true iff this is even -function bnpIsEven() { return ((this.t>0)?(this[0]&1):this.s) == 0; } - -// (protected) this^e, e < 2^32, doing sqr and mul with "r" (HAC 14.79) -function bnpExp(e,z) { - if(e > 0xffffffff || e < 1) return BigInteger.ONE; - var r = nbi(), r2 = nbi(), g = z.convert(this), i = nbits(e)-1; - g.copyTo(r); - while(--i >= 0) { - z.sqrTo(r,r2); - if((e&(1< 0) z.mulTo(r2,g,r); - else { var t = r; r = r2; r2 = t; } - } - return z.revert(r); -} - -// (public) this^e % m, 0 <= e < 2^32 -function bnModPowInt(e,m) { - var z; - if(e < 256 || m.isEven()) z = new Classic(m); else z = new Montgomery(m); - return this.exp(e,z); -} - -// protected -BigInteger.prototype.copyTo = bnpCopyTo; -BigInteger.prototype.fromInt = bnpFromInt; -BigInteger.prototype.fromString = bnpFromString; -BigInteger.prototype.clamp = bnpClamp; -BigInteger.prototype.dlShiftTo = bnpDLShiftTo; -BigInteger.prototype.drShiftTo = bnpDRShiftTo; -BigInteger.prototype.lShiftTo = bnpLShiftTo; -BigInteger.prototype.rShiftTo = bnpRShiftTo; -BigInteger.prototype.subTo = bnpSubTo; -BigInteger.prototype.multiplyTo = bnpMultiplyTo; -BigInteger.prototype.squareTo = bnpSquareTo; -BigInteger.prototype.divRemTo = bnpDivRemTo; -BigInteger.prototype.invDigit = bnpInvDigit; -BigInteger.prototype.isEven = bnpIsEven; -BigInteger.prototype.exp = bnpExp; - -// public -BigInteger.prototype.toString = bnToString; -BigInteger.prototype.negate = bnNegate; -BigInteger.prototype.abs = bnAbs; -BigInteger.prototype.compareTo = bnCompareTo; -BigInteger.prototype.bitLength = bnBitLength; -BigInteger.prototype.mod = bnMod; -BigInteger.prototype.modPowInt = bnModPowInt; - -// "constants" -BigInteger.ZERO = nbv(0); -BigInteger.ONE = nbv(1); - -/* * Copyright (c) 2003-2005 Tom Wu (tjw@cs.Stanford.EDU) * All Rights Reserved. * @@ -1499,6 +910,595 @@ BigInteger.prototype.toMPI = bnToMPI; // JSBN-specific extension BigInteger.prototype.square = bnSquare; +/* + * Copyright (c) 2003-2005 Tom Wu (tjw@cs.Stanford.EDU) + * All Rights Reserved. + * + * Modified by Recurity Labs GmbH + * + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, + * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY + * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + * + * IN NO EVENT SHALL TOM WU BE LIABLE FOR ANY SPECIAL, INCIDENTAL, + * INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY DAMAGES WHATSOEVER + * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER OR NOT ADVISED OF + * THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF LIABILITY, ARISING OUT + * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * In addition, the following condition applies: + * + * All redistributions must retain an intact copy of this copyright notice + * and disclaimer. + */ + +// Basic JavaScript BN library - subset useful for RSA encryption. + +// Bits per digit +var dbits; + +// JavaScript engine analysis +var canary = 0xdeadbeefcafe; +var j_lm = ((canary&0xffffff)==0xefcafe); + +// (public) Constructor +function BigInteger(a,b,c) { + if(a != null) + if("number" == typeof a) this.fromNumber(a,b,c); + else if(b == null && "string" != typeof a) this.fromString(a,256); + else this.fromString(a,b); +} + +// return new, unset BigInteger +function nbi() { return new BigInteger(null); } + +// am: Compute w_j += (x*this_i), propagate carries, +// c is initial carry, returns final carry. +// c < 3*dvalue, x < 2*dvalue, this_i < dvalue +// We need to select the fastest one that works in this environment. + +// am1: use a single mult and divide to get the high bits, +// max digit bits should be 26 because +// max internal value = 2*dvalue^2-2*dvalue (< 2^53) +function am1(i,x,w,j,c,n) { + while(--n >= 0) { + var v = x*this[i++]+w[j]+c; + c = Math.floor(v/0x4000000); + w[j++] = v&0x3ffffff; + } + return c; +} +// am2 avoids a big mult-and-extract completely. +// Max digit bits should be <= 30 because we do bitwise ops +// on values up to 2*hdvalue^2-hdvalue-1 (< 2^31) +function am2(i,x,w,j,c,n) { + var xl = x&0x7fff, xh = x>>15; + while(--n >= 0) { + var l = this[i]&0x7fff; + var h = this[i++]>>15; + var m = xh*l+h*xl; + l = xl*l+((m&0x7fff)<<15)+w[j]+(c&0x3fffffff); + c = (l>>>30)+(m>>>15)+xh*h+(c>>>30); + w[j++] = l&0x3fffffff; + } + return c; +} +// Alternately, set max digit bits to 28 since some +// browsers slow down when dealing with 32-bit numbers. +function am3(i,x,w,j,c,n) { + var xl = x&0x3fff, xh = x>>14; + while(--n >= 0) { + var l = this[i]&0x3fff; + var h = this[i++]>>14; + var m = xh*l+h*xl; + l = xl*l+((m&0x3fff)<<14)+w[j]+c; + c = (l>>28)+(m>>14)+xh*h; + w[j++] = l&0xfffffff; + } + return c; +} +if(j_lm && (navigator.appName == "Microsoft Internet Explorer")) { + BigInteger.prototype.am = am2; + dbits = 30; +} +else if(j_lm && (navigator.appName != "Netscape")) { + BigInteger.prototype.am = am1; + dbits = 26; +} +else { // Mozilla/Netscape seems to prefer am3 + BigInteger.prototype.am = am3; + dbits = 28; +} + +BigInteger.prototype.DB = dbits; +BigInteger.prototype.DM = ((1<= 0; --i) r[i] = this[i]; + r.t = this.t; + r.s = this.s; +} + +// (protected) set from integer value x, -DV <= x < DV +function bnpFromInt(x) { + this.t = 1; + this.s = (x<0)?-1:0; + if(x > 0) this[0] = x; + else if(x < -1) this[0] = x+DV; + else this.t = 0; +} + +// return bigint initialized to value +function nbv(i) { var r = nbi(); r.fromInt(i); return r; } + +// (protected) set from string and radix +function bnpFromString(s,b) { + var k; + if(b == 16) k = 4; + else if(b == 8) k = 3; + else if(b == 256) k = 8; // byte array + else if(b == 2) k = 1; + else if(b == 32) k = 5; + else if(b == 4) k = 2; + else { this.fromRadix(s,b); return; } + this.t = 0; + this.s = 0; + var i = s.length, mi = false, sh = 0; + while(--i >= 0) { + var x = (k==8)?s[i]&0xff:intAt(s,i); + if(x < 0) { + if(s.charAt(i) == "-") mi = true; + continue; + } + mi = false; + if(sh == 0) + this[this.t++] = x; + else if(sh+k > this.DB) { + this[this.t-1] |= (x&((1<<(this.DB-sh))-1))<>(this.DB-sh)); + } + else + this[this.t-1] |= x<= this.DB) sh -= this.DB; + } + if(k == 8 && (s[0]&0x80) != 0) { + this.s = -1; + if(sh > 0) this[this.t-1] |= ((1<<(this.DB-sh))-1)< 0 && this[this.t-1] == c) --this.t; +} + +// (public) return string representation in given radix +function bnToString(b) { + if(this.s < 0) return "-"+this.negate().toString(b); + var k; + if(b == 16) k = 4; + else if(b == 8) k = 3; + else if(b == 2) k = 1; + else if(b == 32) k = 5; + else if(b == 4) k = 2; + else return this.toRadix(b); + var km = (1< 0) { + if(p < this.DB && (d = this[i]>>p) > 0) { m = true; r = int2char(d); } + while(i >= 0) { + if(p < k) { + d = (this[i]&((1<>(p+=this.DB-k); + } + else { + d = (this[i]>>(p-=k))&km; + if(p <= 0) { p += this.DB; --i; } + } + if(d > 0) m = true; + if(m) r += int2char(d); + } + } + return m?r:"0"; +} + +// (public) -this +function bnNegate() { var r = nbi(); BigInteger.ZERO.subTo(this,r); return r; } + +// (public) |this| +function bnAbs() { return (this.s<0)?this.negate():this; } + +// (public) return + if this > a, - if this < a, 0 if equal +function bnCompareTo(a) { + var r = this.s-a.s; + if(r != 0) return r; + var i = this.t; + r = i-a.t; + if(r != 0) return r; + while(--i >= 0) if((r=this[i]-a[i]) != 0) return r; + return 0; +} + +// returns bit length of the integer x +function nbits(x) { + var r = 1, t; + if((t=x>>>16) != 0) { x = t; r += 16; } + if((t=x>>8) != 0) { x = t; r += 8; } + if((t=x>>4) != 0) { x = t; r += 4; } + if((t=x>>2) != 0) { x = t; r += 2; } + if((t=x>>1) != 0) { x = t; r += 1; } + return r; +} + +// (public) return the number of bits in "this" +function bnBitLength() { + if(this.t <= 0) return 0; + return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM)); +} + +// (protected) r = this << n*DB +function bnpDLShiftTo(n,r) { + var i; + for(i = this.t-1; i >= 0; --i) r[i+n] = this[i]; + for(i = n-1; i >= 0; --i) r[i] = 0; + r.t = this.t+n; + r.s = this.s; +} + +// (protected) r = this >> n*DB +function bnpDRShiftTo(n,r) { + for(var i = n; i < this.t; ++i) r[i-n] = this[i]; + r.t = Math.max(this.t-n,0); + r.s = this.s; +} + +// (protected) r = this << n +function bnpLShiftTo(n,r) { + var bs = n%this.DB; + var cbs = this.DB-bs; + var bm = (1<= 0; --i) { + r[i+ds+1] = (this[i]>>cbs)|c; + c = (this[i]&bm)<= 0; --i) r[i] = 0; + r[ds] = c; + r.t = this.t+ds+1; + r.s = this.s; + r.clamp(); +} + +// (protected) r = this >> n +function bnpRShiftTo(n,r) { + r.s = this.s; + var ds = Math.floor(n/this.DB); + if(ds >= this.t) { r.t = 0; return; } + var bs = n%this.DB; + var cbs = this.DB-bs; + var bm = (1<>bs; + for(var i = ds+1; i < this.t; ++i) { + r[i-ds-1] |= (this[i]&bm)<>bs; + } + if(bs > 0) r[this.t-ds-1] |= (this.s&bm)<>= this.DB; + } + if(a.t < this.t) { + c -= a.s; + while(i < this.t) { + c += this[i]; + r[i++] = c&this.DM; + c >>= this.DB; + } + c += this.s; + } + else { + c += this.s; + while(i < a.t) { + c -= a[i]; + r[i++] = c&this.DM; + c >>= this.DB; + } + c -= a.s; + } + r.s = (c<0)?-1:0; + if(c < -1) r[i++] = this.DV+c; + else if(c > 0) r[i++] = c; + r.t = i; + r.clamp(); +} + +// (protected) r = this * a, r != this,a (HAC 14.12) +// "this" should be the larger one if appropriate. +function bnpMultiplyTo(a,r) { + var x = this.abs(), y = a.abs(); + var i = x.t; + r.t = i+y.t; + while(--i >= 0) r[i] = 0; + for(i = 0; i < y.t; ++i) r[i+x.t] = x.am(0,y[i],r,i,0,x.t); + r.s = 0; + r.clamp(); + if(this.s != a.s) BigInteger.ZERO.subTo(r,r); +} + +// (protected) r = this^2, r != this (HAC 14.16) +function bnpSquareTo(r) { + var x = this.abs(); + var i = r.t = 2*x.t; + while(--i >= 0) r[i] = 0; + for(i = 0; i < x.t-1; ++i) { + var c = x.am(i,x[i],r,2*i,0,1); + if((r[i+x.t]+=x.am(i+1,2*x[i],r,2*i+1,c,x.t-i-1)) >= x.DV) { + r[i+x.t] -= x.DV; + r[i+x.t+1] = 1; + } + } + if(r.t > 0) r[r.t-1] += x.am(i,x[i],r,2*i,0,1); + r.s = 0; + r.clamp(); +} + +// (protected) divide this by m, quotient and remainder to q, r (HAC 14.20) +// r != q, this != m. q or r may be null. +function bnpDivRemTo(m,q,r) { + var pm = m.abs(); + if(pm.t <= 0) return; + var pt = this.abs(); + if(pt.t < pm.t) { + if(q != null) q.fromInt(0); + if(r != null) this.copyTo(r); + return; + } + if(r == null) r = nbi(); + var y = nbi(), ts = this.s, ms = m.s; + var nsh = this.DB-nbits(pm[pm.t-1]); // normalize modulus + if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); } + else { pm.copyTo(y); pt.copyTo(r); } + var ys = y.t; + var y0 = y[ys-1]; + if(y0 == 0) return; + var yt = y0*(1<1)?y[ys-2]>>this.F2:0); + var d1 = this.FV/yt, d2 = (1<= 0) { + r[r.t++] = 1; + r.subTo(t,r); + } + BigInteger.ONE.dlShiftTo(ys,t); + t.subTo(y,y); // "negative" y so we can replace sub with am later + while(y.t < ys) y[y.t++] = 0; + while(--j >= 0) { + // Estimate quotient digit + var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2); + if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out + y.dlShiftTo(j,t); + r.subTo(t,r); + while(r[i] < --qd) r.subTo(t,r); + } + } + if(q != null) { + r.drShiftTo(ys,q); + if(ts != ms) BigInteger.ZERO.subTo(q,q); + } + r.t = ys; + r.clamp(); + if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder + if(ts < 0) BigInteger.ZERO.subTo(r,r); +} + +// (public) this mod a +function bnMod(a) { + var r = nbi(); + this.abs().divRemTo(a,null,r); + if(this.s < 0 && r.compareTo(BigInteger.ZERO) > 0) a.subTo(r,r); + return r; +} + +// Modular reduction using "classic" algorithm +function Classic(m) { this.m = m; } +function cConvert(x) { + if(x.s < 0 || x.compareTo(this.m) >= 0) return x.mod(this.m); + else return x; +} +function cRevert(x) { return x; } +function cReduce(x) { x.divRemTo(this.m,null,x); } +function cMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); } +function cSqrTo(x,r) { x.squareTo(r); this.reduce(r); } + +Classic.prototype.convert = cConvert; +Classic.prototype.revert = cRevert; +Classic.prototype.reduce = cReduce; +Classic.prototype.mulTo = cMulTo; +Classic.prototype.sqrTo = cSqrTo; + +// (protected) return "-1/this % 2^DB"; useful for Mont. reduction +// justification: +// xy == 1 (mod m) +// xy = 1+km +// xy(2-xy) = (1+km)(1-km) +// x[y(2-xy)] = 1-k^2m^2 +// x[y(2-xy)] == 1 (mod m^2) +// if y is 1/x mod m, then y(2-xy) is 1/x mod m^2 +// should reduce x and y(2-xy) by m^2 at each step to keep size bounded. +// JS multiply "overflows" differently from C/C++, so care is needed here. +function bnpInvDigit() { + if(this.t < 1) return 0; + var x = this[0]; + if((x&1) == 0) return 0; + var y = x&3; // y == 1/x mod 2^2 + y = (y*(2-(x&0xf)*y))&0xf; // y == 1/x mod 2^4 + y = (y*(2-(x&0xff)*y))&0xff; // y == 1/x mod 2^8 + y = (y*(2-(((x&0xffff)*y)&0xffff)))&0xffff; // y == 1/x mod 2^16 + // last step - calculate inverse mod DV directly; + // assumes 16 < DB <= 32 and assumes ability to handle 48-bit ints + y = (y*(2-x*y%this.DV))%this.DV; // y == 1/x mod 2^dbits + // we really want the negative inverse, and -DV < y < DV + return (y>0)?this.DV-y:-y; +} + +// Montgomery reduction +function Montgomery(m) { + this.m = m; + this.mp = m.invDigit(); + this.mpl = this.mp&0x7fff; + this.mph = this.mp>>15; + this.um = (1<<(m.DB-15))-1; + this.mt2 = 2*m.t; +} + +// xR mod m +function montConvert(x) { + var r = nbi(); + x.abs().dlShiftTo(this.m.t,r); + r.divRemTo(this.m,null,r); + if(x.s < 0 && r.compareTo(BigInteger.ZERO) > 0) this.m.subTo(r,r); + return r; +} + +// x/R mod m +function montRevert(x) { + var r = nbi(); + x.copyTo(r); + this.reduce(r); + return r; +} + +// x = x/R mod m (HAC 14.32) +function montReduce(x) { + while(x.t <= this.mt2) // pad x so am has enough room later + x[x.t++] = 0; + for(var i = 0; i < this.m.t; ++i) { + // faster way of calculating u0 = x[i]*mp mod DV + var j = x[i]&0x7fff; + var u0 = (j*this.mpl+(((j*this.mph+(x[i]>>15)*this.mpl)&this.um)<<15))&x.DM; + // use am to combine the multiply-shift-add into one call + j = i+this.m.t; + x[j] += this.m.am(0,u0,x,i,0,this.m.t); + // propagate carry + while(x[j] >= x.DV) { x[j] -= x.DV; x[++j]++; } + } + x.clamp(); + x.drShiftTo(this.m.t,x); + if(x.compareTo(this.m) >= 0) x.subTo(this.m,x); +} + +// r = "x^2/R mod m"; x != r +function montSqrTo(x,r) { x.squareTo(r); this.reduce(r); } + +// r = "xy/R mod m"; x,y != r +function montMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); } + +Montgomery.prototype.convert = montConvert; +Montgomery.prototype.revert = montRevert; +Montgomery.prototype.reduce = montReduce; +Montgomery.prototype.mulTo = montMulTo; +Montgomery.prototype.sqrTo = montSqrTo; + +// (protected) true iff this is even +function bnpIsEven() { return ((this.t>0)?(this[0]&1):this.s) == 0; } + +// (protected) this^e, e < 2^32, doing sqr and mul with "r" (HAC 14.79) +function bnpExp(e,z) { + if(e > 0xffffffff || e < 1) return BigInteger.ONE; + var r = nbi(), r2 = nbi(), g = z.convert(this), i = nbits(e)-1; + g.copyTo(r); + while(--i >= 0) { + z.sqrTo(r,r2); + if((e&(1< 0) z.mulTo(r2,g,r); + else { var t = r; r = r2; r2 = t; } + } + return z.revert(r); +} + +// (public) this^e % m, 0 <= e < 2^32 +function bnModPowInt(e,m) { + var z; + if(e < 256 || m.isEven()) z = new Classic(m); else z = new Montgomery(m); + return this.exp(e,z); +} + +// protected +BigInteger.prototype.copyTo = bnpCopyTo; +BigInteger.prototype.fromInt = bnpFromInt; +BigInteger.prototype.fromString = bnpFromString; +BigInteger.prototype.clamp = bnpClamp; +BigInteger.prototype.dlShiftTo = bnpDLShiftTo; +BigInteger.prototype.drShiftTo = bnpDRShiftTo; +BigInteger.prototype.lShiftTo = bnpLShiftTo; +BigInteger.prototype.rShiftTo = bnpRShiftTo; +BigInteger.prototype.subTo = bnpSubTo; +BigInteger.prototype.multiplyTo = bnpMultiplyTo; +BigInteger.prototype.squareTo = bnpSquareTo; +BigInteger.prototype.divRemTo = bnpDivRemTo; +BigInteger.prototype.invDigit = bnpInvDigit; +BigInteger.prototype.isEven = bnpIsEven; +BigInteger.prototype.exp = bnpExp; + +// public +BigInteger.prototype.toString = bnToString; +BigInteger.prototype.negate = bnNegate; +BigInteger.prototype.abs = bnAbs; +BigInteger.prototype.compareTo = bnCompareTo; +BigInteger.prototype.bitLength = bnBitLength; +BigInteger.prototype.mod = bnMod; +BigInteger.prototype.modPowInt = bnModPowInt; + +// "constants" +BigInteger.ZERO = nbv(0); +BigInteger.ONE = nbv(1); + // GPG4Browsers - An OpenPGP implementation in javascript // Copyright (C) 2011 Recurity Labs GmbH // @@ -3368,27 +3368,37 @@ function str_sha512(str) { * materials provided with the application or distribution. */ +/** + * An array of bytes, that is integers with values from 0 to 255 + * @typedef {(Array|Uint8Array)} openpgp_byte_array + */ + +/** + * Block cipher function + * @callback openpgp_cipher_block_fn + * @param {openpgp_byte_array} block A block to perform operations on + * @param {openpgp_byte_array} key to use in encryption/decryption + * @return {openpgp_byte_array} Encrypted/decrypted block + */ + + // -------------------------------------- /** * This function encrypts a given with the specified prefixrandom * using the specified blockcipher to encrypt a message - * @param prefixrandom random bytes of block_size length provided + * @param {String} prefixrandom random bytes of block_size length provided * as a string to be used in prefixing the data - * @param blockcipherfn the algorithm encrypt function to encrypt - * data in one block_size encryption. The function must be - * specified as blockcipherfn([integer_array(integers 0..255)] - * block,[integer_array(integers 0..255)] key) returning an - * array of bytes (integers 0..255) - * @param block_size the block size in bytes of the algorithm used - * @param plaintext data to be encrypted provided as a string - * @param key key to be used to encrypt the data as - * integer_array(integers 0..255)]. This will be passed to the + * @param {openpgp_cipher_block_fn} blockcipherfn the algorithm encrypt function to encrypt + * data in one block_size encryption. + * @param {Integer} block_size the block size in bytes of the algorithm used + * @param {String} plaintext data to be encrypted provided as a string + * @param {openpgp_byte_array} key key to be used to encrypt the data. This will be passed to the * blockcipherfn - * @param resync a boolean value specifying if a resync of the + * @param {Boolean} resync a boolean value specifying if a resync of the * IV should be used or not. The encrypteddatapacket uses the * "old" style with a resync. Encryption within an * encryptedintegrityprotecteddata packet is not resyncing the IV. - * @return a string with the encrypted data + * @return {String} a string with the encrypted data */ function openpgp_cfb_encrypt(prefixrandom, blockcipherencryptfn, plaintext, block_size, key, resync) { var FR = new Array(block_size); @@ -3479,12 +3489,12 @@ function openpgp_cfb_encrypt(prefixrandom, blockcipherencryptfn, plaintext, bloc } /** - * decrypts the prefixed data for the Modification Detection Code (MDC) computation - * @param blockcipherencryptfn cipher function to use - * @param block_size blocksize of the algorithm - * @param key the key for encryption - * @param ciphertext the encrypted data - * @return plaintext data of D(ciphertext) with blocksize length +2 + * Decrypts the prefixed data for the Modification Detection Code (MDC) computation + * @param {openpgp_block_cipher_fn} blockcipherencryptfn Cipher function to use + * @param {Integer} block_size Blocksize of the algorithm + * @param {openpgp_byte_array} key The key for encryption + * @param {String} ciphertext The encrypted data + * @return {String} plaintext Data of D(ciphertext) with blocksize length +2 */ function openpgp_cfb_mdc(blockcipherencryptfn, block_size, key, ciphertext) { var iblock = new Array(block_size); @@ -3510,21 +3520,17 @@ function openpgp_cfb_mdc(blockcipherencryptfn, block_size, key, ciphertext) { /** * This function decrypts a given plaintext using the specified * blockcipher to decrypt a message - * @param blockcipherfn the algorithm _encrypt_ function to encrypt - * data in one block_size encryption. The function must be - * specified as blockcipherfn([integer_array(integers 0..255)] - * block,[integer_array(integers 0..255)] key) returning an - * array of bytes (integers 0..255) - * @param block_size the block size in bytes of the algorithm used - * @param plaintext ciphertext to be decrypted provided as a string - * @param key key to be used to decrypt the ciphertext as - * integer_array(integers 0..255)]. This will be passed to the + * @param {openpgp_cipher_block_fn} blockcipherfn The algorithm _encrypt_ function to encrypt + * data in one block_size encryption. + * @param {Integer} block_size the block size in bytes of the algorithm used + * @param {String} plaintext ciphertext to be decrypted provided as a string + * @param {openpgp_byte_array} key key to be used to decrypt the ciphertext. This will be passed to the * blockcipherfn - * @param resync a boolean value specifying if a resync of the + * @param {Boolean} resync a boolean value specifying if a resync of the * IV should be used or not. The encrypteddatapacket uses the * "old" style with a resync. Decryption within an * encryptedintegrityprotecteddata packet is not resyncing the IV. - * @return a string with the plaintext data + * @return {String} a string with the plaintext data */ function openpgp_cfb_decrypt(blockcipherencryptfn, block_size, key, ciphertext, resync) @@ -3657,11 +3663,11 @@ function normal_cfb_decrypt(blockcipherencryptfn, block_size, key, ciphertext, i /** * Encrypts data using the specified public key multiprecision integers * and the specified algorithm. - * @param algo [Integer] Algorithm to be used (See RFC4880 9.1) - * @param publicMPIs [Array[openpgp_type_mpi]] algorithm dependent multiprecision integers - * @param data [openpgp_type_mpi] data to be encrypted as MPI - * @return [Object] if RSA an openpgp_type_mpi; if elgamal encryption an array of two - * openpgp_type_mpi is returned; otherwise null + * @param {Integer} algo Algorithm to be used (See RFC4880 9.1) + * @param {openpgp_type_mpi[]} publicMPIs Algorithm dependent multiprecision integers + * @param {openpgp_type_mpi} data Data to be encrypted as MPI + * @return {(openpgp_type_mpi|openpgp_type_mpi[])} if RSA an openpgp_type_mpi; + * if elgamal encryption an array of two openpgp_type_mpi is returned; otherwise null */ function openpgp_crypto_asymetricEncrypt(algo, publicMPIs, data) { switch(algo) { @@ -3688,11 +3694,13 @@ function openpgp_crypto_asymetricEncrypt(algo, publicMPIs, data) { /** * Decrypts data using the specified public key multiprecision integers of the private key, * the specified secretMPIs of the private key and the specified algorithm. - * @param algo [Integer] Algorithm to be used (See RFC4880 9.1) - * @param publicMPIs [Array[openpgp_type_mpi]] algorithm dependent multiprecision integers of the public key part of the private key - * @param secretMPIs [Array[openpgp_type_mpi]] algorithm dependent multiprecision integers of the private key used - * @param data [openpgp_type_mpi] data to be encrypted as MPI - * @return [BigInteger] returns a big integer containing the decrypted data; otherwise null + * @param {Integer} algo Algorithm to be used (See RFC4880 9.1) + * @param {openpgp_type_mpi[]} publicMPIs Algorithm dependent multiprecision integers + * of the public key part of the private key + * @param {openpgp_type_mpi[]} secretMPIs Algorithm dependent multiprecision integers + * of the private key used + * @param {openpgp_type_mpi} data Data to be encrypted as MPI + * @return {BigInteger} returns a big integer containing the decrypted data; otherwise null */ function openpgp_crypto_asymetricDecrypt(algo, publicMPIs, secretMPIs, dataMPIs) { @@ -3722,8 +3730,8 @@ function openpgp_crypto_asymetricDecrypt(algo, publicMPIs, secretMPIs, dataMPIs) /** * generate random byte prefix as string for the specified algorithm - * @param algo [Integer] algorithm to use (see RFC4880 9.2) - * @return [String] random bytes with length equal to the block + * @param {Integer} algo Algorithm to use (see RFC4880 9.2) + * @return {String} Random bytes with length equal to the block * size of the cipher */ function openpgp_crypto_getPrefixRandom(algo) { @@ -3744,10 +3752,10 @@ function openpgp_crypto_getPrefixRandom(algo) { /** * retrieve the MDC prefixed bytes by decrypting them - * @param algo [Integer] algorithm to use (see RFC4880 9.2) - * @param key [String] key as string. length is depending on the algorithm used - * @param data [String] encrypted data where the prefix is decrypted from - * @return [String] plain text data of the prefixed data + * @param {Integer} algo Algorithm to use (see RFC4880 9.2) + * @param {String} key Key as string. length is depending on the algorithm used + * @param {String} data Encrypted data where the prefix is decrypted from + * @return {String} Plain text data of the prefixed data */ function openpgp_crypto_MDCSystemBytes(algo, key, data) { util.print_debug_hexstr_dump("openpgp_crypto_symmetricDecrypt:\nencrypteddata:",data); @@ -3775,8 +3783,8 @@ function openpgp_crypto_MDCSystemBytes(algo, key, data) { } /** * Generating a session key for the specified symmetric algorithm - * @param algo [Integer] algorithm to use (see RFC4880 9.2) - * @return [String] random bytes as a string to be used as a key + * @param {Integer} algo Algorithm to use (see RFC4880 9.2) + * @return {String} Random bytes as a string to be used as a key */ function openpgp_crypto_generateSessionKey(algo) { switch (algo) { @@ -3797,12 +3805,12 @@ function openpgp_crypto_generateSessionKey(algo) { /** * - * @param algo [Integer] public key algorithm - * @param hash_algo [Integer] hash algorithm - * @param msg_MPIs [Array[openpgp_type_mpi]] signature multiprecision integers - * @param publickey_MPIs [Array[openpgp_type_mpi]] public key multiprecision integers - * @param data [String] data on where the signature was computed on. - * @return true if signature (sig_data was equal to data over hash) + * @param {Integer} algo public Key algorithm + * @param {Integer} hash_algo Hash algorithm + * @param {openpgp_type_mpi[]} msg_MPIs Signature multiprecision integers + * @param {openpgp_type_mpi[]} publickey_MPIs Public key multiprecision integers + * @param {String} data Data on where the signature was computed on. + * @return {Boolean} true if signature (sig_data was equal to data over hash) */ function openpgp_crypto_verifySignature(algo, hash_algo, msg_MPIs, publickey_MPIs, data) { var calc_hash = openpgp_crypto_hashData(hash_algo, data); @@ -3844,12 +3852,14 @@ function openpgp_crypto_verifySignature(algo, hash_algo, msg_MPIs, publickey_MPI /** * Create a signature on data using the specified algorithm - * @param hash_algo [Integer] hash algorithm to use (See RFC4880 9.4) - * @param algo [Integer] asymmetric cipher algorithm to use (See RFC4880 9.1) - * @param publicMPIs [Array[openpgp_type_mpi]] public key multiprecision integers of the private key - * @param secretMPIs [Array[openpgp_type_mpi]] private key multiprecision integers which is used to sign the data - * @param data [String] data to be signed - * @return [String or openpgp_type_mpi] + * @param {Integer} hash_algo hash Algorithm to use (See RFC4880 9.4) + * @param {Integer} algo Asymmetric cipher algorithm to use (See RFC4880 9.1) + * @param {openpgp_type_mpi[]} publicMPIs Public key multiprecision integers + * of the private key + * @param {openpgp_type_mpi[]} secretMPIs Private key multiprecision + * integers which is used to sign the data + * @param {String} data Data to be signed + * @return {(String|openpgp_type_mpi)} */ function openpgp_crypto_signData(hash_algo, algo, publicMPIs, secretMPIs, data) { @@ -3884,10 +3894,10 @@ function openpgp_crypto_signData(hash_algo, algo, publicMPIs, secretMPIs, data) } /** - * create a hash on the specified data using the specified algorithm - * @param algo [Integer] hash algorithm type (see RFC4880 9.4) - * @param data [String] data to be hashed - * @return [String] hash value + * Create a hash on the specified data using the specified algorithm + * @param {Integer} algo Hash algorithm type (see RFC4880 9.4) + * @param {String} data Data to be hashed + * @return {String} hash value */ function openpgp_crypto_hashData(algo, data) { var hash = null; @@ -3919,9 +3929,9 @@ function openpgp_crypto_hashData(algo, data) { } /** - * returns the hash size in bytes of the specified hash algorithm type - * @param algo [Integer] hash algorithm type (See RFC4880 9.4) - * @return [Integer] size in bytes of the resulting hash + * Returns the hash size in bytes of the specified hash algorithm type + * @param {Integer} algo Hash algorithm type (See RFC4880 9.4) + * @return {Integer} Size in bytes of the resulting hash */ function openpgp_crypto_getHashByteLength(algo) { var hash = null; @@ -3944,9 +3954,9 @@ function openpgp_crypto_getHashByteLength(algo) { } /** - * retrieve secure random byte string of the specified length - * @param length [Integer] length in bytes to generate - * @return [String] random byte string + * Retrieve secure random byte string of the specified length + * @param {Integer} length Length in bytes to generate + * @return {String} Random byte string */ function openpgp_crypto_getRandomBytes(length) { var result = ''; @@ -3957,20 +3967,20 @@ function openpgp_crypto_getRandomBytes(length) { } /** - * return a pseudo-random number in the specified range - * @param from [Integer] min of the random number - * @param to [Integer] max of the random number (max 32bit) - * @return [Integer] a pseudo random number + * Return a pseudo-random number in the specified range + * @param {Integer} from Min of the random number + * @param {Integer} to Max of the random number (max 32bit) + * @return {Integer} A pseudo random number */ function openpgp_crypto_getPseudoRandom(from, to) { return Math.round(Math.random()*(to-from))+from; } /** - * return a secure random number in the specified range - * @param from [Integer] min of the random number - * @param to [Integer] max of the random number (max 32bit) - * @return [Integer] a secure random number + * Return a secure random number in the specified range + * @param {Integer} from Min of the random number + * @param {Integer} to Max of the random number (max 32bit) + * @return {Integer} A secure random number */ function openpgp_crypto_getSecureRandom(from, to) { var buf = new Uint32Array(1); @@ -3988,9 +3998,9 @@ function openpgp_crypto_getSecureRandomOctet() { } /** - * create a secure random big integer of bits length - * @param bits [Integer] bit length of the MPI to create - * @return [BigInteger] resulting big integer + * Create a secure random big integer of bits length + * @param {Integer} bits Bit length of the MPI to create + * @return {BigInteger} Resulting big integer */ function openpgp_crypto_getRandomBigInteger(bits) { if (bits < 0) @@ -4029,11 +4039,19 @@ function openpgp_crypto_testRSA(key){ var msg = rsa.encrypt(mpi.toBigInteger(),key.ee,key.n); var result = rsa.decrypt(msg, key.d, key.p, key.q, key.u); } + /** - * calls the necessary crypto functions to generate a keypair. Called directly by openpgp.js - * @keyType [int] follows OpenPGP algorithm convention. - * @numBits [int] number of bits to make the key to be generated - * @return {privateKey: [openpgp_packet_keymaterial] , publicKey: [openpgp_packet_keymaterial]} + * @typedef {Object} openpgp_keypair + * @property {openpgp_packet_keymaterial} privateKey + * @property {openpgp_packet_keymaterial} publicKey + */ + +/** + * Calls the necessary crypto functions to generate a keypair. + * Called directly by openpgp.js + * @param {Integer} keyType Follows OpenPGP algorithm convention. + * @param {Integer} numBits Number of bits to make the key to be generated + * @return {openpgp_keypair} */ function openpgp_crypto_generateKeyPair(keyType, numBits, passphrase, s2kHash, symmetricEncryptionAlgorithm){ var privKeyPacket; @@ -4076,14 +4094,14 @@ function openpgp_crypto_generateKeyPair(keyType, numBits, passphrase, s2kHash, s * Symmetrically encrypts data using prefixedrandom, a key with length * depending on the algorithm in openpgp_cfb mode with or without resync * (MDC style) - * @param prefixrandom secure random bytes as string in length equal to the - * block size of the algorithm used (use openpgp_crypto_getPrefixRandom(algo) - * to retrieve that string - * @param algo [Integer] algorithm to use (see RFC4880 9.2) - * @param key [String] key as string. length is depending on the algorithm used - * @param data [String] data to encrypt - * @param openpgp_cfb [boolean] - * @return [String] encrypted data + * @param {String} prefixrandom Secure random bytes as string in + * length equal to the block size of the algorithm used (use + * openpgp_crypto_getPrefixRandom(algo) to retrieve that string + * @param {Integer} algo Algorithm to use (see RFC4880 9.2) + * @param {String} key Key as string. length is depending on the algorithm used + * @param {String} data Data to encrypt + * @param {Boolean} openpgp_cfb + * @return {String} Encrypted data */ function openpgp_crypto_symmetricEncrypt(prefixrandom, algo, key, data, openpgp_cfb) { switch(algo) { @@ -4112,12 +4130,12 @@ function openpgp_crypto_symmetricEncrypt(prefixrandom, algo, key, data, openpgp_ /** * Symmetrically decrypts data using a key with length depending on the * algorithm in openpgp_cfb mode with or without resync (MDC style) - * @param algo [Integer] algorithm to use (see RFC4880 9.2) - * @param key [String] key as string. length is depending on the algorithm used - * @param data [String] data to be decrypted - * @param openpgp_cfb [boolean] if true use the resync (for encrypteddata); + * @param {Integer} algo Algorithm to use (see RFC4880 9.2) + * @param {String} key Key as string. length is depending on the algorithm used + * @param {String} data Data to be decrypted + * @param {Boolean} openpgp_cfb If true use the resync (for encrypteddata); * otherwise use without the resync (for MDC encrypted data) - * @return [String] plaintext data + * @return {String} Plaintext data */ function openpgp_crypto_symmetricDecrypt(algo, key, data, openpgp_cfb) { util.print_debug_hexstr_dump("openpgp_crypto_symmetricDecrypt:\nalgo:"+algo+"\nencrypteddata:",data); @@ -4147,6 +4165,7 @@ function openpgp_crypto_symmetricDecrypt(algo, key, data, openpgp_cfb) { } return null; } + /* Rijndael (AES) Encryption * Copyright 2005 Herbert Hanewinkel, www.haneWIN.de * version 1.1, check www.haneWIN.de for the latest version @@ -6111,8 +6130,8 @@ JXG.decompress = function(str) {return unescape((new JXG.Util.Unzip(JXG.Util.Bas * * Only Huffman codes are decoded in gunzip. * The code is based on the source code for gunzip.c by Pasi Ojala - * @see http://www.cs.tut.fi/~albert/Dev/gunzip/gunzip.c - * @see http://www.cs.tut.fi/~albert + * {@link http://www.cs.tut.fi/~albert/Dev/gunzip/gunzip.c} + * {@link http://www.cs.tut.fi/~albert} */ JXG.Util = {}; @@ -7007,7 +7026,7 @@ function skipdir(){ /** * Base64 encoding / decoding -* @see http://www.webtoolkit.info/ +* {@link http://www.webtoolkit.info/} */ JXG.Util.Base64 = { @@ -7336,10 +7355,21 @@ JXG.Util.genUUID = function() { * @classdesc Implementation of the GPG4Browsers config object */ function openpgp_config() { + /** + * The variable with the actual configuration + * @property {Integer} prefer_hash_algorithm + * @property {Integer} encryption_cipher + * @property {Integer} compression + * @property {Boolean} show_version + * @property {Boolean} show_comment + * @property {Boolean} integrity_protect + * @property {Integer} composition_behavior + * @property {String} keyserver + */ this.config = null; /** - * the default config object which is used if no + * The default config object which is used if no * configuration was in place */ this.default_config = { @@ -7353,13 +7383,12 @@ function openpgp_config() { keyserver: "keyserver.linux.it" // "pgp.mit.edu:11371" }; - this.versionstring ="OpenPGP.js v.1.20130306"; + this.versionstring ="OpenPGP.js v.1.20130412"; this.commentstring ="http://openpgpjs.org"; /** - * reads the config out of the HTML5 local storage + * Reads the config out of the HTML5 local storage * and initializes the object config. * if config is null the default config will be used - * @return [void] */ function read() { var cf = JSON.parse(window.localStorage.getItem("config")); @@ -7372,13 +7401,12 @@ function openpgp_config() { } /** - * if enabled, debug messages will be printed + * If enabled, debug messages will be printed */ this.debug = false; /** - * writes the config to HTML5 local storage - * @return [void] + * Writes the config to HTML5 local storage */ function write() { window.localStorage.setItem("config",JSON.stringify(this.config)); @@ -7481,9 +7509,11 @@ function r2s(t) { // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA /** - * DeArmor an OpenPGP armored message; verify the checksum and return the encoded bytes - * @text [String] OpenPGP armored message - * @return either the bytes of the decoded message or an object with attribute "text" containing the message text + * DeArmor an OpenPGP armored message; verify the checksum and return + * the encoded bytes + * @param {String} text OpenPGP armored message + * @returns {(String|Object)} Either the bytes of the decoded message + * or an object with attribute "text" containing the message text * and an attribute "openpgp" containing the bytes. */ function openpgp_encoding_deArmor(text) { @@ -7510,8 +7540,8 @@ function openpgp_encoding_deArmor(text) { /** * Finds out which Ascii Armoring type is used. This is an internal function - * @param text [String] ascii armored text - * @return 0 = MESSAGE PART n of m + * @param {String} text [String] ascii armored text + * @returns {Integer} 0 = MESSAGE PART n of m * 1 = MESSAGE PART n * 2 = SIGNED MESSAGE * 3 = PGP MESSAGE @@ -7567,7 +7597,7 @@ function getPGPMessageType(text) { * packet block. * @author Alex * @version 2011-12-16 - * @return The header information + * @returns {String} The header information */ function openpgp_encoding_armor_addheader() { var result = ""; @@ -7583,11 +7613,11 @@ function openpgp_encoding_armor_addheader() { /** * Armor an OpenPGP binary packet block - * @param messagetype type of the message + * @param {Integer} messagetype type of the message * @param data - * @param partindex - * @param parttotal - * @return {string} Armored text + * @param {Integer} partindex + * @param {Integer} parttotal + * @returns {String} Armored text */ function openpgp_encoding_armor(messagetype, data, partindex, parttotal) { var result = ""; @@ -7643,8 +7673,8 @@ function openpgp_encoding_armor(messagetype, data, partindex, parttotal) { /** * Calculates a checksum over the given data and returns it base64 encoded - * @param data [String] data to create a CRC-24 checksum for - * @return [String] base64 encoded checksum + * @param {String} data Data to create a CRC-24 checksum for + * @return {String} Base64 encoded checksum */ function getCheckSum(data) { var c = createcrc24(data); @@ -7655,10 +7685,11 @@ function getCheckSum(data) { } /** - * Calculates the checksum over the given data and compares it with the given base64 encoded checksum - * @param data [String] data to create a CRC-24 checksum for - * @param checksum [String] base64 encoded checksum - * @return true if the given checksum is correct; otherwise false + * Calculates the checksum over the given data and compares it with the + * given base64 encoded checksum + * @param {String} data Data to create a CRC-24 checksum for + * @param {String} checksum Base64 encoded checksum + * @return {Boolean} True if the given checksum is correct; otherwise false */ function verifyCheckSum(data, checksum) { var c = getCheckSum(data); @@ -7667,8 +7698,8 @@ function verifyCheckSum(data, checksum) { } /** * Internal function to calculate a CRC-24 checksum over a given string (data) - * @param data [String] data to create a CRC-24 checksum for - * @return [Integer] the CRC-24 checksum as number + * @param {String} data Data to create a CRC-24 checksum for + * @return {Integer} The CRC-24 checksum as number */ var crc_table = [ 0x00000000, 0x00864cfb, 0x018ad50d, 0x010c99f6, 0x0393e6e1, 0x0315aa1a, 0x021933ec, 0x029f7f17, 0x07a18139, 0x0727cdc2, 0x062b5434, 0x06ad18cf, 0x043267d8, 0x04b42b23, 0x05b8b2d5, 0x053efe2e, 0x0fc54e89, 0x0f430272, 0x0e4f9b84, 0x0ec9d77f, 0x0c56a868, 0x0cd0e493, 0x0ddc7d65, 0x0d5a319e, 0x0864cfb0, 0x08e2834b, 0x09ee1abd, 0x09685646, 0x0bf72951, 0x0b7165aa, 0x0a7dfc5c, 0x0afbb0a7, 0x1f0cd1e9, 0x1f8a9d12, 0x1e8604e4, 0x1e00481f, 0x1c9f3708, 0x1c197bf3, 0x1d15e205, 0x1d93aefe, 0x18ad50d0, 0x182b1c2b, 0x192785dd, 0x19a1c926, 0x1b3eb631, 0x1bb8faca, 0x1ab4633c, 0x1a322fc7, 0x10c99f60, 0x104fd39b, 0x11434a6d, 0x11c50696, 0x135a7981, 0x13dc357a, 0x12d0ac8c, 0x1256e077, 0x17681e59, 0x17ee52a2, 0x16e2cb54, 0x166487af, 0x14fbf8b8, 0x147db443, 0x15712db5, 0x15f7614e, 0x3e19a3d2, 0x3e9fef29, 0x3f9376df, 0x3f153a24, 0x3d8a4533, 0x3d0c09c8, 0x3c00903e, 0x3c86dcc5, 0x39b822eb, 0x393e6e10, 0x3832f7e6, 0x38b4bb1d, 0x3a2bc40a, 0x3aad88f1, 0x3ba11107, 0x3b275dfc, 0x31dced5b, 0x315aa1a0, @@ -7726,8 +7757,8 @@ function createcrc24(input) { /** * Wrapper function for the base64 codec. * This function encodes a String (message) in base64 (radix-64) - * @param message [String] the message to encode - * @return [String] the base64 encoded data + * @param {String} message The message to encode + * @return {String} The base64 encoded data */ function openpgp_encoding_base64_encode(message) { return s2r(message); @@ -7737,8 +7768,8 @@ function openpgp_encoding_base64_encode(message) { /** * Wrapper function for the base64 codec. * This function decodes a String(message) in base64 (radix-64) - * @param message [String] base64 encoded data - * @return [String] raw data after decoding + * @param {String} message Base64 encoded data + * @return {String} Raw data after decoding */ function openpgp_encoding_base64_decode(message) { return r2s(message); @@ -7746,9 +7777,10 @@ function openpgp_encoding_base64_decode(message) { /** * Wrapper function for jquery library. - * This function escapes HTML characters within a string. This is used to prevent XSS. - * @param message [String] message to escape - * @return [String] html encoded string + * This function escapes HTML characters within a string. This is used + * to prevent XSS. + * @param {String} message Message to escape + * @return {String} Html encoded string */ function openpgp_encoding_html_encode(message) { if (message == null) @@ -7758,9 +7790,9 @@ function openpgp_encoding_html_encode(message) { /** * create a EME-PKCS1-v1_5 padding (See RFC4880 13.1.1) - * @param message [String] message to be padded - * @param length [Integer] length to the resulting message - * @return [String] EME-PKCS1 padded message + * @param {String} message message to be padded + * @param {Integer} length Length to the resulting message + * @return {String} EME-PKCS1 padded message */ function openpgp_encoding_eme_pkcs1_encode(message, length) { if (message.length > length-11) @@ -7778,8 +7810,8 @@ function openpgp_encoding_eme_pkcs1_encode(message, length) { /** * decodes a EME-PKCS1-v1_5 padding (See RFC4880 13.1.2) - * @param message [String] EME-PKCS1 padded message - * @return [String] decoded message + * @param {String} message EME-PKCS1 padded message + * @return {String} decoded message */ function openpgp_encoding_eme_pkcs1_decode(message, len) { if (message.length < len) @@ -7805,10 +7837,10 @@ hash_headers[11] = [0x30,0x31,0x30,0x0d,0x06,0x09,0x60,0x86,0x48,0x01,0x65,0x03, /** * create a EMSA-PKCS1-v1_5 padding (See RFC4880 13.1.3) - * @param algo [Integer] hash algorithm type used - * @param data [String] data to be hashed - * @param keylength [Integer] key size of the public mpi in bytes - * @return the [String] hashcode with pkcs1padding as string + * @param {Integer} algo Hash algorithm type used + * @param {String} data Data to be hashed + * @param {Integer} keylength Key size of the public mpi in bytes + * @returns {String} Hashcode with pkcs1padding as string */ function openpgp_encoding_emsa_pkcs1_encode(algo, data, keylength) { var data2 = ""; @@ -7827,8 +7859,8 @@ function openpgp_encoding_emsa_pkcs1_encode(algo, data, keylength) { /** * extract the hash out of an EMSA-PKCS1-v1.5 padding (See RFC4880 13.1.3) - * @param data [String] hash in pkcs1 encoding - * @return the hash as string + * @param {String} data Hash in pkcs1 encoding + * @returns {String} The hash as string */ function openpgp_encoding_emsa_pkcs1_decode(algo, data) { var i = 0; @@ -7845,7 +7877,8 @@ function openpgp_encoding_emsa_pkcs1_decode(algo, data) { i+= j; if (data.substring(i).length < openpgp_crypto_getHashByteLength(algo)) return -1; return data.substring(i); -}// GPG4Browsers - An OpenPGP implementation in javascript +} +// GPG4Browsers - An OpenPGP implementation in javascript // Copyright (C) 2011 Recurity Labs GmbH // // This library is free software; you can redistribute it and/or @@ -7882,7 +7915,6 @@ function _openpgp () { * initializes the library: * - reading the keyring from local storage * - reading the config from local storage - * @return [void] */ function init() { this.config = new openpgp_config(); @@ -7896,7 +7928,7 @@ function _openpgp () { * representation an returns openpgp_msg_publickey packets * @param {String} armoredText OpenPGP armored text containing * the public key(s) - * @return {Array[openpgp_msg_publickey]} on error the function + * @return {openpgp_msg_publickey[]} on error the function * returns null */ function read_publicKey(armoredText) { @@ -7942,7 +7974,7 @@ function _openpgp () { * representation an returns openpgp_msg_privatekey objects * @param {String} armoredText OpenPGP armored text containing * the private key(s) - * @return {Array[openpgp_msg_privatekey]} on error the function + * @return {openpgp_msg_privatekey[]} on error the function * returns null */ function read_privateKey(armoredText) { @@ -7972,7 +8004,7 @@ function _openpgp () { * reads message packets out of an OpenPGP armored text and * returns an array of message objects * @param {String} armoredText text to be parsed - * @return {Array[openpgp_msg_message]} on error the function + * @return {openpgp_msg_message[]} on error the function * returns null */ function read_message(armoredText) { @@ -7993,7 +8025,7 @@ function _openpgp () { * External call will parse a de-armored messaged and return messages found. * Internal will be called to read packets wrapped in other packets (i.e. compressed) * @param {String} input dearmored text of OpenPGP packets, to be parsed - * @return {Array[openpgp_msg_message]} on error the function + * @return {openpgp_msg_message[]} on error the function * returns null */ function read_messages_dearmored(input){ @@ -8138,10 +8170,13 @@ function _openpgp () { * creates a binary string representation of an encrypted and signed message. * The message will be encrypted with the public keys specified and signed * with the specified private key. - * @param {obj: [openpgp_msg_privatekey]} privatekey private key to be used to sign the message - * @param {Array {obj: [openpgp_msg_publickey]}} publickeys public keys to be used to encrypt the message + * @param {Object} privatekey {obj: [openpgp_msg_privatekey]} Private key + * to be used to sign the message + * @param {Object[]} publickeys An arraf of {obj: [openpgp_msg_publickey]} + * - public keys to be used to encrypt the message * @param {String} messagetext message text to encrypt and sign - * @return {String} a binary string representation of the message which can be OpenPGP armored + * @return {String} a binary string representation of the message which + * can be OpenPGP armored */ function write_signed_and_encrypted_message(privatekey, publickeys, messagetext) { var result = ""; @@ -8194,8 +8229,8 @@ function _openpgp () { /** * creates a binary string representation of an encrypted message. * The message will be encrypted with the public keys specified - * @param {Array {obj: [openpgp_msg_publickey]}} publickeys public - * keys to be used to encrypt the message + * @param {Object[]} publickeys An array of {obj: [openpgp_msg_publickey]} + * -public keys to be used to encrypt the message * @param {String} messagetext message text to encrypt * @return {String} a binary string representation of the message * which can be OpenPGP armored @@ -8236,12 +8271,13 @@ function _openpgp () { /** * creates a binary string representation a signed message. * The message will be signed with the specified private key. - * @param {obj: [openpgp_msg_privatekey]} privatekey private - * key to be used to sign the message + * @param {Object} privatekey {obj: [openpgp_msg_privatekey]} + * - the private key to be used to sign the message * @param {String} messagetext message text to sign - * @return {Object: text [String]}, openpgp: {String} a binary + * @return {Object} {Object: text [String]}, openpgp: {String} a binary * string representation of the message which can be OpenPGP - * armored(openpgp) and a text representation of the message (text). This can be directly used to OpenPGP armor the message + * armored(openpgp) and a text representation of the message (text). + * This can be directly used to OpenPGP armor the message */ function write_signed_message(privatekey, messagetext) { var sig = new openpgp_packet_signature().write_message_signature(1, messagetext.replace(/\r\n/g,"\n").replace(/\n/,"\r\n"), privatekey); @@ -8250,11 +8286,16 @@ function _openpgp () { } /** - * generates a new key pair for openpgp. Beta stage. Currently only supports RSA keys, and no subkeys. - * @param {int} keyType to indicate what type of key to make. RSA is 1. Follows algorithms outlined in OpenPGP. - * @param {int} numBits number of bits for the key creation. (should be 1024+, generally) - * @param {string} userId assumes already in form of "User Name " - * @return {privateKey: [openpgp_msg_privatekey], privateKeyArmored: [string], publicKeyArmored: [string]} + * generates a new key pair for openpgp. Beta stage. Currently only + * supports RSA keys, and no subkeys. + * @param {Integer} keyType to indicate what type of key to make. + * RSA is 1. Follows algorithms outlined in OpenPGP. + * @param {Integer} numBits number of bits for the key creation. (should + * be 1024+, generally) + * @param {String} userId assumes already in form of "User Name + * " + * @return {Object} {privateKey: [openpgp_msg_privatekey], + * privateKeyArmored: [string], publicKeyArmored: [string]} */ function generate_key_pair(keyType, numBits, userId, passphrase){ var userIdPacket = new openpgp_packet_userid(); @@ -8324,7 +8365,6 @@ function openpgp_keyring() { * Initialization routine for the keyring. This method reads the * keyring from HTML5 local storage and initializes this instance. * This method is called by openpgp.init(). - * @return {null} undefined */ function init() { var sprivatekeys = JSON.parse(window.localStorage.getItem("privatekeys")); @@ -8357,7 +8397,7 @@ function openpgp_keyring() { /** * Checks if at least one private key is in the keyring - * @return {boolean} True if there are private keys, else false. + * @return {Boolean} True if there are private keys, else false. */ function hasPrivateKey() { return this.privateKeys.length > 0; @@ -8367,7 +8407,6 @@ function openpgp_keyring() { /** * Saves the current state of the keyring to HTML5 local storage. * The privateKeys array and publicKeys array gets Stringified using JSON - * @return {null} undefined */ function store() { var priv = new Array(); @@ -8384,8 +8423,8 @@ function openpgp_keyring() { this.store = store; /** * searches all public keys in the keyring matching the address or address part of the user ids - * @param email_address - * @return {array[openpgp_msg_publickey]} the public keys associated with provided email address. + * @param {String} email_address + * @return {openpgp_msg_publickey[]} The public keys associated with provided email address. */ function getPublicKeyForAddress(email_address) { var results = new Array(); @@ -8413,7 +8452,7 @@ function openpgp_keyring() { /** * Searches the keyring for a private key containing the specified email address * @param {String} email_address email address to search for - * @return {Array[openpgp_msg_privatekey} private keys found + * @return {openpgp_msg_privatekey[]} private keys found */ function getPrivateKeyForAddress(email_address) { var results = new Array(); @@ -8440,8 +8479,8 @@ function openpgp_keyring() { this.getPrivateKeyForAddress = getPrivateKeyForAddress; /** * Searches the keyring for public keys having the specified key id - * @param keyId provided as string of hex number (lowercase) - * @return {Array[openpgp_msg_privatekey]} public keys found + * @param {String} keyId provided as string of hex number (lowercase) + * @return {openpgp_msg_privatekey[]} public keys found */ function getPublicKeysForKeyId(keyId) { var result = new Array(); @@ -8468,7 +8507,7 @@ function openpgp_keyring() { /** * Searches the keyring for private keys having the specified key id * @param {String} keyId 8 bytes as string containing the key id to look for - * @return {Array[openpgp_msg_privatekey]} private keys found + * @return {openpgp_msg_privatekey[]} private keys found */ function getPrivateKeyForKeyId(keyId) { var result = new Array(); @@ -8491,7 +8530,6 @@ function openpgp_keyring() { /** * Imports a public key from an exported ascii armored message * @param {String} armored_text PUBLIC KEY BLOCK message to read the public key from - * @return {null} nothing */ function importPublicKey (armored_text) { var result = openpgp.read_publicKey(armored_text); @@ -8504,7 +8542,6 @@ function openpgp_keyring() { /** * Imports a private key from an exported ascii armored message * @param {String} armored_text PRIVATE KEY BLOCK message to read the private key from - * @return {null} nothing */ function importPrivateKey (armored_text, password) { var result = openpgp.read_privateKey(armored_text); @@ -9049,7 +9086,7 @@ function openpgp_msg_publickey() { * - subkey binding and revocation certificates * * This is useful for validating the key - * @returns true if the basic signatures are all valid + * @returns {Boolean} true if the basic signatures are all valid */ function verifyBasicSignatures() { for (var i = 0; i < this.revocationSignatures.length; i++) { @@ -9192,11 +9229,12 @@ function openpgp_packet_compressed() { this.decompressedData = null; /** - * parsing function for the packet. - * @param {string} input payload of a tag 8 packet - * @param {integer} position position to start reading from the input string - * @param {integer} len length of the packet or the remaining length of input at position - * @return {openpgp_packet_compressed} object representation + * Parsing function for the packet. + * @param {String} input Payload of a tag 8 packet + * @param {Integer} position Position to start reading from the input string + * @param {Integer} len Length of the packet or the remaining length of + * input at position + * @return {openpgp_packet_compressed} Object representation */ function read_packet (input, position, len) { this.packetLength = len; @@ -9208,9 +9246,9 @@ function openpgp_packet_compressed() { return this; } /** - * decompression method for decompressing the compressed data + * Decompression method for decompressing the compressed data * read by read_packet - * @return {String} the decompressed data + * @return {String} The decompressed data */ function decompress() { if (this.decompressedData != null) @@ -9261,8 +9299,8 @@ function openpgp_packet_compressed() { /** * Compress the packet data (member decompressedData) - * @param {integer} type algorithm to be used // See RFC 4880 9.3 - * @param {String} data data to be compressed + * @param {Integer} type Algorithm to be used // See RFC 4880 9.3 + * @param {String} data Data to be compressed * @return {String} The compressed data stored in attribute compressedData */ function compress(type, data) { @@ -9292,10 +9330,10 @@ function openpgp_packet_compressed() { } /** - * creates a string representation of the packet - * @param {integer} algorithm algorithm to be used // See RFC 4880 9.3 - * @param {String} data data to be compressed - * @return {String} string-representation of the packet + * Creates a string representation of the packet + * @param {Integer} algorithm Algorithm to be used // See RFC 4880 9.3 + * @param {String} data Data to be compressed + * @return {String} String-representation of the packet */ function write_packet(algorithm, data) { this.decompressedData = data; @@ -9307,7 +9345,7 @@ function openpgp_packet_compressed() { } /** - * pretty printing the packet (useful for debug purposes) + * Pretty printing the packet (useful for debug purposes) * @return {String} */ function toString() { @@ -9358,13 +9396,13 @@ function openpgp_packet_encrypteddata() { this.decryptedData = null; /** - * parsing function for the packet. + * Parsing function for the packet. * - * @param {string} input payload of a tag 9 packet - * @param {integer} position position to start reading from the input string - * @param {integer} len length of the packet or the remaining length of + * @param {String} input Payload of a tag 9 packet + * @param {Integer} position Position to start reading from the input string + * @param {Integer} len Length of the packet or the remaining length of * input at position - * @return {openpgp_packet_encrypteddata} object representation + * @return {openpgp_packet_encrypteddata} Object representation */ function read_packet(input, position, len) { var mypos = position; @@ -9376,14 +9414,14 @@ function openpgp_packet_encrypteddata() { } /** - * symmetrically decrypt the packet data + * Symmetrically decrypt the packet data * - * @param {integer} symmetric_algorithm_type - * symmetric key algorithm to use // See RFC4880 9.2 + * @param {Integer} symmetric_algorithm_type + * Symmetric key algorithm to use // See RFC4880 9.2 * @param {String} key - * key as string with the corresponding length to the + * Key as string with the corresponding length to the * algorithm - * @return the decrypted data; + * @return The decrypted data; */ function decrypt_sym(symmetric_algorithm_type, key) { this.decryptedData = openpgp_crypto_symmetricDecrypt( @@ -9396,11 +9434,11 @@ function openpgp_packet_encrypteddata() { /** * Creates a string representation of the packet * - * @param {Integer} algo symmetric key algorithm to use // See RFC4880 9.2 - * @param {String} key key as string with the corresponding length to the + * @param {Integer} algo Symmetric key algorithm to use // See RFC4880 9.2 + * @param {String} key Key as string with the corresponding length to the * algorithm - * @param {String} data data to be - * @return {String} string-representation of the packet + * @param {String} data Data to be + * @return {String} String-representation of the packet */ function write_packet(algo, key, data) { var result = ""; @@ -9441,7 +9479,8 @@ function openpgp_packet_encrypteddata() { /** * @class - * @classdesc Implementation of the Sym. Encrypted Integrity Protected Data Packet (Tag 18) + * @classdesc Implementation of the Sym. Encrypted Integrity Protected Data + * Packet (Tag 18) * * RFC4880 5.13: The Symmetrically Encrypted Integrity Protected Data packet is * a variant of the Symmetrically Encrypted Data packet. It is a new feature @@ -9458,12 +9497,12 @@ function openpgp_packet_encryptedintegrityprotecteddata() { this.decrytpedData = null; // string this.hash = null; // string /** - * parsing function for the packet. + * Parsing function for the packet. * - * @param {string} input payload of a tag 18 packet - * @param {integer} position + * @param {String} input Payload of a tag 18 packet + * @param {Integer} position * position to start reading from the input string - * @param {integer} len length of the packet or the remaining length of + * @param {Integer} len Length of the packet or the remaining length of * input at position * @return {openpgp_packet_encryptedintegrityprotecteddata} object * representation @@ -9496,12 +9535,12 @@ function openpgp_packet_encryptedintegrityprotecteddata() { * Creates a string representation of a Sym. Encrypted Integrity Protected * Data Packet (tag 18) (see RFC4880 5.13) * - * @param {integer} symmetric_algorithm - * the selected symmetric encryption algorithm to be used - * @param {String} key the key of cipher blocksize length to be used - * @param data - * plaintext data to be encrypted within the packet - * @return a string representation of the packet + * @param {Integer} symmetric_algorithm + * The selected symmetric encryption algorithm to be used + * @param {String} key The key of cipher blocksize length to be used + * @param {String} data + * Plaintext data to be encrypted within the packet + * @return {String} A string representation of the packet */ function write_packet(symmetric_algorithm, key, data) { @@ -9531,10 +9570,10 @@ function openpgp_packet_encryptedintegrityprotecteddata() { * Decrypts the encrypted data contained in this object read_packet must * have been called before * - * @param {integer} symmetric_algorithm_type - * the selected symmetric encryption algorithm to be used - * @param {String} key the key of cipher blocksize length to be used - * @return the decrypted data of this packet + * @param {Integer} symmetric_algorithm_type + * The selected symmetric encryption algorithm to be used + * @param {String} key The key of cipher blocksize length to be used + * @return {String} The decrypted data of this packet */ function decrypt(symmetric_algorithm_type, key) { this.decryptedData = openpgp_crypto_symmetricDecrypt( @@ -9612,13 +9651,13 @@ function openpgp_packet_encryptedintegrityprotecteddata() { function openpgp_packet_encryptedsessionkey() { /** - * parsing function for a publickey encrypted session key packet (tag 1). + * Parsing function for a publickey encrypted session key packet (tag 1). * - * @param {string} input payload of a tag 1 packet - * @param {integer} position position to start reading from the input string - * @param {integer} len length of the packet or the remaining length of + * @param {String} input Payload of a tag 1 packet + * @param {Integer} position Position to start reading from the input string + * @param {Integer} len Length of the packet or the remaining length of * input at position - * @return {openpgp_packet_encrypteddata} object representation + * @return {openpgp_packet_encrypteddata} Object representation */ function read_pub_key_packet(input, position, len) { this.tagType = 1; @@ -9661,21 +9700,22 @@ function openpgp_packet_encryptedsessionkey() { } /** - * create a string representation of a tag 1 packet + * Create a string representation of a tag 1 packet * * @param {String} publicKeyId - * the public key id corresponding to publicMPIs key as string - * @param {Array[openpgp_type_mpi]} publicMPIs - * multiprecision integer objects describing the public key - * @param {integer} pubalgo - * the corresponding public key algorithm // See RFC4880 9.1 - * @param {integer} symmalgo - * the symmetric cipher algorithm used to encrypt the data within - * an encrypteddatapacket or encryptedintegrityprotecteddatapacket + * The public key id corresponding to publicMPIs key as string + * @param {openpgp_type_mpi[]} publicMPIs + * Multiprecision integer objects describing the public key + * @param {Integer} pubalgo + * The corresponding public key algorithm // See RFC4880 9.1 + * @param {Integer} symmalgo + * The symmetric cipher algorithm used to encrypt the data + * within an encrypteddatapacket or encryptedintegrity- + * protecteddatapacket * following this packet //See RFC4880 9.2 * @param {String} sessionkey - * a string of randombytes representing the session key - * @return {String} the string representation + * A string of randombytes representing the session key + * @return {String} The string representation */ function write_pub_key_packet(publicKeyId, publicMPIs, pubalgo, symmalgo, sessionkey) { @@ -9699,14 +9739,14 @@ function openpgp_packet_encryptedsessionkey() { } /** - * parsing function for a symmetric encrypted session key packet (tag 3). + * Parsing function for a symmetric encrypted session key packet (tag 3). * - * @param {string} input payload of a tag 1 packet - * @param {integer} position position to start reading from the input string - * @param {integer} len - * length of the packet or the remaining length of + * @param {String} input Payload of a tag 1 packet + * @param {Integer} position Position to start reading from the input string + * @param {Integer} len + * Length of the packet or the remaining length of * input at position - * @return {openpgp_packet_encrypteddata} object representation + * @return {openpgp_packet_encrypteddata} Object representation */ function read_symmetric_key_packet(input, position, len) { this.tagType = 3; @@ -9735,10 +9775,10 @@ function openpgp_packet_encryptedsessionkey() { * packets (tag 1) * * @param {openpgp_msg_message} msg - * the message object (with member encryptedData + * The message object (with member encryptedData * @param {openpgp_msg_privatekey} key - * private key with secMPIs unlocked - * @return {String} the unencrypted session key + * Private key with secMPIs unlocked + * @return {String} The unencrypted session key */ function decrypt(msg, key) { if (this.tagType == 1) { @@ -9765,7 +9805,7 @@ function openpgp_packet_encryptedsessionkey() { * Creates a string representation of this object (useful for debug * purposes) * - * @return the string containing a openpgp description + * @return {String} The string containing a openpgp description */ function toString() { if (this.tagType == 1) { @@ -9820,16 +9860,16 @@ function openpgp_packet_encryptedsessionkey() { /** * @class - * @classdesc Parent openpgp packet class. Operations focus on determining packet types - * and packet header. + * @classdesc Parent openpgp packet class. Operations focus on determining + * packet types and packet header. */ function _openpgp_packet() { /** * Encodes a given integer of length to the openpgp length specifier to a * string * - * @param {Integer} length of the length to encode - * @return {string} string with openpgp length representation + * @param {Integer} length The length to encode + * @return {String} String with openpgp length representation */ function encode_length(length) { result = ""; @@ -9857,9 +9897,9 @@ function _openpgp_packet() { * Writes a packet header version 4 with the given tag_type and length to a * string * - * @param {integer} tag_type tag type - * @param {integer} length length of the payload - * @return {string} string of the header + * @param {Integer} tag_type Tag type + * @param {Integer} length Length of the payload + * @return {String} String of the header */ function write_packet_header(tag_type, length) { /* we're only generating v4 packet headers here */ @@ -9873,9 +9913,9 @@ function _openpgp_packet() { * Writes a packet header Version 3 with the given tag_type and length to a * string * - * @param {integer} tag_type tag type - * @param {integer} length length of the payload - * @return {string} string of the header + * @param {Integer} tag_type Tag type + * @param {Integer} length Length of the payload + * @return {String} String of the header */ function write_old_packet_header(tag_type, length) { var result = ""; @@ -9900,10 +9940,10 @@ function _openpgp_packet() { /** * Generic static Packet Parser function * - * @param {String} input input stream as string - * @param {integer} position position to start parsing - * @param {integer} len length of the input from position on - * @return {openpgp_packet_*} returns a parsed openpgp_packet + * @param {String} input Input stream as string + * @param {integer} position Position to start parsing + * @param {integer} len Length of the input from position on + * @return {Object} Returns a parsed openpgp_packet */ function read_packet(input, position, len) { // some sanity checks @@ -10260,10 +10300,10 @@ function openpgp_packet_keymaterial() { /** * This function reads the payload of a secret key packet (Tag 5) * and initializes the openpgp_packet_keymaterial - * @param input input string to read the packet from - * @param position start position for the parser - * @param len length of the packet or remaining length of input - * @return openpgp_packet_keymaterial object + * @param {String} input Input string to read the packet from + * @param {Integer} position Start position for the parser + * @param {Intefer} len Length of the packet or remaining length of input + * @return {openpgp_packet_keymaterial} */ function read_tag5(input, position, len) { this.tagType = 5; @@ -10275,10 +10315,10 @@ function openpgp_packet_keymaterial() { /** * This function reads the payload of a public key packet (Tag 6) * and initializes the openpgp_packet_keymaterial - * @param input input string to read the packet from - * @param position start position for the parser - * @param len length of the packet or remaining length of input - * @return openpgp_packet_keymaterial object + * @param {String} input Input string to read the packet from + * @param {Integer} position Start position for the parser + * @param {Integer} len Length of the packet or remaining length of input + * @return {openpgp_packet_keymaterial} */ function read_tag6(input, position, len) { // A Public-Key packet starts a series of packets that forms an OpenPGP @@ -10294,10 +10334,10 @@ function openpgp_packet_keymaterial() { /** * This function reads the payload of a secret key sub packet (Tag 7) * and initializes the openpgp_packet_keymaterial - * @param input input string to read the packet from - * @param position start position for the parser - * @param len length of the packet or remaining length of input - * @return openpgp_packet_keymaterial object + * @param {String} input Input string to read the packet from + * @param {Integer} position Start position for the parser + * @param {Integer} len Length of the packet or remaining length of input + * @return {openpgp_packet_keymaterial} */ function read_tag7(input, position, len) { this.tagType = 7; @@ -10309,10 +10349,10 @@ function openpgp_packet_keymaterial() { /** * This function reads the payload of a public key sub packet (Tag 14) * and initializes the openpgp_packet_keymaterial - * @param input input string to read the packet from - * @param position start position for the parser - * @param len length of the packet or remaining length of input - * @return openpgp_packet_keymaterial object + * @param {String} input Input string to read the packet from + * @param {Integer} position Start position for the parser + * @param {Integer} len Length of the packet or remaining length of input + * @return {openpgp_packet_keymaterial} */ function read_tag14(input, position, len) { this.subKeySignature = null; @@ -10324,12 +10364,13 @@ function openpgp_packet_keymaterial() { } /** - * Internal Parser for public keys as specified in RFC 4880 section 5.5.2 Public-Key Packet Formats + * Internal Parser for public keys as specified in RFC 4880 section + * 5.5.2 Public-Key Packet Formats * called by read_tag<num> - * @param input input string to read the packet from - * @param position start position for the parser - * @param len length of the packet or remaining length of input - * @return this object with attributes set by the parser + * @param {String} input Input string to read the packet from + * @param {Integer} position Start position for the parser + * @param {Integer} len Length of the packet or remaining length of input + * @return {Object} This object with attributes set by the parser */ function read_pub_key(input, position, len) { var mypos = position; @@ -10436,10 +10477,10 @@ function openpgp_packet_keymaterial() { /** * Internal parser for private keys as specified in RFC 4880 section 5.5.3 - * @param input input string to read the packet from - * @param position start position for the parser - * @param len length of the packet or remaining length of input - * @return this object with attributes set by the parser + * @param {String} input Input string to read the packet from + * @param {Integer} position Start position for the parser + * @param {Integer} len Length of the packet or remaining length of input + * @return {Object} This object with attributes set by the parser */ function read_priv_key(input,position, len) { // - A Public-Key or Public-Subkey packet, as described above. @@ -10572,11 +10613,13 @@ function openpgp_packet_keymaterial() { /** * Decrypts the private key MPIs which are needed to use the key. - * openpgp_packet_keymaterial.hasUnencryptedSecretKeyData should be false otherwise + * openpgp_packet_keymaterial.hasUnencryptedSecretKeyData should be + * false otherwise * a call to this function is not needed * - * @param str_passphrase the passphrase for this private key as string - * @return true if the passphrase was correct; false if not + * @param {String} str_passphrase The passphrase for this private key + * as string + * @return {Boolean} True if the passphrase was correct; false if not */ function decryptSecretMPIs(str_passphrase) { if (this.hasUnencryptedSecretKeyData) @@ -10759,11 +10802,11 @@ function openpgp_packet_keymaterial() { /** * Continue parsing packets belonging to the key material such as signatures - * @param {openpgp_*} parent_node the parent object - * @param {String} input input string to read the packet(s) from - * @param {integer} position start position for the parser - * @param {integer} len length of the packet(s) or remaining length of input - * @return {integer} length of nodes read + * @param {Object} parent_node The parent object + * @param {String} input Input string to read the packet(s) from + * @param {Integer} position Start position for the parser + * @param {Integer} len Length of the packet(s) or remaining length of input + * @return {Integer} Length of nodes read */ function read_nodes(parent_node, input, position, len) { this.parentNode = parent_node; @@ -10840,7 +10883,7 @@ function openpgp_packet_keymaterial() { /** * Checks the validity for usage of this (sub)key - * @return 0 = bad key, 1 = expired, 2 = revoked, 3 = valid + * @return {Integer} 0 = bad key, 1 = expired, 2 = revoked, 3 = valid */ function verifyKey() { if (this.tagType == 14) { @@ -10868,8 +10911,8 @@ function openpgp_packet_keymaterial() { } /** - * calculates the key id of they key - * @return {String} a 8 byte key id + * Calculates the key id of they key + * @return {String} A 8 byte key id */ function getKeyId() { if (this.version == 4) { @@ -10883,8 +10926,8 @@ function openpgp_packet_keymaterial() { } /** - * calculates the fingerprint of the key - * @return {String} a string containing the fingerprint + * Calculates the fingerprint of the key + * @return {String} A string containing the fingerprint */ function getFingerprint() { if (this.version == 4) { @@ -10898,14 +10941,17 @@ function openpgp_packet_keymaterial() { } /* - * creates an OpenPGP key packet for the given key. much TODO in regards to s2k, subkeys. - * @param {int} keyType follows the OpenPGP algorithm standard, IE 1 corresponds to RSA. + * Creates an OpenPGP key packet for the given key. much + * TODO in regards to s2k, subkeys. + * @param {Integer} keyType Follows the OpenPGP algorithm standard, + * IE 1 corresponds to RSA. * @param {RSA.keyObject} key * @param password * @param s2kHash * @param symmetricEncryptionAlgorithm * @param timePacket - * @return {body: [string]OpenPGP packet body contents, header: [string] OpenPGP packet header, string: [string] header+body} + * @return {Object} {body: [string]OpenPGP packet body contents, + header: [string] OpenPGP packet header, string: [string] header+body} */ function write_private_key(keyType, key, password, s2kHash, symmetricEncryptionAlgorithm, timePacket){ this.symmetricEncryptionAlgorithm = symmetricEncryptionAlgorithm; @@ -10979,11 +11025,14 @@ function openpgp_packet_keymaterial() { } /* - * same as write_private_key, but has less information because of public key. - * @param {int} keyType follows the OpenPGP algorithm standard, IE 1 corresponds to RSA. + * Same as write_private_key, but has less information because of + * public key. + * @param {Integer} keyType Follows the OpenPGP algorithm standard, + * IE 1 corresponds to RSA. * @param {RSA.keyObject} key * @param timePacket - * @return {body: [string]OpenPGP packet body contents, header: [string] OpenPGP packet header, string: [string] header+body} + * @return {Object} {body: [string]OpenPGP packet body contents, + * header: [string] OpenPGP packet header, string: [string] header+body} */ function write_public_key(keyType, key, timePacket){ var tag = 6; @@ -11046,13 +11095,13 @@ function openpgp_packet_literaldata() { this.tagType = 11; /** - * parsing function for a literal data packet (tag 11). + * Parsing function for a literal data packet (tag 11). * - * @param {string} input payload of a tag 11 packet - * @param {integer} position - * position to start reading from the input string - * @param {integer} len - * length of the packet or the remaining length of + * @param {String} input Payload of a tag 11 packet + * @param {Integer} position + * Position to start reading from the input string + * @param {Integer} len + * Length of the packet or the remaining length of * input at position * @return {openpgp_packet_encrypteddata} object representation */ @@ -11073,7 +11122,7 @@ function openpgp_packet_literaldata() { /** * Creates a string representation of the packet * - * @param {String} data the data to be inserted as body + * @param {String} data The data to be inserted as body * @return {String} string-representation of the packet */ function write_packet(data) { @@ -11100,9 +11149,9 @@ function openpgp_packet_literaldata() { } /** - * generates debug output (pretty print) + * Generates debug output (pretty print) * - * @return {string} String which gives some information about the keymaterial + * @return {String} String which gives some information about the keymaterial */ function toString() { return '5.9. Literal Data Packet (Tag 11)\n' + ' length: ' @@ -11147,15 +11196,15 @@ function openpgp_packet_literaldata() { function openpgp_packet_marker() { this.tagType = 10; /** - * parsing function for a literal data packet (tag 10). + * Parsing function for a literal data packet (tag 10). * - * @param {string} input payload of a tag 10 packet - * @param {integer} position - * position to start reading from the input string - * @param {integer} len - * length of the packet or the remaining length of + * @param {String} input Payload of a tag 10 packet + * @param {Integer} position + * Position to start reading from the input string + * @param {Integer} len + * Length of the packet or the remaining length of * input at position - * @return {openpgp_packet_encrypteddata} object representation + * @return {openpgp_packet_encrypteddata} Object representation */ function read_packet(input, position, len) { this.packetLength = 3; @@ -11170,7 +11219,8 @@ function openpgp_packet_marker() { /** * Generates Debug output * - * @return {string} String which gives some information about the keymaterial + * @return {String} String which gives some information about the + * keymaterial */ function toString() { return "5.8. Marker Packet (Obsolete Literal Packet) (Tag 10)\n" @@ -11249,8 +11299,8 @@ function openpgp_packet_modificationdetectioncode() { /** * generates debug output (pretty print) * - * @return {string} String which gives some information about the modification - * detection code + * @return {String} String which gives some information about the + * modification detection code */ function toString() { return '5.14 Modification detection code packet\n' + ' bytes (' @@ -11298,9 +11348,9 @@ function openpgp_packet_onepasssignature() { /** * parsing function for a one-pass signature packet (tag 4). - * @param {string} input payload of a tag 4 packet - * @param {integer} position position to start reading from the input string - * @param {integer} len length of the packet or the remaining length of input at position + * @param {String} input payload of a tag 4 packet + * @param {Integer} position position to start reading from the input string + * @param {Integer} len length of the packet or the remaining length of input at position * @return {openpgp_packet_encrypteddata} object representation */ function read_packet(input, position, len) { @@ -11333,10 +11383,10 @@ function openpgp_packet_onepasssignature() { /** * creates a string representation of a one-pass signature packet - * @param {integer} type Signature types as described in RFC4880 Section 5.2.1. - * @param {integer} hashalgorithm the hash algorithm used within the signature + * @param {Integer} type Signature types as described in RFC4880 Section 5.2.1. + * @param {Integer} hashalgorithm the hash algorithm used within the signature * @param {openpgp_msg_privatekey} privatekey the private key used to generate the signature - * @param {integer} length length of data to be signed + * @param {Integer} length length of data to be signed * @param {boolean} nested boolean showing whether the signature is nested. * "true" indicates that the next packet is another One-Pass Signature packet * that describes another signature to be applied to the same message data. @@ -11361,7 +11411,7 @@ function openpgp_packet_onepasssignature() { /** * generates debug output (pretty print) - * @return {string} String which gives some information about the one-pass signature packet + * @return {String} String which gives some information about the one-pass signature packet */ function toString() { return '5.4. One-Pass Signature Packets (Tag 4)\n'+ @@ -11450,9 +11500,9 @@ function openpgp_packet_signature() { /** * parsing function for a signature packet (tag 2). - * @param {string} input payload of a tag 2 packet - * @param {integer} position position to start reading from the input string - * @param {integer} len length of the packet or the remaining length of input at position + * @param {String} input payload of a tag 2 packet + * @param {Integer} position position to start reading from the input string + * @param {Integer} len length of the packet or the remaining length of input at position * @return {openpgp_packet_encrypteddata} object representation */ function read_packet(input, position, len) { @@ -11590,10 +11640,10 @@ function openpgp_packet_signature() { /** * creates a string representation of a message signature packet (tag 2). * This can be only used on text data - * @param {integer} signature_type should be 1 (one) + * @param {Integer} signature_type should be 1 (one) * @param {String} data data to be signed * @param {openpgp_msg_privatekey} privatekey private key used to sign the message. (secMPIs MUST be unlocked) - * @return {string} string representation of a signature packet + * @return {String} string representation of a signature packet */ function write_message_signature(signature_type, data, privatekey) { var publickey = privatekey.privateKeyPacket.publicKey; @@ -11636,7 +11686,7 @@ function openpgp_packet_signature() { } /** * creates a string representation of a sub signature packet (See RFC 4880 5.2.3.1) - * @param {integer} type subpacket signature type. Signature types as described in RFC4880 Section 5.2.3.2 + * @param {Integer} type subpacket signature type. Signature types as described in RFC4880 Section 5.2.3.2 * @param {String} data data to be included * @return {String} a string-representation of a sub signature packet (See RFC 4880 5.2.3.1) */ @@ -12016,7 +12066,7 @@ function openpgp_packet_signature() { } /** * generates debug output (pretty print) - * @return {string} String which gives some information about the signature packet + * @return {String} String which gives some information about the signature packet */ function toString () { @@ -12087,7 +12137,7 @@ function openpgp_packet_signature() { /** * Tries to get the corresponding public key out of the public keyring for the issuer created this signature - * @return {obj: [openpgp_msg_publickey], text: [String]} if found the public key will be returned. null otherwise + * @return {Object} {obj: [openpgp_msg_publickey], text: [String]} if found the public key will be returned. null otherwise */ function getIssuerKey() { var result = null; @@ -12150,9 +12200,9 @@ function openpgp_packet_userattribute() { /** * parsing function for a user attribute packet (tag 17). - * @param {string} input payload of a tag 17 packet - * @param {integer} position position to start reading from the input string - * @param {integer} len length of the packet or the remaining length of input at position + * @param {String} input payload of a tag 17 packet + * @param {Integer} position position to start reading from the input string + * @param {Integer} len length of the packet or the remaining length of input at position * @return {openpgp_packet_encrypteddata} object representation */ function read_packet (input, position, len) { @@ -12198,7 +12248,7 @@ function openpgp_packet_userattribute() { /** * generates debug output (pretty print) - * @return {string} String which gives some information about the user attribute packet + * @return {String} String which gives some information about the user attribute packet */ function toString() { var result = '5.12. User Attribute Packet (Tag 17)\n'+ @@ -12211,11 +12261,11 @@ function openpgp_packet_userattribute() { /** * Continue parsing packets belonging to the user attribute packet such as signatures - * @param {openpgp_*} parent_node the parent object + * @param {Object} parent_node the parent object * @param {String} input input string to read the packet(s) from - * @param {integer} position start position for the parser - * @param {integer} len length of the packet(s) or remaining length of input - * @return {integer} length of nodes read + * @param {Integer} position start position for the parser + * @param {Integer} len length of the packet(s) or remaining length of input + * @return {Integer} length of nodes read */ function read_nodes(parent_node, input, position, len) { @@ -12298,9 +12348,9 @@ function openpgp_packet_userid() { /** * parsing function for a user id packet (tag 13). - * @param {string} input payload of a tag 13 packet - * @param {integer} position position to start reading from the input string - * @param {integer} len length of the packet or the remaining length of input at position + * @param {String} input payload of a tag 13 packet + * @param {Integer} position position to start reading from the input string + * @param {Integer} len length of the packet or the remaining length of input at position * @return {openpgp_packet_encrypteddata} object representation */ function read_packet(input, position, len) { @@ -12327,11 +12377,11 @@ function openpgp_packet_userid() { /** * Continue parsing packets belonging to the userid packet such as signatures - * @param {openpgp_*} parent_node the parent object + * @param {Object} parent_node the parent object * @param {String} input input string to read the packet(s) from - * @param {integer} position start position for the parser - * @param {integer} len length of the packet(s) or remaining length of input - * @return {integer} length of nodes read + * @param {Integer} position start position for the parser + * @param {Integer} len length of the packet(s) or remaining length of input + * @return {Integer} length of nodes read */ function read_nodes(parent_node, input, position, len) { if (parent_node.tagType == 6) { // public key @@ -12411,7 +12461,7 @@ function openpgp_packet_userid() { /** * generates debug output (pretty print) - * @return {string} String which gives some information about the user id packet + * @return {String} String which gives some information about the user id packet */ function toString() { var result = ' 5.11. User ID Packet (Tag 13)\n' + ' text (' @@ -12430,7 +12480,7 @@ function openpgp_packet_userid() { /** * lookup function to find certification revocation signatures - * @param {string} keyId string containing the key id of the issuer of this signature + * @param {String} keyId string containing the key id of the issuer of this signature * @return a CertificationRevocationSignature if found; otherwise null */ function hasCertificationRevocationSignature(keyId) { @@ -12446,8 +12496,8 @@ function openpgp_packet_userid() { /** * Verifies all certification signatures. This method does not consider possible revocation signatures. - * @param publicKeyPacket the top level key material - * @return an array of integers corresponding to the array of certification signatures. The meaning of each integer is the following: + * @param {Object} publicKeyPacket the top level key material + * @return {Integer[]} An array of integers corresponding to the array of certification signatures. The meaning of each integer is the following: * 0 = bad signature * 1 = signature expired * 2 = issuer key not available @@ -12625,10 +12675,11 @@ function openpgp_packet_userid() { */ function openpgp_type_keyid() { /** - * parsing method for a key id - * @param {String} input input to read the key id from - * @param {integer} position position where to start reading the key id from input - * @return this object + * Parsing method for a key id + * @param {String} input Input to read the key id from + * @param {integer} position Position where to start reading the key + * id from input + * @return {openpgp_type_keyid} This object */ function read_packet(input, position) { this.bytes = input.substring(position, position+8); @@ -12636,7 +12687,7 @@ function openpgp_type_keyid() { } /** - * generates debug output (pretty print) + * Generates debug output (pretty print) * @return {String} Key Id as hexadecimal string */ function toString() { @@ -12684,11 +12735,13 @@ function openpgp_type_mpi() { this.mpiByteLength = null; this.data = null; /** - * parsing function for a mpi (RFC 4880 3.2). - * @param {string} input payload of mpi data - * @param {integer} position position to start reading from the input string - * @param {integer} len length of the packet or the remaining length of input at position - * @return {openpgp_type_mpi} object representation + * Parsing function for a mpi (RFC 4880 3.2). + * @param {String} input Payload of mpi data + * @param {Integer} position Position to start reading from the input + * string + * @param {Integer} len Length of the packet or the remaining length of + * input at position + * @return {openpgp_type_mpi} Object representation */ function read(input, position, len) { var mypos = position; @@ -12716,8 +12769,8 @@ function openpgp_type_mpi() { } /** - * generates debug output (pretty print) - * @return {string} String which gives some information about the mpi + * Generates debug output (pretty print) + * @return {String} String which gives some information about the mpi */ function toString() { var r = " MPI("+this.mpiBitLength+"b/"+this.mpiByteLength+"B) : 0x"; @@ -12726,7 +12779,7 @@ function openpgp_type_mpi() { } /** - * converts the mpi to an BigInteger object + * Converts the mpi to an BigInteger object * @return {BigInteger} */ function getBigInteger() { @@ -12741,16 +12794,16 @@ function openpgp_type_mpi() { } /** - * gets the length of the mpi in bytes - * @return {integer} mpi byte length + * Gets the length of the mpi in bytes + * @return {Integer} Mpi byte length */ function getByteLength() { return this.mpiByteLength; } /** - * creates an mpi from the specified string - * @param {String} data data to read the mpi from + * Creates an mpi from the specified string + * @param {String} data Data to read the mpi from * @return {openpgp_type_mpi} */ function create(data) { @@ -12761,8 +12814,8 @@ function openpgp_type_mpi() { } /** - * converts the mpi object to a string as specified in RFC4880 3.2 - * @return {String} mpi byte representation + * Converts the mpi object to a string as specified in RFC4880 3.2 + * @return {String} mpi Byte representation */ function toBin() { var result = String.fromCharCode((this.mpiBitLength >> 8) & 0xFF); @@ -12807,10 +12860,10 @@ function openpgp_type_mpi() { */ function openpgp_type_s2k() { /** - * parsing function for a string-to-key specifier (RFC 4880 3.7). - * @param {string} input payload of string-to-key specifier - * @param {integer} position position to start reading from the input string - * @return {openpgp_type_s2k} object representation + * Parsing function for a string-to-key specifier (RFC 4880 3.7). + * @param {String} input Payload of string-to-key specifier + * @param {Integer} position Position to start reading from the input string + * @return {openpgp_type_s2k} Object representation */ function read(input, position) { var mypos = position; @@ -12875,7 +12928,7 @@ function openpgp_type_s2k() { /** * writes an s2k hash based on the inputs. - * @return {String} produced key of hashAlgorithm hash length + * @return {String} Produced key of hashAlgorithm hash length */ function write(type, hash, passphrase, salt, c){ this.type = type; @@ -12888,9 +12941,11 @@ function openpgp_type_s2k() { } /** - * produces a key using the specified passphrase and the defined hashAlgorithm - * @param passphrase {String} passphrase containing user input - * @return {String} produced key with a length corresponding to hashAlgorithm hash length + * Produces a key using the specified passphrase and the defined + * hashAlgorithm + * @param {String} passphrase Passphrase containing user input + * @return {String} Produced key with a length corresponding to + * hashAlgorithm hash length */ function produce_key(passphrase, numBytes) { if (this.type == 0) { @@ -12956,9 +13011,9 @@ var Util = function() { }; /** - * create hexstring from a binary - * @param str [String] string to convert - * @return [String] string containing the hexadecimal values + * Create hexstring from a binary + * @param {String} str String to convert + * @return {String} String containing the hexadecimal values */ this.hexstrdump = function(str) { if (str == null) @@ -12976,9 +13031,9 @@ var Util = function() { }; /** - * create binary string from a hex encoded string - * @param str [String] hex string to convert - * @return [String] string containing the binary values + * Create binary string from a hex encoded string + * @param {String} str Hex string to convert + * @return {String} String containing the binary values */ this.hex2bin = function(hex) { var str = ''; @@ -12988,9 +13043,9 @@ var Util = function() { }; /** - * creating a hex string from an binary array of integers (0..255) - * @param [Array[integer 0..255]] array to convert - * @return [String] hexadecimal representation of the array + * Creating a hex string from an binary array of integers (0..255) + * @param {String} str Array of bytes to convert + * @return {String} Hexadecimal representation of the array */ this.hexidump = function(str) { var r=[]; @@ -13006,9 +13061,9 @@ var Util = function() { }; /** - * convert a string to an array of integers(0.255) - * @param [String] string to convert - * @return [Array [Integer 0..255]] array of (binary) integers + * Convert a string to an array of integers(0.255) + * @param {String} str String to convert + * @return {Integer[]} An array of (binary) integers */ this.str2bin = function(str) { var result = new Array(); @@ -13020,9 +13075,9 @@ var Util = function() { }; /** - * convert an array of integers(0.255) to a string - * @param [Array [Integer 0..255]] array of (binary) integers to convert - * @return [String] string representation of the array + * Convert an array of integers(0.255) to a string + * @param {Integer[]} bin An array of (binary) integers to convert + * @return {String} The string representation of the array */ this.bin2str = function(bin) { var result = []; @@ -13033,9 +13088,9 @@ var Util = function() { }; /** - * convert a string to a Uint8Array - * @param [String] string to convert - * @return [Uint8Array] array of (binary) integers + * Convert a string to a Uint8Array + * @param {String} str String to convert + * @return {Uint8Array} The array of (binary) integers */ this.str2Uint8Array = function(str){ var uintArray = new Uint8Array(new ArrayBuffer(str.length)); @@ -13046,9 +13101,10 @@ var Util = function() { }; /** - * convert a Uint8Array to a string. This currently functions the same as bin2str. - * @param [Uint8Array] array of (binary) integers to convert - * @return [String] string representation of the array + * Convert a Uint8Array to a string. This currently functions + * the same as bin2str. + * @param {Uint8Array} bin An array of (binary) integers to convert + * @return {String} String representation of the array */ this.Uint8Array2str = function(bin) { var result = []; @@ -13059,9 +13115,11 @@ var Util = function() { }; /** - * calculates a 16bit sum of a string by adding each character codes modulus 65535 - * @param text [String] string to create a sum of - * @return [Integer] an integer containing the sum of all character codes % 65535 + * Calculates a 16bit sum of a string by adding each character + * codes modulus 65535 + * @param {String} text String to create a sum of + * @return {Integer} An integer containing the sum of all character + * codes % 65535 */ this.calc_checksum = function(text) { var checksum = { s: 0, add: function (sadd) { this.s = (this.s + sadd) % 65536; }}; @@ -13078,8 +13136,9 @@ var Util = function() { * Javascript context MUST define * a "showMessages(text)" function. Line feeds ('\n') * are automatically converted to HTML line feeds '
' - * @param str [String] string of the debug message - * @return [String] an HTML tt entity containing a paragraph with a style attribute where the debug message is HTMLencoded in. + * @param {String} str String of the debug message + * @return {String} An HTML tt entity containing a paragraph with a + * style attribute where the debug message is HTMLencoded in. */ this.print_debug = function(str) { if (openpgp.config.debug) { @@ -13096,8 +13155,9 @@ var Util = function() { * a "showMessages(text)" function. Line feeds ('\n') * are automatically converted to HTML line feeds '
' * Different than print_debug because will call hexstrdump iff necessary. - * @param str [String] string of the debug message - * @return [String] an HTML tt entity containing a paragraph with a style attribute where the debug message is HTMLencoded in. + * @param {String} str String of the debug message + * @return {String} An HTML tt entity containing a paragraph with a + * style attribute where the debug message is HTMLencoded in. */ this.print_debug_hexstr_dump = function(str,strToHex) { if (openpgp.config.debug) { @@ -13112,8 +13172,9 @@ var Util = function() { * The calling Javascript context MUST define * a "showMessages(text)" function. Line feeds ('\n') * are automatically converted to HTML line feeds '
' - * @param str [String] string of the error message - * @return [String] a HTML paragraph entity with a style attribute containing the HTML encoded error message + * @param {String} str String of the error message + * @return {String} A HTML paragraph entity with a style attribute + * containing the HTML encoded error message */ this.print_error = function(str) { str = openpgp_encoding_html_encode(str); @@ -13125,8 +13186,9 @@ var Util = function() { * The calling Javascript context MUST define * a "showMessages(text)" function. Line feeds ('\n') * are automatically converted to HTML line feeds '
'. - * @param str [String] string of the info message - * @return [String] a HTML paragraph entity with a style attribute containing the HTML encoded info message + * @param {String} str String of the info message + * @return {String} A HTML paragraph entity with a style attribute + * containing the HTML encoded info message */ this.print_info = function(str) { str = openpgp_encoding_html_encode(str); @@ -13146,11 +13208,13 @@ var Util = function() { var result = string.substring(0, bytes); return this.shiftRight(result, 8-rest); // +String.fromCharCode(string.charCodeAt(bytes -1) << (8-rest) & 0xFF); }; + /** * Shifting a string to n bits right - * @param value [String] the string to shift - * @param bitcount [Integer] amount of bits to shift (MUST be smaller than 9) - * @return [String] resulting string. + * @param {String} value The string to shift + * @param {Integer} bitcount Amount of bits to shift (MUST be smaller + * than 9) + * @return {String} Resulting string. */ this.shiftRight = function(value, bitcount) { var temp = util.str2bin(value); @@ -13168,7 +13232,7 @@ var Util = function() { /** * Return the algorithm type as string - * @return [String] String representing the message type + * @return {String} String representing the message type */ this.get_hashAlgorithmString = function(algo) { switch(algo) { diff --git a/resources/openpgp.min.js b/resources/openpgp.min.js index 32c6ab37..8402d094 100644 --- a/resources/openpgp.min.js +++ b/resources/openpgp.min.js @@ -2,29 +2,7 @@ function DSA(){this.select_hash_algorithm=function(b){var a=openpgp.config.confi e.subtract(BigInteger.ONE));c=c.modPow(a,d).mod(e);e=a.modInverse(e).multiply(b.add(f.multiply(c))).mod(e);f=[];f[0]=c.toMPI();f[1]=e.toMPI();return f};this.verify=function(b,a,c,d,e,f,g,h){b=util.getLeftNBits(openpgp_crypto_hashData(b,d),f.bitLength());b=new BigInteger(util.hexstrdump(b),16);if(0>15;0<=--f;){var h=this[b]&32767,j=this[b++]>>15,k=a*h+j*g,h=g*h+((k&32767)<<15)+c[d]+(e&1073741823),e=(h>>>30)+(k>>>15)+a*j+(e>>>30);c[d++]=h&1073741823}return e}function am3(b,a,c,d,e,f){for(var g=a&16383,a=a>>14;0<=--f;){var h=this[b]&16383,j=this[b++]>>14,k=a*h+j*g,h=g*h+((k&16383)<<14)+c[d]+e,e=(h>>28)+(k>>14)+a*j;c[d++]=h&268435455}return e} -j_lm&&"Microsoft Internet Explorer"==navigator.appName?(BigInteger.prototype.am=am2,dbits=30):j_lm&&"Netscape"!=navigator.appName?(BigInteger.prototype.am=am1,dbits=26):(BigInteger.prototype.am=am3,dbits=28);BigInteger.prototype.DB=dbits;BigInteger.prototype.DM=(1<=vv;++vv)BI_RC[rr++]=vv;rr=97;for(vv=10;36>vv;++vv)BI_RC[rr++]=vv;rr=65;for(vv=10;36>vv;++vv)BI_RC[rr++]=vv;function int2char(b){return BI_RM.charAt(b)}function intAt(b,a){var c=BI_RC[b.charCodeAt(a)];return null==c?-1:c}function bnpCopyTo(b){for(var a=this.t-1;0<=a;--a)b[a]=this[a];b.t=this.t;b.s=this.s}function bnpFromInt(b){this.t=1;this.s=0>b?-1:0;0b?this[0]=b+DV:this.t=0}function nbv(b){var a=nbi();a.fromInt(b);return a} -function bnpFromString(b,a){var c;if(16==a)c=4;else if(8==a)c=3;else if(256==a)c=8;else if(2==a)c=1;else if(32==a)c=5;else if(4==a)c=2;else{this.fromRadix(b,a);return}this.s=this.t=0;for(var d=b.length,e=!1,f=0;0<=--d;){var g=8==c?b[d]&255:intAt(b,d);0>g?"-"==b.charAt(d)&&(e=!0):(e=!1,0==f?this[this.t++]=g:f+c>this.DB?(this[this.t-1]|=(g&(1<>this.DB-f):this[this.t-1]|=g<=this.DB&&(f-=this.DB))}if(8==c&&0!=(b[0]&128))this.s=-1,0this.s)return"-"+this.negate().toString(b);if(16==b)b=4;else if(8==b)b=3;else if(2==b)b=1;else if(32==b)b=5;else if(4==b)b=2;else return this.toRadix(b);var a=(1<>g))d=!0,e=int2char(c);for(;0<=f;)g>(g+=this.DB-b)):(c=this[f]>>(g-=b)&a,0>=g&&(g+=this.DB,--f)),0this.s?this.negate():this}function bnCompareTo(b){var a=this.s-b.s;if(0!=a)return a;var c=this.t,a=c-b.t;if(0!=a)return a;for(;0<=--c;)if(0!=(a=this[c]-b[c]))return a;return 0}function nbits(b){var a=1,c;if(0!=(c=b>>>16))b=c,a+=16;if(0!=(c=b>>8))b=c,a+=8;if(0!=(c=b>>4))b=c,a+=4;if(0!=(c=b>>2))b=c,a+=2;0!=b>>1&&(a+=1);return a} -function bnBitLength(){return 0>=this.t?0:this.DB*(this.t-1)+nbits(this[this.t-1]^this.s&this.DM)}function bnpDLShiftTo(b,a){var c;for(c=this.t-1;0<=c;--c)a[c+b]=this[c];for(c=b-1;0<=c;--c)a[c]=0;a.t=this.t+b;a.s=this.s}function bnpDRShiftTo(b,a){for(var c=b;c>d|g,g=(this[h]&e)<=this.t)a.t=0;else{var d=b%this.DB,e=this.DB-d,f=(1<>d;for(var g=c+1;g>d;0>=this.DB;if(b.t>=this.DB;d+=this.s}else{for(d+=this.s;c>=this.DB;d-=b.s}a.s=0>d?-1:0;-1>d?a[c++]=this.DV+d:0=a.DV)b[c+a.t]-=a.DV,b[c+a.t+1]=1}0=d.t)){var e=this.abs();if(e.t>this.F2:0),k=this.FV/j,j=(1<g&&BigInteger.ZERO.subTo(c,c)}}}}function bnMod(b){var a=nbi();this.abs().divRemTo(b,null,a);0>this.s&&0b.s||0<=b.compareTo(this.m)?b.mod(this.m):b}function cRevert(b){return b}function cReduce(b){b.divRemTo(this.m,null,b)}function cMulTo(b,a,c){b.multiplyTo(a,c);this.reduce(c)}function cSqrTo(b,a){b.squareTo(a);this.reduce(a)}Classic.prototype.convert=cConvert;Classic.prototype.revert=cRevert;Classic.prototype.reduce=cReduce;Classic.prototype.mulTo=cMulTo;Classic.prototype.sqrTo=cSqrTo; -function bnpInvDigit(){if(1>this.t)return 0;var b=this[0];if(0==(b&1))return 0;var a=b&3,a=a*(2-(b&15)*a)&15,a=a*(2-(b&255)*a)&255,a=a*(2-((b&65535)*a&65535))&65535,a=a*(2-b*a%this.DV)%this.DV;return 0>15;this.um=(1<b.s&&0>15)*this.mpl&this.um)<<15)&b.DM,c=a+this.m.t;for(b[c]+=this.m.am(0,d,b,a,0,this.m.t);b[c]>=b.DV;)b[c]-=b.DV,b[++c]++}b.clamp();b.drShiftTo(this.m.t,b);0<=b.compareTo(this.m)&&b.subTo(this.m,b)}function montSqrTo(b,a){b.squareTo(a);this.reduce(a)}function montMulTo(b,a,c){b.multiplyTo(a,c);this.reduce(c)}Montgomery.prototype.convert=montConvert; -Montgomery.prototype.revert=montRevert;Montgomery.prototype.reduce=montReduce;Montgomery.prototype.mulTo=montMulTo;Montgomery.prototype.sqrTo=montSqrTo;function bnpIsEven(){return 0==(0b)return BigInteger.ONE;var c=nbi(),d=nbi(),e=a.convert(this),f=nbits(b)-1;for(e.copyTo(c);0<=--f;)if(a.sqrTo(c,d),0<(b&1<b||a.isEven()?new Classic(a):new Montgomery(a);return this.exp(b,c)}BigInteger.prototype.copyTo=bnpCopyTo;BigInteger.prototype.fromInt=bnpFromInt;BigInteger.prototype.fromString=bnpFromString;BigInteger.prototype.clamp=bnpClamp;BigInteger.prototype.dlShiftTo=bnpDLShiftTo;BigInteger.prototype.drShiftTo=bnpDRShiftTo;BigInteger.prototype.lShiftTo=bnpLShiftTo;BigInteger.prototype.rShiftTo=bnpRShiftTo;BigInteger.prototype.subTo=bnpSubTo; -BigInteger.prototype.multiplyTo=bnpMultiplyTo;BigInteger.prototype.squareTo=bnpSquareTo;BigInteger.prototype.divRemTo=bnpDivRemTo;BigInteger.prototype.invDigit=bnpInvDigit;BigInteger.prototype.isEven=bnpIsEven;BigInteger.prototype.exp=bnpExp;BigInteger.prototype.toString=bnToString;BigInteger.prototype.negate=bnNegate;BigInteger.prototype.abs=bnAbs;BigInteger.prototype.compareTo=bnCompareTo;BigInteger.prototype.bitLength=bnBitLength;BigInteger.prototype.mod=bnMod;BigInteger.prototype.modPowInt=bnModPowInt; -BigInteger.ZERO=nbv(0);BigInteger.ONE=nbv(1);function bnClone(){var b=nbi();this.copyTo(b);return b}function bnIntValue(){if(0>this.s){if(1==this.t)return this[0]-this.DV;if(0==this.t)return-1}else{if(1==this.t)return this[0];if(0==this.t)return 0}return(this[1]&(1<<32-this.DB)-1)<>24}function bnShortValue(){return 0==this.t?this.s:this[0]<<16>>16}function bnpChunkSize(b){return Math.floor(Math.LN2*this.DB/Math.log(b))} +c).modInverse(c).multiply(a).mod(c)}}function bnClone(){var b=nbi();this.copyTo(b);return b}function bnIntValue(){if(0>this.s){if(1==this.t)return this[0]-this.DV;if(0==this.t)return-1}else{if(1==this.t)return this[0];if(0==this.t)return 0}return(this[1]&(1<<32-this.DB)-1)<>24}function bnShortValue(){return 0==this.t?this.s:this[0]<<16>>16}function bnpChunkSize(b){return Math.floor(Math.LN2*this.DB/Math.log(b))} function bnSigNum(){return 0>this.s?-1:0>=this.t||1==this.t&&0>=this[0]?0:1}function bnpToRadix(b){null==b&&(b=10);if(0==this.signum()||2>b||36j?"-"==b.charAt(h)&&0==this.signum()&&(e=!0):(g=a*g+j,++f>=c&&(this.dMultiply(d),this.dAddOffset(g,0),g=f=0))}0b)this.fromInt(1);else{this.fromNumber(b,c);this.testBit(b-1)||this.bitwiseTo(BigInteger.ONE.shiftLeft(b-1),op_or,this);for(this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(a);)this.dAddOffset(2,0),this.bitLength()>b&&this.subTo(BigInteger.ONE.shiftLeft(b-1),this)}else{var c=[],d=b&7;c.length=(b>>3)+1;a.nextBytes(c);c[0]=0>15;0<=--f;){var h=this[b]&32767,j=this[b++]>>15,k=a*h+j*g,h=g*h+((k&32767)<<15)+c[d]+(e&1073741823),e=(h>>>30)+(k>>>15)+a*j+(e>>>30);c[d++]=h&1073741823}return e}function am3(b,a,c,d,e,f){for(var g=a&16383,a=a>>14;0<=--f;){var h=this[b]&16383,j=this[b++]>>14,k=a*h+j*g,h=g*h+((k&16383)<<14)+c[d]+e,e=(h>>28)+(k>>14)+a*j;c[d++]=h&268435455}return e} +j_lm&&"Microsoft Internet Explorer"==navigator.appName?(BigInteger.prototype.am=am2,dbits=30):j_lm&&"Netscape"!=navigator.appName?(BigInteger.prototype.am=am1,dbits=26):(BigInteger.prototype.am=am3,dbits=28);BigInteger.prototype.DB=dbits;BigInteger.prototype.DM=(1<=vv;++vv)BI_RC[rr++]=vv;rr=97;for(vv=10;36>vv;++vv)BI_RC[rr++]=vv;rr=65;for(vv=10;36>vv;++vv)BI_RC[rr++]=vv;function int2char(b){return BI_RM.charAt(b)}function intAt(b,a){var c=BI_RC[b.charCodeAt(a)];return null==c?-1:c}function bnpCopyTo(b){for(var a=this.t-1;0<=a;--a)b[a]=this[a];b.t=this.t;b.s=this.s}function bnpFromInt(b){this.t=1;this.s=0>b?-1:0;0b?this[0]=b+DV:this.t=0}function nbv(b){var a=nbi();a.fromInt(b);return a} +function bnpFromString(b,a){var c;if(16==a)c=4;else if(8==a)c=3;else if(256==a)c=8;else if(2==a)c=1;else if(32==a)c=5;else if(4==a)c=2;else{this.fromRadix(b,a);return}this.s=this.t=0;for(var d=b.length,e=!1,f=0;0<=--d;){var g=8==c?b[d]&255:intAt(b,d);0>g?"-"==b.charAt(d)&&(e=!0):(e=!1,0==f?this[this.t++]=g:f+c>this.DB?(this[this.t-1]|=(g&(1<>this.DB-f):this[this.t-1]|=g<=this.DB&&(f-=this.DB))}if(8==c&&0!=(b[0]&128))this.s=-1,0this.s)return"-"+this.negate().toString(b);if(16==b)b=4;else if(8==b)b=3;else if(2==b)b=1;else if(32==b)b=5;else if(4==b)b=2;else return this.toRadix(b);var a=(1<>g))d=!0,e=int2char(c);for(;0<=f;)g>(g+=this.DB-b)):(c=this[f]>>(g-=b)&a,0>=g&&(g+=this.DB,--f)),0this.s?this.negate():this}function bnCompareTo(b){var a=this.s-b.s;if(0!=a)return a;var c=this.t,a=c-b.t;if(0!=a)return a;for(;0<=--c;)if(0!=(a=this[c]-b[c]))return a;return 0}function nbits(b){var a=1,c;if(0!=(c=b>>>16))b=c,a+=16;if(0!=(c=b>>8))b=c,a+=8;if(0!=(c=b>>4))b=c,a+=4;if(0!=(c=b>>2))b=c,a+=2;0!=b>>1&&(a+=1);return a} +function bnBitLength(){return 0>=this.t?0:this.DB*(this.t-1)+nbits(this[this.t-1]^this.s&this.DM)}function bnpDLShiftTo(b,a){var c;for(c=this.t-1;0<=c;--c)a[c+b]=this[c];for(c=b-1;0<=c;--c)a[c]=0;a.t=this.t+b;a.s=this.s}function bnpDRShiftTo(b,a){for(var c=b;c>d|g,g=(this[h]&e)<=this.t)a.t=0;else{var d=b%this.DB,e=this.DB-d,f=(1<>d;for(var g=c+1;g>d;0>=this.DB;if(b.t>=this.DB;d+=this.s}else{for(d+=this.s;c>=this.DB;d-=b.s}a.s=0>d?-1:0;-1>d?a[c++]=this.DV+d:0=a.DV)b[c+a.t]-=a.DV,b[c+a.t+1]=1}0=d.t)){var e=this.abs();if(e.t>this.F2:0),k=this.FV/j,j=(1<g&&BigInteger.ZERO.subTo(c,c)}}}}function bnMod(b){var a=nbi();this.abs().divRemTo(b,null,a);0>this.s&&0b.s||0<=b.compareTo(this.m)?b.mod(this.m):b}function cRevert(b){return b}function cReduce(b){b.divRemTo(this.m,null,b)}function cMulTo(b,a,c){b.multiplyTo(a,c);this.reduce(c)}function cSqrTo(b,a){b.squareTo(a);this.reduce(a)}Classic.prototype.convert=cConvert;Classic.prototype.revert=cRevert;Classic.prototype.reduce=cReduce;Classic.prototype.mulTo=cMulTo;Classic.prototype.sqrTo=cSqrTo; +function bnpInvDigit(){if(1>this.t)return 0;var b=this[0];if(0==(b&1))return 0;var a=b&3,a=a*(2-(b&15)*a)&15,a=a*(2-(b&255)*a)&255,a=a*(2-((b&65535)*a&65535))&65535,a=a*(2-b*a%this.DV)%this.DV;return 0>15;this.um=(1<b.s&&0>15)*this.mpl&this.um)<<15)&b.DM,c=a+this.m.t;for(b[c]+=this.m.am(0,d,b,a,0,this.m.t);b[c]>=b.DV;)b[c]-=b.DV,b[++c]++}b.clamp();b.drShiftTo(this.m.t,b);0<=b.compareTo(this.m)&&b.subTo(this.m,b)}function montSqrTo(b,a){b.squareTo(a);this.reduce(a)}function montMulTo(b,a,c){b.multiplyTo(a,c);this.reduce(c)}Montgomery.prototype.convert=montConvert; +Montgomery.prototype.revert=montRevert;Montgomery.prototype.reduce=montReduce;Montgomery.prototype.mulTo=montMulTo;Montgomery.prototype.sqrTo=montSqrTo;function bnpIsEven(){return 0==(0b)return BigInteger.ONE;var c=nbi(),d=nbi(),e=a.convert(this),f=nbits(b)-1;for(e.copyTo(c);0<=--f;)if(a.sqrTo(c,d),0<(b&1<b||a.isEven()?new Classic(a):new Montgomery(a);return this.exp(b,c)}BigInteger.prototype.copyTo=bnpCopyTo;BigInteger.prototype.fromInt=bnpFromInt;BigInteger.prototype.fromString=bnpFromString;BigInteger.prototype.clamp=bnpClamp;BigInteger.prototype.dlShiftTo=bnpDLShiftTo;BigInteger.prototype.drShiftTo=bnpDRShiftTo;BigInteger.prototype.lShiftTo=bnpLShiftTo;BigInteger.prototype.rShiftTo=bnpRShiftTo;BigInteger.prototype.subTo=bnpSubTo; +BigInteger.prototype.multiplyTo=bnpMultiplyTo;BigInteger.prototype.squareTo=bnpSquareTo;BigInteger.prototype.divRemTo=bnpDivRemTo;BigInteger.prototype.invDigit=bnpInvDigit;BigInteger.prototype.isEven=bnpIsEven;BigInteger.prototype.exp=bnpExp;BigInteger.prototype.toString=bnToString;BigInteger.prototype.negate=bnNegate;BigInteger.prototype.abs=bnAbs;BigInteger.prototype.compareTo=bnCompareTo;BigInteger.prototype.bitLength=bnBitLength;BigInteger.prototype.mod=bnMod;BigInteger.prototype.modPowInt=bnModPowInt; +BigInteger.ZERO=nbv(0);BigInteger.ONE=nbv(1);function SecureRandom(){this.nextBytes=function(b){for(var a=0;a>1;d.e=parseInt(c,16);for(d.ee=new BigInteger(c,16);;){for(;!(d.p=new BigInteger(a-f,1,e),0==d.p.subtract(BigInteger.ONE).gcd(d.ee).compareTo(BigInteger.ONE)&&d.p.isProbablePrime(10)););for(;!(d.q=new BigInteger(f,1,e),0==d.q.subtract(BigInteger.ONE).gcd(d.ee).compareTo(BigInteger.ONE)&&d.q.isProbablePrime(10));); if(0>=d.p.compareTo(d.q)){var g=d.p;d.p=d.q;d.q=g}var g=d.p.subtract(BigInteger.ONE),h=d.q.subtract(BigInteger.ONE),j=g.multiply(h);if(0==j.gcd(d.ee).compareTo(BigInteger.ONE)){d.n=d.p.multiply(d.q);d.d=d.ee.modInverse(j);d.dmp1=d.d.mod(g);d.dmq1=d.d.mod(h);d.u=d.p.modInverse(d.q);break}}return d};this.keyObject=b}function MD5(b){b=md5(b);return util.hex2bin(b)} @@ -285,7 +285,7 @@ JXG.Util.asciiCharCodeAt=function(b,a){var c=b.charCodeAt(a);if(255d?(a.push(String.fromCharCode(d)),c++):191d?(e=b.charCodeAt(c+1),a.push(String.fromCharCode((d&31)<<6|e&63)),c+=2):(e=b.charCodeAt(c+1),f=b.charCodeAt(c+2),a.push(String.fromCharCode((d&15)<<12|(e&63)<<6|f&63)),c+=3);return a.join("")}; JXG.Util.genUUID=function(){for(var b="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),a=Array(36),c=0,d,e=0;36>e;e++)8==e||13==e||18==e||23==e?a[e]="-":14==e?a[e]="4":(2>=c&&(c=33554432+16777216*Math.random()|0),d=c&15,c>>=4,a[e]=b[19==e?d&3|8:d]);return a.join("")}; -function openpgp_config(){this.config=null;this.default_config={prefer_hash_algorithm:2,encryption_cipher:9,compression:1,show_version:!0,show_comment:!0,integrity_protect:!0,composition_behavior:0,keyserver:"keyserver.linux.it"};this.versionstring="OpenPGP.js v.1.20130306";this.commentstring="http://openpgpjs.org";this.debug=!1;this.read=function(){var b=JSON.parse(window.localStorage.getItem("config"));null==b?(this.config=this.default_config,this.write()):this.config=b};this.write=function(){window.localStorage.setItem("config", +function openpgp_config(){this.config=null;this.default_config={prefer_hash_algorithm:2,encryption_cipher:9,compression:1,show_version:!0,show_comment:!0,integrity_protect:!0,composition_behavior:0,keyserver:"keyserver.linux.it"};this.versionstring="OpenPGP.js v.1.20130412";this.commentstring="http://openpgpjs.org";this.debug=!1;this.read=function(){var b=JSON.parse(window.localStorage.getItem("config"));null==b?(this.config=this.default_config,this.write()):this.config=b};this.write=function(){window.localStorage.setItem("config", JSON.stringify(this.config))}}var b64s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function s2r(b){var a,c,d,e="",f=0,g=0,h=b.length;for(d=0;d>2&63),a=(c&3)<<4):1==g?(e+=b64s.charAt(a|c>>4&15),a=(c&15)<<2):2==g&&(e+=b64s.charAt(a|c>>6&3),f+=1,0==f%60&&(e+="\n"),e+=b64s.charAt(c&63)),f+=1,0==f%60&&(e+="\n"),g+=1,3==g&&(g=0);0>6-e&255)),e=e+2&7,f=a<http://www.cs.tut.fi/~albert/Dev/gunzip/gunzip.c - * @see http://www.cs.tut.fi/~albert + * {@link http://www.cs.tut.fi/~albert/Dev/gunzip/gunzip.c} + * {@link http://www.cs.tut.fi/~albert} */ JXG.Util = {}; @@ -925,7 +925,7 @@ function skipdir(){ /** * Base64 encoding / decoding -* @see http://www.webtoolkit.info/ +* {@link http://www.webtoolkit.info/} */ JXG.Util.Base64 = { diff --git a/src/config/openpgp.config.js b/src/config/openpgp.config.js index a97188b7..1e655448 100644 --- a/src/config/openpgp.config.js +++ b/src/config/openpgp.config.js @@ -28,10 +28,21 @@ * @classdesc Implementation of the GPG4Browsers config object */ function openpgp_config() { + /** + * The variable with the actual configuration + * @property {Integer} prefer_hash_algorithm + * @property {Integer} encryption_cipher + * @property {Integer} compression + * @property {Boolean} show_version + * @property {Boolean} show_comment + * @property {Boolean} integrity_protect + * @property {Integer} composition_behavior + * @property {String} keyserver + */ this.config = null; /** - * the default config object which is used if no + * The default config object which is used if no * configuration was in place */ this.default_config = { @@ -48,10 +59,9 @@ function openpgp_config() { this.versionstring ="OpenPGP.js VERSION"; this.commentstring ="http://openpgpjs.org"; /** - * reads the config out of the HTML5 local storage + * Reads the config out of the HTML5 local storage * and initializes the object config. * if config is null the default config will be used - * @return [void] */ function read() { var cf = JSON.parse(window.localStorage.getItem("config")); @@ -64,13 +74,12 @@ function openpgp_config() { } /** - * if enabled, debug messages will be printed + * If enabled, debug messages will be printed */ this.debug = false; /** - * writes the config to HTML5 local storage - * @return [void] + * Writes the config to HTML5 local storage */ function write() { window.localStorage.setItem("config",JSON.stringify(this.config)); diff --git a/src/encoding/openpgp.encoding.asciiarmor.js b/src/encoding/openpgp.encoding.asciiarmor.js index 768131f6..40460ba2 100644 --- a/src/encoding/openpgp.encoding.asciiarmor.js +++ b/src/encoding/openpgp.encoding.asciiarmor.js @@ -16,9 +16,11 @@ // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA /** - * DeArmor an OpenPGP armored message; verify the checksum and return the encoded bytes - * @text [String] OpenPGP armored message - * @return either the bytes of the decoded message or an object with attribute "text" containing the message text + * DeArmor an OpenPGP armored message; verify the checksum and return + * the encoded bytes + * @param {String} text OpenPGP armored message + * @returns {(String|Object)} Either the bytes of the decoded message + * or an object with attribute "text" containing the message text * and an attribute "openpgp" containing the bytes. */ function openpgp_encoding_deArmor(text) { @@ -45,8 +47,8 @@ function openpgp_encoding_deArmor(text) { /** * Finds out which Ascii Armoring type is used. This is an internal function - * @param text [String] ascii armored text - * @return 0 = MESSAGE PART n of m + * @param {String} text [String] ascii armored text + * @returns {Integer} 0 = MESSAGE PART n of m * 1 = MESSAGE PART n * 2 = SIGNED MESSAGE * 3 = PGP MESSAGE @@ -102,7 +104,7 @@ function getPGPMessageType(text) { * packet block. * @author Alex * @version 2011-12-16 - * @return The header information + * @returns {String} The header information */ function openpgp_encoding_armor_addheader() { var result = ""; @@ -118,11 +120,11 @@ function openpgp_encoding_armor_addheader() { /** * Armor an OpenPGP binary packet block - * @param messagetype type of the message + * @param {Integer} messagetype type of the message * @param data - * @param partindex - * @param parttotal - * @return {string} Armored text + * @param {Integer} partindex + * @param {Integer} parttotal + * @returns {String} Armored text */ function openpgp_encoding_armor(messagetype, data, partindex, parttotal) { var result = ""; @@ -178,8 +180,8 @@ function openpgp_encoding_armor(messagetype, data, partindex, parttotal) { /** * Calculates a checksum over the given data and returns it base64 encoded - * @param data [String] data to create a CRC-24 checksum for - * @return [String] base64 encoded checksum + * @param {String} data Data to create a CRC-24 checksum for + * @return {String} Base64 encoded checksum */ function getCheckSum(data) { var c = createcrc24(data); @@ -190,10 +192,11 @@ function getCheckSum(data) { } /** - * Calculates the checksum over the given data and compares it with the given base64 encoded checksum - * @param data [String] data to create a CRC-24 checksum for - * @param checksum [String] base64 encoded checksum - * @return true if the given checksum is correct; otherwise false + * Calculates the checksum over the given data and compares it with the + * given base64 encoded checksum + * @param {String} data Data to create a CRC-24 checksum for + * @param {String} checksum Base64 encoded checksum + * @return {Boolean} True if the given checksum is correct; otherwise false */ function verifyCheckSum(data, checksum) { var c = getCheckSum(data); @@ -202,8 +205,8 @@ function verifyCheckSum(data, checksum) { } /** * Internal function to calculate a CRC-24 checksum over a given string (data) - * @param data [String] data to create a CRC-24 checksum for - * @return [Integer] the CRC-24 checksum as number + * @param {String} data Data to create a CRC-24 checksum for + * @return {Integer} The CRC-24 checksum as number */ var crc_table = [ 0x00000000, 0x00864cfb, 0x018ad50d, 0x010c99f6, 0x0393e6e1, 0x0315aa1a, 0x021933ec, 0x029f7f17, 0x07a18139, 0x0727cdc2, 0x062b5434, 0x06ad18cf, 0x043267d8, 0x04b42b23, 0x05b8b2d5, 0x053efe2e, 0x0fc54e89, 0x0f430272, 0x0e4f9b84, 0x0ec9d77f, 0x0c56a868, 0x0cd0e493, 0x0ddc7d65, 0x0d5a319e, 0x0864cfb0, 0x08e2834b, 0x09ee1abd, 0x09685646, 0x0bf72951, 0x0b7165aa, 0x0a7dfc5c, 0x0afbb0a7, 0x1f0cd1e9, 0x1f8a9d12, 0x1e8604e4, 0x1e00481f, 0x1c9f3708, 0x1c197bf3, 0x1d15e205, 0x1d93aefe, 0x18ad50d0, 0x182b1c2b, 0x192785dd, 0x19a1c926, 0x1b3eb631, 0x1bb8faca, 0x1ab4633c, 0x1a322fc7, 0x10c99f60, 0x104fd39b, 0x11434a6d, 0x11c50696, 0x135a7981, 0x13dc357a, 0x12d0ac8c, 0x1256e077, 0x17681e59, 0x17ee52a2, 0x16e2cb54, 0x166487af, 0x14fbf8b8, 0x147db443, 0x15712db5, 0x15f7614e, 0x3e19a3d2, 0x3e9fef29, 0x3f9376df, 0x3f153a24, 0x3d8a4533, 0x3d0c09c8, 0x3c00903e, 0x3c86dcc5, 0x39b822eb, 0x393e6e10, 0x3832f7e6, 0x38b4bb1d, 0x3a2bc40a, 0x3aad88f1, 0x3ba11107, 0x3b275dfc, 0x31dced5b, 0x315aa1a0, diff --git a/src/encoding/openpgp.encoding.js b/src/encoding/openpgp.encoding.js index e68dd3f9..ca61448d 100644 --- a/src/encoding/openpgp.encoding.js +++ b/src/encoding/openpgp.encoding.js @@ -18,8 +18,8 @@ /** * Wrapper function for the base64 codec. * This function encodes a String (message) in base64 (radix-64) - * @param message [String] the message to encode - * @return [String] the base64 encoded data + * @param {String} message The message to encode + * @return {String} The base64 encoded data */ function openpgp_encoding_base64_encode(message) { return s2r(message); @@ -29,8 +29,8 @@ function openpgp_encoding_base64_encode(message) { /** * Wrapper function for the base64 codec. * This function decodes a String(message) in base64 (radix-64) - * @param message [String] base64 encoded data - * @return [String] raw data after decoding + * @param {String} message Base64 encoded data + * @return {String} Raw data after decoding */ function openpgp_encoding_base64_decode(message) { return r2s(message); @@ -38,9 +38,10 @@ function openpgp_encoding_base64_decode(message) { /** * Wrapper function for jquery library. - * This function escapes HTML characters within a string. This is used to prevent XSS. - * @param message [String] message to escape - * @return [String] html encoded string + * This function escapes HTML characters within a string. This is used + * to prevent XSS. + * @param {String} message Message to escape + * @return {String} Html encoded string */ function openpgp_encoding_html_encode(message) { if (message == null) @@ -50,9 +51,9 @@ function openpgp_encoding_html_encode(message) { /** * create a EME-PKCS1-v1_5 padding (See RFC4880 13.1.1) - * @param message [String] message to be padded - * @param length [Integer] length to the resulting message - * @return [String] EME-PKCS1 padded message + * @param {String} message message to be padded + * @param {Integer} length Length to the resulting message + * @return {String} EME-PKCS1 padded message */ function openpgp_encoding_eme_pkcs1_encode(message, length) { if (message.length > length-11) @@ -70,8 +71,8 @@ function openpgp_encoding_eme_pkcs1_encode(message, length) { /** * decodes a EME-PKCS1-v1_5 padding (See RFC4880 13.1.2) - * @param message [String] EME-PKCS1 padded message - * @return [String] decoded message + * @param {String} message EME-PKCS1 padded message + * @return {String} decoded message */ function openpgp_encoding_eme_pkcs1_decode(message, len) { if (message.length < len) @@ -97,10 +98,10 @@ hash_headers[11] = [0x30,0x31,0x30,0x0d,0x06,0x09,0x60,0x86,0x48,0x01,0x65,0x03, /** * create a EMSA-PKCS1-v1_5 padding (See RFC4880 13.1.3) - * @param algo [Integer] hash algorithm type used - * @param data [String] data to be hashed - * @param keylength [Integer] key size of the public mpi in bytes - * @return the [String] hashcode with pkcs1padding as string + * @param {Integer} algo Hash algorithm type used + * @param {String} data Data to be hashed + * @param {Integer} keylength Key size of the public mpi in bytes + * @returns {String} Hashcode with pkcs1padding as string */ function openpgp_encoding_emsa_pkcs1_encode(algo, data, keylength) { var data2 = ""; @@ -119,8 +120,8 @@ function openpgp_encoding_emsa_pkcs1_encode(algo, data, keylength) { /** * extract the hash out of an EMSA-PKCS1-v1.5 padding (See RFC4880 13.1.3) - * @param data [String] hash in pkcs1 encoding - * @return the hash as string + * @param {String} data Hash in pkcs1 encoding + * @returns {String} The hash as string */ function openpgp_encoding_emsa_pkcs1_decode(algo, data) { var i = 0; @@ -137,4 +138,4 @@ function openpgp_encoding_emsa_pkcs1_decode(algo, data) { i+= j; if (data.substring(i).length < openpgp_crypto_getHashByteLength(algo)) return -1; return data.substring(i); -} \ No newline at end of file +} diff --git a/src/openpgp.js b/src/openpgp.js index b5a56286..6f64cf23 100644 --- a/src/openpgp.js +++ b/src/openpgp.js @@ -35,7 +35,6 @@ function _openpgp () { * initializes the library: * - reading the keyring from local storage * - reading the config from local storage - * @return [void] */ function init() { this.config = new openpgp_config(); @@ -49,7 +48,7 @@ function _openpgp () { * representation an returns openpgp_msg_publickey packets * @param {String} armoredText OpenPGP armored text containing * the public key(s) - * @return {Array[openpgp_msg_publickey]} on error the function + * @return {openpgp_msg_publickey[]} on error the function * returns null */ function read_publicKey(armoredText) { @@ -95,7 +94,7 @@ function _openpgp () { * representation an returns openpgp_msg_privatekey objects * @param {String} armoredText OpenPGP armored text containing * the private key(s) - * @return {Array[openpgp_msg_privatekey]} on error the function + * @return {openpgp_msg_privatekey[]} on error the function * returns null */ function read_privateKey(armoredText) { @@ -125,7 +124,7 @@ function _openpgp () { * reads message packets out of an OpenPGP armored text and * returns an array of message objects * @param {String} armoredText text to be parsed - * @return {Array[openpgp_msg_message]} on error the function + * @return {openpgp_msg_message[]} on error the function * returns null */ function read_message(armoredText) { @@ -146,7 +145,7 @@ function _openpgp () { * External call will parse a de-armored messaged and return messages found. * Internal will be called to read packets wrapped in other packets (i.e. compressed) * @param {String} input dearmored text of OpenPGP packets, to be parsed - * @return {Array[openpgp_msg_message]} on error the function + * @return {openpgp_msg_message[]} on error the function * returns null */ function read_messages_dearmored(input){ @@ -291,10 +290,13 @@ function _openpgp () { * creates a binary string representation of an encrypted and signed message. * The message will be encrypted with the public keys specified and signed * with the specified private key. - * @param {obj: [openpgp_msg_privatekey]} privatekey private key to be used to sign the message - * @param {Array {obj: [openpgp_msg_publickey]}} publickeys public keys to be used to encrypt the message + * @param {Object} privatekey {obj: [openpgp_msg_privatekey]} Private key + * to be used to sign the message + * @param {Object[]} publickeys An arraf of {obj: [openpgp_msg_publickey]} + * - public keys to be used to encrypt the message * @param {String} messagetext message text to encrypt and sign - * @return {String} a binary string representation of the message which can be OpenPGP armored + * @return {String} a binary string representation of the message which + * can be OpenPGP armored */ function write_signed_and_encrypted_message(privatekey, publickeys, messagetext) { var result = ""; @@ -347,8 +349,8 @@ function _openpgp () { /** * creates a binary string representation of an encrypted message. * The message will be encrypted with the public keys specified - * @param {Array {obj: [openpgp_msg_publickey]}} publickeys public - * keys to be used to encrypt the message + * @param {Object[]} publickeys An array of {obj: [openpgp_msg_publickey]} + * -public keys to be used to encrypt the message * @param {String} messagetext message text to encrypt * @return {String} a binary string representation of the message * which can be OpenPGP armored @@ -389,12 +391,13 @@ function _openpgp () { /** * creates a binary string representation a signed message. * The message will be signed with the specified private key. - * @param {obj: [openpgp_msg_privatekey]} privatekey private - * key to be used to sign the message + * @param {Object} privatekey {obj: [openpgp_msg_privatekey]} + * - the private key to be used to sign the message * @param {String} messagetext message text to sign - * @return {Object: text [String]}, openpgp: {String} a binary + * @return {Object} {Object: text [String]}, openpgp: {String} a binary * string representation of the message which can be OpenPGP - * armored(openpgp) and a text representation of the message (text). This can be directly used to OpenPGP armor the message + * armored(openpgp) and a text representation of the message (text). + * This can be directly used to OpenPGP armor the message */ function write_signed_message(privatekey, messagetext) { var sig = new openpgp_packet_signature().write_message_signature(1, messagetext.replace(/\r\n/g,"\n").replace(/\n/,"\r\n"), privatekey); @@ -403,11 +406,16 @@ function _openpgp () { } /** - * generates a new key pair for openpgp. Beta stage. Currently only supports RSA keys, and no subkeys. - * @param {int} keyType to indicate what type of key to make. RSA is 1. Follows algorithms outlined in OpenPGP. - * @param {int} numBits number of bits for the key creation. (should be 1024+, generally) - * @param {string} userId assumes already in form of "User Name " - * @return {privateKey: [openpgp_msg_privatekey], privateKeyArmored: [string], publicKeyArmored: [string]} + * generates a new key pair for openpgp. Beta stage. Currently only + * supports RSA keys, and no subkeys. + * @param {Integer} keyType to indicate what type of key to make. + * RSA is 1. Follows algorithms outlined in OpenPGP. + * @param {Integer} numBits number of bits for the key creation. (should + * be 1024+, generally) + * @param {String} userId assumes already in form of "User Name + * " + * @return {Object} {privateKey: [openpgp_msg_privatekey], + * privateKeyArmored: [string], publicKeyArmored: [string]} */ function generate_key_pair(keyType, numBits, userId, passphrase){ var userIdPacket = new openpgp_packet_userid(); diff --git a/src/openpgp.keyring.js b/src/openpgp.keyring.js index d30e28d9..92c953bc 100644 --- a/src/openpgp.keyring.js +++ b/src/openpgp.keyring.js @@ -25,7 +25,6 @@ function openpgp_keyring() { * Initialization routine for the keyring. This method reads the * keyring from HTML5 local storage and initializes this instance. * This method is called by openpgp.init(). - * @return {null} undefined */ function init() { var sprivatekeys = JSON.parse(window.localStorage.getItem("privatekeys")); @@ -58,7 +57,7 @@ function openpgp_keyring() { /** * Checks if at least one private key is in the keyring - * @return {boolean} True if there are private keys, else false. + * @return {Boolean} True if there are private keys, else false. */ function hasPrivateKey() { return this.privateKeys.length > 0; @@ -68,7 +67,6 @@ function openpgp_keyring() { /** * Saves the current state of the keyring to HTML5 local storage. * The privateKeys array and publicKeys array gets Stringified using JSON - * @return {null} undefined */ function store() { var priv = new Array(); @@ -85,8 +83,8 @@ function openpgp_keyring() { this.store = store; /** * searches all public keys in the keyring matching the address or address part of the user ids - * @param email_address - * @return {array[openpgp_msg_publickey]} the public keys associated with provided email address. + * @param {String} email_address + * @return {openpgp_msg_publickey[]} The public keys associated with provided email address. */ function getPublicKeyForAddress(email_address) { var results = new Array(); @@ -114,7 +112,7 @@ function openpgp_keyring() { /** * Searches the keyring for a private key containing the specified email address * @param {String} email_address email address to search for - * @return {Array[openpgp_msg_privatekey} private keys found + * @return {openpgp_msg_privatekey[]} private keys found */ function getPrivateKeyForAddress(email_address) { var results = new Array(); @@ -141,8 +139,8 @@ function openpgp_keyring() { this.getPrivateKeyForAddress = getPrivateKeyForAddress; /** * Searches the keyring for public keys having the specified key id - * @param keyId provided as string of hex number (lowercase) - * @return {Array[openpgp_msg_privatekey]} public keys found + * @param {String} keyId provided as string of hex number (lowercase) + * @return {openpgp_msg_privatekey[]} public keys found */ function getPublicKeysForKeyId(keyId) { var result = new Array(); @@ -169,7 +167,7 @@ function openpgp_keyring() { /** * Searches the keyring for private keys having the specified key id * @param {String} keyId 8 bytes as string containing the key id to look for - * @return {Array[openpgp_msg_privatekey]} private keys found + * @return {openpgp_msg_privatekey[]} private keys found */ function getPrivateKeyForKeyId(keyId) { var result = new Array(); @@ -192,7 +190,6 @@ function openpgp_keyring() { /** * Imports a public key from an exported ascii armored message * @param {String} armored_text PUBLIC KEY BLOCK message to read the public key from - * @return {null} nothing */ function importPublicKey (armored_text) { var result = openpgp.read_publicKey(armored_text); @@ -205,7 +202,6 @@ function openpgp_keyring() { /** * Imports a private key from an exported ascii armored message * @param {String} armored_text PRIVATE KEY BLOCK message to read the private key from - * @return {null} nothing */ function importPrivateKey (armored_text, password) { var result = openpgp.read_privateKey(armored_text); diff --git a/src/openpgp.msg.publickey.js b/src/openpgp.msg.publickey.js index 6d729152..8293707d 100644 --- a/src/openpgp.msg.publickey.js +++ b/src/openpgp.msg.publickey.js @@ -155,7 +155,7 @@ function openpgp_msg_publickey() { * - subkey binding and revocation certificates * * This is useful for validating the key - * @returns true if the basic signatures are all valid + * @returns {Boolean} true if the basic signatures are all valid */ function verifyBasicSignatures() { for (var i = 0; i < this.revocationSignatures.length; i++) { diff --git a/src/packet/openpgp.packet.compressed.js b/src/packet/openpgp.packet.compressed.js index 11fadb7d..e02ee4da 100644 --- a/src/packet/openpgp.packet.compressed.js +++ b/src/packet/openpgp.packet.compressed.js @@ -30,11 +30,12 @@ function openpgp_packet_compressed() { this.decompressedData = null; /** - * parsing function for the packet. - * @param {string} input payload of a tag 8 packet - * @param {integer} position position to start reading from the input string - * @param {integer} len length of the packet or the remaining length of input at position - * @return {openpgp_packet_compressed} object representation + * Parsing function for the packet. + * @param {String} input Payload of a tag 8 packet + * @param {Integer} position Position to start reading from the input string + * @param {Integer} len Length of the packet or the remaining length of + * input at position + * @return {openpgp_packet_compressed} Object representation */ function read_packet (input, position, len) { this.packetLength = len; @@ -46,9 +47,9 @@ function openpgp_packet_compressed() { return this; } /** - * decompression method for decompressing the compressed data + * Decompression method for decompressing the compressed data * read by read_packet - * @return {String} the decompressed data + * @return {String} The decompressed data */ function decompress() { if (this.decompressedData != null) @@ -99,8 +100,8 @@ function openpgp_packet_compressed() { /** * Compress the packet data (member decompressedData) - * @param {integer} type algorithm to be used // See RFC 4880 9.3 - * @param {String} data data to be compressed + * @param {Integer} type Algorithm to be used // See RFC 4880 9.3 + * @param {String} data Data to be compressed * @return {String} The compressed data stored in attribute compressedData */ function compress(type, data) { @@ -130,10 +131,10 @@ function openpgp_packet_compressed() { } /** - * creates a string representation of the packet - * @param {integer} algorithm algorithm to be used // See RFC 4880 9.3 - * @param {String} data data to be compressed - * @return {String} string-representation of the packet + * Creates a string representation of the packet + * @param {Integer} algorithm Algorithm to be used // See RFC 4880 9.3 + * @param {String} data Data to be compressed + * @return {String} String-representation of the packet */ function write_packet(algorithm, data) { this.decompressedData = data; @@ -145,7 +146,7 @@ function openpgp_packet_compressed() { } /** - * pretty printing the packet (useful for debug purposes) + * Pretty printing the packet (useful for debug purposes) * @return {String} */ function toString() { diff --git a/src/packet/openpgp.packet.encrypteddata.js b/src/packet/openpgp.packet.encrypteddata.js index bb47cc9f..be31467e 100644 --- a/src/packet/openpgp.packet.encrypteddata.js +++ b/src/packet/openpgp.packet.encrypteddata.js @@ -33,13 +33,13 @@ function openpgp_packet_encrypteddata() { this.decryptedData = null; /** - * parsing function for the packet. + * Parsing function for the packet. * - * @param {string} input payload of a tag 9 packet - * @param {integer} position position to start reading from the input string - * @param {integer} len length of the packet or the remaining length of + * @param {String} input Payload of a tag 9 packet + * @param {Integer} position Position to start reading from the input string + * @param {Integer} len Length of the packet or the remaining length of * input at position - * @return {openpgp_packet_encrypteddata} object representation + * @return {openpgp_packet_encrypteddata} Object representation */ function read_packet(input, position, len) { var mypos = position; @@ -51,14 +51,14 @@ function openpgp_packet_encrypteddata() { } /** - * symmetrically decrypt the packet data + * Symmetrically decrypt the packet data * - * @param {integer} symmetric_algorithm_type - * symmetric key algorithm to use // See RFC4880 9.2 + * @param {Integer} symmetric_algorithm_type + * Symmetric key algorithm to use // See RFC4880 9.2 * @param {String} key - * key as string with the corresponding length to the + * Key as string with the corresponding length to the * algorithm - * @return the decrypted data; + * @return The decrypted data; */ function decrypt_sym(symmetric_algorithm_type, key) { this.decryptedData = openpgp_crypto_symmetricDecrypt( @@ -71,11 +71,11 @@ function openpgp_packet_encrypteddata() { /** * Creates a string representation of the packet * - * @param {Integer} algo symmetric key algorithm to use // See RFC4880 9.2 - * @param {String} key key as string with the corresponding length to the + * @param {Integer} algo Symmetric key algorithm to use // See RFC4880 9.2 + * @param {String} key Key as string with the corresponding length to the * algorithm - * @param {String} data data to be - * @return {String} string-representation of the packet + * @param {String} data Data to be + * @return {String} String-representation of the packet */ function write_packet(algo, key, data) { var result = ""; diff --git a/src/packet/openpgp.packet.encryptedintegrityprotecteddata.js b/src/packet/openpgp.packet.encryptedintegrityprotecteddata.js index cbd5fc85..c1bcdca5 100644 --- a/src/packet/openpgp.packet.encryptedintegrityprotecteddata.js +++ b/src/packet/openpgp.packet.encryptedintegrityprotecteddata.js @@ -17,7 +17,8 @@ /** * @class - * @classdesc Implementation of the Sym. Encrypted Integrity Protected Data Packet (Tag 18) + * @classdesc Implementation of the Sym. Encrypted Integrity Protected Data + * Packet (Tag 18) * * RFC4880 5.13: The Symmetrically Encrypted Integrity Protected Data packet is * a variant of the Symmetrically Encrypted Data packet. It is a new feature @@ -34,12 +35,12 @@ function openpgp_packet_encryptedintegrityprotecteddata() { this.decrytpedData = null; // string this.hash = null; // string /** - * parsing function for the packet. + * Parsing function for the packet. * - * @param {string} input payload of a tag 18 packet - * @param {integer} position + * @param {String} input Payload of a tag 18 packet + * @param {Integer} position * position to start reading from the input string - * @param {integer} len length of the packet or the remaining length of + * @param {Integer} len Length of the packet or the remaining length of * input at position * @return {openpgp_packet_encryptedintegrityprotecteddata} object * representation @@ -72,12 +73,12 @@ function openpgp_packet_encryptedintegrityprotecteddata() { * Creates a string representation of a Sym. Encrypted Integrity Protected * Data Packet (tag 18) (see RFC4880 5.13) * - * @param {integer} symmetric_algorithm - * the selected symmetric encryption algorithm to be used - * @param {String} key the key of cipher blocksize length to be used - * @param data - * plaintext data to be encrypted within the packet - * @return a string representation of the packet + * @param {Integer} symmetric_algorithm + * The selected symmetric encryption algorithm to be used + * @param {String} key The key of cipher blocksize length to be used + * @param {String} data + * Plaintext data to be encrypted within the packet + * @return {String} A string representation of the packet */ function write_packet(symmetric_algorithm, key, data) { @@ -107,10 +108,10 @@ function openpgp_packet_encryptedintegrityprotecteddata() { * Decrypts the encrypted data contained in this object read_packet must * have been called before * - * @param {integer} symmetric_algorithm_type - * the selected symmetric encryption algorithm to be used - * @param {String} key the key of cipher blocksize length to be used - * @return the decrypted data of this packet + * @param {Integer} symmetric_algorithm_type + * The selected symmetric encryption algorithm to be used + * @param {String} key The key of cipher blocksize length to be used + * @return {String} The decrypted data of this packet */ function decrypt(symmetric_algorithm_type, key) { this.decryptedData = openpgp_crypto_symmetricDecrypt( diff --git a/src/packet/openpgp.packet.encryptedsessionkey.js b/src/packet/openpgp.packet.encryptedsessionkey.js index 6bdc5446..24a4961c 100644 --- a/src/packet/openpgp.packet.encryptedsessionkey.js +++ b/src/packet/openpgp.packet.encryptedsessionkey.js @@ -34,13 +34,13 @@ function openpgp_packet_encryptedsessionkey() { /** - * parsing function for a publickey encrypted session key packet (tag 1). + * Parsing function for a publickey encrypted session key packet (tag 1). * - * @param {string} input payload of a tag 1 packet - * @param {integer} position position to start reading from the input string - * @param {integer} len length of the packet or the remaining length of + * @param {String} input Payload of a tag 1 packet + * @param {Integer} position Position to start reading from the input string + * @param {Integer} len Length of the packet or the remaining length of * input at position - * @return {openpgp_packet_encrypteddata} object representation + * @return {openpgp_packet_encrypteddata} Object representation */ function read_pub_key_packet(input, position, len) { this.tagType = 1; @@ -83,21 +83,22 @@ function openpgp_packet_encryptedsessionkey() { } /** - * create a string representation of a tag 1 packet + * Create a string representation of a tag 1 packet * * @param {String} publicKeyId - * the public key id corresponding to publicMPIs key as string - * @param {Array[openpgp_type_mpi]} publicMPIs - * multiprecision integer objects describing the public key - * @param {integer} pubalgo - * the corresponding public key algorithm // See RFC4880 9.1 - * @param {integer} symmalgo - * the symmetric cipher algorithm used to encrypt the data within - * an encrypteddatapacket or encryptedintegrityprotecteddatapacket + * The public key id corresponding to publicMPIs key as string + * @param {openpgp_type_mpi[]} publicMPIs + * Multiprecision integer objects describing the public key + * @param {Integer} pubalgo + * The corresponding public key algorithm // See RFC4880 9.1 + * @param {Integer} symmalgo + * The symmetric cipher algorithm used to encrypt the data + * within an encrypteddatapacket or encryptedintegrity- + * protecteddatapacket * following this packet //See RFC4880 9.2 * @param {String} sessionkey - * a string of randombytes representing the session key - * @return {String} the string representation + * A string of randombytes representing the session key + * @return {String} The string representation */ function write_pub_key_packet(publicKeyId, publicMPIs, pubalgo, symmalgo, sessionkey) { @@ -121,14 +122,14 @@ function openpgp_packet_encryptedsessionkey() { } /** - * parsing function for a symmetric encrypted session key packet (tag 3). + * Parsing function for a symmetric encrypted session key packet (tag 3). * - * @param {string} input payload of a tag 1 packet - * @param {integer} position position to start reading from the input string - * @param {integer} len - * length of the packet or the remaining length of + * @param {String} input Payload of a tag 1 packet + * @param {Integer} position Position to start reading from the input string + * @param {Integer} len + * Length of the packet or the remaining length of * input at position - * @return {openpgp_packet_encrypteddata} object representation + * @return {openpgp_packet_encrypteddata} Object representation */ function read_symmetric_key_packet(input, position, len) { this.tagType = 3; @@ -157,10 +158,10 @@ function openpgp_packet_encryptedsessionkey() { * packets (tag 1) * * @param {openpgp_msg_message} msg - * the message object (with member encryptedData + * The message object (with member encryptedData * @param {openpgp_msg_privatekey} key - * private key with secMPIs unlocked - * @return {String} the unencrypted session key + * Private key with secMPIs unlocked + * @return {String} The unencrypted session key */ function decrypt(msg, key) { if (this.tagType == 1) { @@ -187,7 +188,7 @@ function openpgp_packet_encryptedsessionkey() { * Creates a string representation of this object (useful for debug * purposes) * - * @return the string containing a openpgp description + * @return {String} The string containing a openpgp description */ function toString() { if (this.tagType == 1) { diff --git a/src/packet/openpgp.packet.js b/src/packet/openpgp.packet.js index e0a37a7a..cefb838e 100644 --- a/src/packet/openpgp.packet.js +++ b/src/packet/openpgp.packet.js @@ -17,16 +17,16 @@ /** * @class - * @classdesc Parent openpgp packet class. Operations focus on determining packet types - * and packet header. + * @classdesc Parent openpgp packet class. Operations focus on determining + * packet types and packet header. */ function _openpgp_packet() { /** * Encodes a given integer of length to the openpgp length specifier to a * string * - * @param {Integer} length of the length to encode - * @return {string} string with openpgp length representation + * @param {Integer} length The length to encode + * @return {String} String with openpgp length representation */ function encode_length(length) { result = ""; @@ -54,9 +54,9 @@ function _openpgp_packet() { * Writes a packet header version 4 with the given tag_type and length to a * string * - * @param {integer} tag_type tag type - * @param {integer} length length of the payload - * @return {string} string of the header + * @param {Integer} tag_type Tag type + * @param {Integer} length Length of the payload + * @return {String} String of the header */ function write_packet_header(tag_type, length) { /* we're only generating v4 packet headers here */ @@ -70,9 +70,9 @@ function _openpgp_packet() { * Writes a packet header Version 3 with the given tag_type and length to a * string * - * @param {integer} tag_type tag type - * @param {integer} length length of the payload - * @return {string} string of the header + * @param {Integer} tag_type Tag type + * @param {Integer} length Length of the payload + * @return {String} String of the header */ function write_old_packet_header(tag_type, length) { var result = ""; @@ -97,10 +97,10 @@ function _openpgp_packet() { /** * Generic static Packet Parser function * - * @param {String} input input stream as string - * @param {integer} position position to start parsing - * @param {integer} len length of the input from position on - * @return {openpgp_packet_*} returns a parsed openpgp_packet + * @param {String} input Input stream as string + * @param {integer} position Position to start parsing + * @param {integer} len Length of the input from position on + * @return {Object} Returns a parsed openpgp_packet */ function read_packet(input, position, len) { // some sanity checks diff --git a/src/packet/openpgp.packet.keymaterial.js b/src/packet/openpgp.packet.keymaterial.js index 077096e8..e52fb879 100644 --- a/src/packet/openpgp.packet.keymaterial.js +++ b/src/packet/openpgp.packet.keymaterial.js @@ -50,10 +50,10 @@ function openpgp_packet_keymaterial() { /** * This function reads the payload of a secret key packet (Tag 5) * and initializes the openpgp_packet_keymaterial - * @param input input string to read the packet from - * @param position start position for the parser - * @param len length of the packet or remaining length of input - * @return openpgp_packet_keymaterial object + * @param {String} input Input string to read the packet from + * @param {Integer} position Start position for the parser + * @param {Intefer} len Length of the packet or remaining length of input + * @return {openpgp_packet_keymaterial} */ function read_tag5(input, position, len) { this.tagType = 5; @@ -65,10 +65,10 @@ function openpgp_packet_keymaterial() { /** * This function reads the payload of a public key packet (Tag 6) * and initializes the openpgp_packet_keymaterial - * @param input input string to read the packet from - * @param position start position for the parser - * @param len length of the packet or remaining length of input - * @return openpgp_packet_keymaterial object + * @param {String} input Input string to read the packet from + * @param {Integer} position Start position for the parser + * @param {Integer} len Length of the packet or remaining length of input + * @return {openpgp_packet_keymaterial} */ function read_tag6(input, position, len) { // A Public-Key packet starts a series of packets that forms an OpenPGP @@ -84,10 +84,10 @@ function openpgp_packet_keymaterial() { /** * This function reads the payload of a secret key sub packet (Tag 7) * and initializes the openpgp_packet_keymaterial - * @param input input string to read the packet from - * @param position start position for the parser - * @param len length of the packet or remaining length of input - * @return openpgp_packet_keymaterial object + * @param {String} input Input string to read the packet from + * @param {Integer} position Start position for the parser + * @param {Integer} len Length of the packet or remaining length of input + * @return {openpgp_packet_keymaterial} */ function read_tag7(input, position, len) { this.tagType = 7; @@ -99,10 +99,10 @@ function openpgp_packet_keymaterial() { /** * This function reads the payload of a public key sub packet (Tag 14) * and initializes the openpgp_packet_keymaterial - * @param input input string to read the packet from - * @param position start position for the parser - * @param len length of the packet or remaining length of input - * @return openpgp_packet_keymaterial object + * @param {String} input Input string to read the packet from + * @param {Integer} position Start position for the parser + * @param {Integer} len Length of the packet or remaining length of input + * @return {openpgp_packet_keymaterial} */ function read_tag14(input, position, len) { this.subKeySignature = null; @@ -114,12 +114,13 @@ function openpgp_packet_keymaterial() { } /** - * Internal Parser for public keys as specified in RFC 4880 section 5.5.2 Public-Key Packet Formats + * Internal Parser for public keys as specified in RFC 4880 section + * 5.5.2 Public-Key Packet Formats * called by read_tag<num> - * @param input input string to read the packet from - * @param position start position for the parser - * @param len length of the packet or remaining length of input - * @return this object with attributes set by the parser + * @param {String} input Input string to read the packet from + * @param {Integer} position Start position for the parser + * @param {Integer} len Length of the packet or remaining length of input + * @return {Object} This object with attributes set by the parser */ function read_pub_key(input, position, len) { var mypos = position; @@ -226,10 +227,10 @@ function openpgp_packet_keymaterial() { /** * Internal parser for private keys as specified in RFC 4880 section 5.5.3 - * @param input input string to read the packet from - * @param position start position for the parser - * @param len length of the packet or remaining length of input - * @return this object with attributes set by the parser + * @param {String} input Input string to read the packet from + * @param {Integer} position Start position for the parser + * @param {Integer} len Length of the packet or remaining length of input + * @return {Object} This object with attributes set by the parser */ function read_priv_key(input,position, len) { // - A Public-Key or Public-Subkey packet, as described above. @@ -362,11 +363,13 @@ function openpgp_packet_keymaterial() { /** * Decrypts the private key MPIs which are needed to use the key. - * openpgp_packet_keymaterial.hasUnencryptedSecretKeyData should be false otherwise + * openpgp_packet_keymaterial.hasUnencryptedSecretKeyData should be + * false otherwise * a call to this function is not needed * - * @param str_passphrase the passphrase for this private key as string - * @return true if the passphrase was correct; false if not + * @param {String} str_passphrase The passphrase for this private key + * as string + * @return {Boolean} True if the passphrase was correct; false if not */ function decryptSecretMPIs(str_passphrase) { if (this.hasUnencryptedSecretKeyData) @@ -549,11 +552,11 @@ function openpgp_packet_keymaterial() { /** * Continue parsing packets belonging to the key material such as signatures - * @param {openpgp_*} parent_node the parent object - * @param {String} input input string to read the packet(s) from - * @param {integer} position start position for the parser - * @param {integer} len length of the packet(s) or remaining length of input - * @return {integer} length of nodes read + * @param {Object} parent_node The parent object + * @param {String} input Input string to read the packet(s) from + * @param {Integer} position Start position for the parser + * @param {Integer} len Length of the packet(s) or remaining length of input + * @return {Integer} Length of nodes read */ function read_nodes(parent_node, input, position, len) { this.parentNode = parent_node; @@ -630,7 +633,7 @@ function openpgp_packet_keymaterial() { /** * Checks the validity for usage of this (sub)key - * @return 0 = bad key, 1 = expired, 2 = revoked, 3 = valid + * @return {Integer} 0 = bad key, 1 = expired, 2 = revoked, 3 = valid */ function verifyKey() { if (this.tagType == 14) { @@ -658,8 +661,8 @@ function openpgp_packet_keymaterial() { } /** - * calculates the key id of they key - * @return {String} a 8 byte key id + * Calculates the key id of they key + * @return {String} A 8 byte key id */ function getKeyId() { if (this.version == 4) { @@ -673,8 +676,8 @@ function openpgp_packet_keymaterial() { } /** - * calculates the fingerprint of the key - * @return {String} a string containing the fingerprint + * Calculates the fingerprint of the key + * @return {String} A string containing the fingerprint */ function getFingerprint() { if (this.version == 4) { @@ -688,14 +691,17 @@ function openpgp_packet_keymaterial() { } /* - * creates an OpenPGP key packet for the given key. much TODO in regards to s2k, subkeys. - * @param {int} keyType follows the OpenPGP algorithm standard, IE 1 corresponds to RSA. + * Creates an OpenPGP key packet for the given key. much + * TODO in regards to s2k, subkeys. + * @param {Integer} keyType Follows the OpenPGP algorithm standard, + * IE 1 corresponds to RSA. * @param {RSA.keyObject} key * @param password * @param s2kHash * @param symmetricEncryptionAlgorithm * @param timePacket - * @return {body: [string]OpenPGP packet body contents, header: [string] OpenPGP packet header, string: [string] header+body} + * @return {Object} {body: [string]OpenPGP packet body contents, + header: [string] OpenPGP packet header, string: [string] header+body} */ function write_private_key(keyType, key, password, s2kHash, symmetricEncryptionAlgorithm, timePacket){ this.symmetricEncryptionAlgorithm = symmetricEncryptionAlgorithm; @@ -769,11 +775,14 @@ function openpgp_packet_keymaterial() { } /* - * same as write_private_key, but has less information because of public key. - * @param {int} keyType follows the OpenPGP algorithm standard, IE 1 corresponds to RSA. + * Same as write_private_key, but has less information because of + * public key. + * @param {Integer} keyType Follows the OpenPGP algorithm standard, + * IE 1 corresponds to RSA. * @param {RSA.keyObject} key * @param timePacket - * @return {body: [string]OpenPGP packet body contents, header: [string] OpenPGP packet header, string: [string] header+body} + * @return {Object} {body: [string]OpenPGP packet body contents, + * header: [string] OpenPGP packet header, string: [string] header+body} */ function write_public_key(keyType, key, timePacket){ var tag = 6; diff --git a/src/packet/openpgp.packet.literaldata.js b/src/packet/openpgp.packet.literaldata.js index 179eb95c..1deaa88e 100644 --- a/src/packet/openpgp.packet.literaldata.js +++ b/src/packet/openpgp.packet.literaldata.js @@ -26,13 +26,13 @@ function openpgp_packet_literaldata() { this.tagType = 11; /** - * parsing function for a literal data packet (tag 11). + * Parsing function for a literal data packet (tag 11). * - * @param {string} input payload of a tag 11 packet - * @param {integer} position - * position to start reading from the input string - * @param {integer} len - * length of the packet or the remaining length of + * @param {String} input Payload of a tag 11 packet + * @param {Integer} position + * Position to start reading from the input string + * @param {Integer} len + * Length of the packet or the remaining length of * input at position * @return {openpgp_packet_encrypteddata} object representation */ @@ -53,7 +53,7 @@ function openpgp_packet_literaldata() { /** * Creates a string representation of the packet * - * @param {String} data the data to be inserted as body + * @param {String} data The data to be inserted as body * @return {String} string-representation of the packet */ function write_packet(data) { @@ -80,9 +80,9 @@ function openpgp_packet_literaldata() { } /** - * generates debug output (pretty print) + * Generates debug output (pretty print) * - * @return {string} String which gives some information about the keymaterial + * @return {String} String which gives some information about the keymaterial */ function toString() { return '5.9. Literal Data Packet (Tag 11)\n' + ' length: ' diff --git a/src/packet/openpgp.packet.marker.js b/src/packet/openpgp.packet.marker.js index 5f3ab5af..848f746a 100644 --- a/src/packet/openpgp.packet.marker.js +++ b/src/packet/openpgp.packet.marker.js @@ -29,15 +29,15 @@ function openpgp_packet_marker() { this.tagType = 10; /** - * parsing function for a literal data packet (tag 10). + * Parsing function for a literal data packet (tag 10). * - * @param {string} input payload of a tag 10 packet - * @param {integer} position - * position to start reading from the input string - * @param {integer} len - * length of the packet or the remaining length of + * @param {String} input Payload of a tag 10 packet + * @param {Integer} position + * Position to start reading from the input string + * @param {Integer} len + * Length of the packet or the remaining length of * input at position - * @return {openpgp_packet_encrypteddata} object representation + * @return {openpgp_packet_encrypteddata} Object representation */ function read_packet(input, position, len) { this.packetLength = 3; @@ -52,7 +52,8 @@ function openpgp_packet_marker() { /** * Generates Debug output * - * @return {string} String which gives some information about the keymaterial + * @return {String} String which gives some information about the + * keymaterial */ function toString() { return "5.8. Marker Packet (Obsolete Literal Packet) (Tag 10)\n" diff --git a/src/packet/openpgp.packet.modificationdetectioncode.js b/src/packet/openpgp.packet.modificationdetectioncode.js index 37a53701..36e4a2c6 100644 --- a/src/packet/openpgp.packet.modificationdetectioncode.js +++ b/src/packet/openpgp.packet.modificationdetectioncode.js @@ -67,8 +67,8 @@ function openpgp_packet_modificationdetectioncode() { /** * generates debug output (pretty print) * - * @return {string} String which gives some information about the modification - * detection code + * @return {String} String which gives some information about the + * modification detection code */ function toString() { return '5.14 Modification detection code packet\n' + ' bytes (' diff --git a/src/packet/openpgp.packet.onepasssignature.js b/src/packet/openpgp.packet.onepasssignature.js index f1ff9a60..d6b61944 100644 --- a/src/packet/openpgp.packet.onepasssignature.js +++ b/src/packet/openpgp.packet.onepasssignature.js @@ -37,9 +37,9 @@ function openpgp_packet_onepasssignature() { /** * parsing function for a one-pass signature packet (tag 4). - * @param {string} input payload of a tag 4 packet - * @param {integer} position position to start reading from the input string - * @param {integer} len length of the packet or the remaining length of input at position + * @param {String} input payload of a tag 4 packet + * @param {Integer} position position to start reading from the input string + * @param {Integer} len length of the packet or the remaining length of input at position * @return {openpgp_packet_encrypteddata} object representation */ function read_packet(input, position, len) { @@ -72,10 +72,10 @@ function openpgp_packet_onepasssignature() { /** * creates a string representation of a one-pass signature packet - * @param {integer} type Signature types as described in RFC4880 Section 5.2.1. - * @param {integer} hashalgorithm the hash algorithm used within the signature + * @param {Integer} type Signature types as described in RFC4880 Section 5.2.1. + * @param {Integer} hashalgorithm the hash algorithm used within the signature * @param {openpgp_msg_privatekey} privatekey the private key used to generate the signature - * @param {integer} length length of data to be signed + * @param {Integer} length length of data to be signed * @param {boolean} nested boolean showing whether the signature is nested. * "true" indicates that the next packet is another One-Pass Signature packet * that describes another signature to be applied to the same message data. @@ -100,7 +100,7 @@ function openpgp_packet_onepasssignature() { /** * generates debug output (pretty print) - * @return {string} String which gives some information about the one-pass signature packet + * @return {String} String which gives some information about the one-pass signature packet */ function toString() { return '5.4. One-Pass Signature Packets (Tag 4)\n'+ diff --git a/src/packet/openpgp.packet.signature.js b/src/packet/openpgp.packet.signature.js index 865d29fb..7f19e3a5 100644 --- a/src/packet/openpgp.packet.signature.js +++ b/src/packet/openpgp.packet.signature.js @@ -70,9 +70,9 @@ function openpgp_packet_signature() { /** * parsing function for a signature packet (tag 2). - * @param {string} input payload of a tag 2 packet - * @param {integer} position position to start reading from the input string - * @param {integer} len length of the packet or the remaining length of input at position + * @param {String} input payload of a tag 2 packet + * @param {Integer} position position to start reading from the input string + * @param {Integer} len length of the packet or the remaining length of input at position * @return {openpgp_packet_encrypteddata} object representation */ function read_packet(input, position, len) { @@ -210,10 +210,10 @@ function openpgp_packet_signature() { /** * creates a string representation of a message signature packet (tag 2). * This can be only used on text data - * @param {integer} signature_type should be 1 (one) + * @param {Integer} signature_type should be 1 (one) * @param {String} data data to be signed * @param {openpgp_msg_privatekey} privatekey private key used to sign the message. (secMPIs MUST be unlocked) - * @return {string} string representation of a signature packet + * @return {String} string representation of a signature packet */ function write_message_signature(signature_type, data, privatekey) { var publickey = privatekey.privateKeyPacket.publicKey; @@ -256,7 +256,7 @@ function openpgp_packet_signature() { } /** * creates a string representation of a sub signature packet (See RFC 4880 5.2.3.1) - * @param {integer} type subpacket signature type. Signature types as described in RFC4880 Section 5.2.3.2 + * @param {Integer} type subpacket signature type. Signature types as described in RFC4880 Section 5.2.3.2 * @param {String} data data to be included * @return {String} a string-representation of a sub signature packet (See RFC 4880 5.2.3.1) */ @@ -636,7 +636,7 @@ function openpgp_packet_signature() { } /** * generates debug output (pretty print) - * @return {string} String which gives some information about the signature packet + * @return {String} String which gives some information about the signature packet */ function toString () { @@ -707,7 +707,7 @@ function openpgp_packet_signature() { /** * Tries to get the corresponding public key out of the public keyring for the issuer created this signature - * @return {obj: [openpgp_msg_publickey], text: [String]} if found the public key will be returned. null otherwise + * @return {Object} {obj: [openpgp_msg_publickey], text: [String]} if found the public key will be returned. null otherwise */ function getIssuerKey() { var result = null; diff --git a/src/packet/openpgp.packet.userattribute.js b/src/packet/openpgp.packet.userattribute.js index 1acb34e2..9ccdfd17 100644 --- a/src/packet/openpgp.packet.userattribute.js +++ b/src/packet/openpgp.packet.userattribute.js @@ -41,9 +41,9 @@ function openpgp_packet_userattribute() { /** * parsing function for a user attribute packet (tag 17). - * @param {string} input payload of a tag 17 packet - * @param {integer} position position to start reading from the input string - * @param {integer} len length of the packet or the remaining length of input at position + * @param {String} input payload of a tag 17 packet + * @param {Integer} position position to start reading from the input string + * @param {Integer} len length of the packet or the remaining length of input at position * @return {openpgp_packet_encrypteddata} object representation */ function read_packet (input, position, len) { @@ -89,7 +89,7 @@ function openpgp_packet_userattribute() { /** * generates debug output (pretty print) - * @return {string} String which gives some information about the user attribute packet + * @return {String} String which gives some information about the user attribute packet */ function toString() { var result = '5.12. User Attribute Packet (Tag 17)\n'+ @@ -102,11 +102,11 @@ function openpgp_packet_userattribute() { /** * Continue parsing packets belonging to the user attribute packet such as signatures - * @param {openpgp_*} parent_node the parent object + * @param {Object} parent_node the parent object * @param {String} input input string to read the packet(s) from - * @param {integer} position start position for the parser - * @param {integer} len length of the packet(s) or remaining length of input - * @return {integer} length of nodes read + * @param {Integer} position start position for the parser + * @param {Integer} len length of the packet(s) or remaining length of input + * @return {Integer} length of nodes read */ function read_nodes(parent_node, input, position, len) { diff --git a/src/packet/openpgp.packet.userid.js b/src/packet/openpgp.packet.userid.js index be1814f9..e7a0b7aa 100644 --- a/src/packet/openpgp.packet.userid.js +++ b/src/packet/openpgp.packet.userid.js @@ -34,9 +34,9 @@ function openpgp_packet_userid() { /** * parsing function for a user id packet (tag 13). - * @param {string} input payload of a tag 13 packet - * @param {integer} position position to start reading from the input string - * @param {integer} len length of the packet or the remaining length of input at position + * @param {String} input payload of a tag 13 packet + * @param {Integer} position position to start reading from the input string + * @param {Integer} len length of the packet or the remaining length of input at position * @return {openpgp_packet_encrypteddata} object representation */ function read_packet(input, position, len) { @@ -63,11 +63,11 @@ function openpgp_packet_userid() { /** * Continue parsing packets belonging to the userid packet such as signatures - * @param {openpgp_*} parent_node the parent object + * @param {Object} parent_node the parent object * @param {String} input input string to read the packet(s) from - * @param {integer} position start position for the parser - * @param {integer} len length of the packet(s) or remaining length of input - * @return {integer} length of nodes read + * @param {Integer} position start position for the parser + * @param {Integer} len length of the packet(s) or remaining length of input + * @return {Integer} length of nodes read */ function read_nodes(parent_node, input, position, len) { if (parent_node.tagType == 6) { // public key @@ -147,7 +147,7 @@ function openpgp_packet_userid() { /** * generates debug output (pretty print) - * @return {string} String which gives some information about the user id packet + * @return {String} String which gives some information about the user id packet */ function toString() { var result = ' 5.11. User ID Packet (Tag 13)\n' + ' text (' @@ -166,7 +166,7 @@ function openpgp_packet_userid() { /** * lookup function to find certification revocation signatures - * @param {string} keyId string containing the key id of the issuer of this signature + * @param {String} keyId string containing the key id of the issuer of this signature * @return a CertificationRevocationSignature if found; otherwise null */ function hasCertificationRevocationSignature(keyId) { @@ -182,8 +182,8 @@ function openpgp_packet_userid() { /** * Verifies all certification signatures. This method does not consider possible revocation signatures. - * @param publicKeyPacket the top level key material - * @return an array of integers corresponding to the array of certification signatures. The meaning of each integer is the following: + * @param {Object} publicKeyPacket the top level key material + * @return {Integer[]} An array of integers corresponding to the array of certification signatures. The meaning of each integer is the following: * 0 = bad signature * 1 = signature expired * 2 = issuer key not available diff --git a/src/type/openpgp.type.keyid.js b/src/type/openpgp.type.keyid.js index e91f1d4e..d8c1ac7a 100644 --- a/src/type/openpgp.type.keyid.js +++ b/src/type/openpgp.type.keyid.js @@ -25,10 +25,11 @@ */ function openpgp_type_keyid() { /** - * parsing method for a key id - * @param {String} input input to read the key id from - * @param {integer} position position where to start reading the key id from input - * @return this object + * Parsing method for a key id + * @param {String} input Input to read the key id from + * @param {integer} position Position where to start reading the key + * id from input + * @return {openpgp_type_keyid} This object */ function read_packet(input, position) { this.bytes = input.substring(position, position+8); @@ -36,7 +37,7 @@ function openpgp_type_keyid() { } /** - * generates debug output (pretty print) + * Generates debug output (pretty print) * @return {String} Key Id as hexadecimal string */ function toString() { diff --git a/src/type/openpgp.type.mpi.js b/src/type/openpgp.type.mpi.js index bee4c439..82f56690 100644 --- a/src/type/openpgp.type.mpi.js +++ b/src/type/openpgp.type.mpi.js @@ -36,11 +36,13 @@ function openpgp_type_mpi() { this.mpiByteLength = null; this.data = null; /** - * parsing function for a mpi (RFC 4880 3.2). - * @param {string} input payload of mpi data - * @param {integer} position position to start reading from the input string - * @param {integer} len length of the packet or the remaining length of input at position - * @return {openpgp_type_mpi} object representation + * Parsing function for a mpi (RFC 4880 3.2). + * @param {String} input Payload of mpi data + * @param {Integer} position Position to start reading from the input + * string + * @param {Integer} len Length of the packet or the remaining length of + * input at position + * @return {openpgp_type_mpi} Object representation */ function read(input, position, len) { var mypos = position; @@ -68,8 +70,8 @@ function openpgp_type_mpi() { } /** - * generates debug output (pretty print) - * @return {string} String which gives some information about the mpi + * Generates debug output (pretty print) + * @return {String} String which gives some information about the mpi */ function toString() { var r = " MPI("+this.mpiBitLength+"b/"+this.mpiByteLength+"B) : 0x"; @@ -78,7 +80,7 @@ function openpgp_type_mpi() { } /** - * converts the mpi to an BigInteger object + * Converts the mpi to an BigInteger object * @return {BigInteger} */ function getBigInteger() { @@ -93,16 +95,16 @@ function openpgp_type_mpi() { } /** - * gets the length of the mpi in bytes - * @return {integer} mpi byte length + * Gets the length of the mpi in bytes + * @return {Integer} Mpi byte length */ function getByteLength() { return this.mpiByteLength; } /** - * creates an mpi from the specified string - * @param {String} data data to read the mpi from + * Creates an mpi from the specified string + * @param {String} data Data to read the mpi from * @return {openpgp_type_mpi} */ function create(data) { @@ -113,8 +115,8 @@ function openpgp_type_mpi() { } /** - * converts the mpi object to a string as specified in RFC4880 3.2 - * @return {String} mpi byte representation + * Converts the mpi object to a string as specified in RFC4880 3.2 + * @return {String} mpi Byte representation */ function toBin() { var result = String.fromCharCode((this.mpiBitLength >> 8) & 0xFF); diff --git a/src/type/openpgp.type.s2k.js b/src/type/openpgp.type.s2k.js index 82b759c2..3147a8bb 100644 --- a/src/type/openpgp.type.s2k.js +++ b/src/type/openpgp.type.s2k.js @@ -26,10 +26,10 @@ */ function openpgp_type_s2k() { /** - * parsing function for a string-to-key specifier (RFC 4880 3.7). - * @param {string} input payload of string-to-key specifier - * @param {integer} position position to start reading from the input string - * @return {openpgp_type_s2k} object representation + * Parsing function for a string-to-key specifier (RFC 4880 3.7). + * @param {String} input Payload of string-to-key specifier + * @param {Integer} position Position to start reading from the input string + * @return {openpgp_type_s2k} Object representation */ function read(input, position) { var mypos = position; @@ -94,7 +94,7 @@ function openpgp_type_s2k() { /** * writes an s2k hash based on the inputs. - * @return {String} produced key of hashAlgorithm hash length + * @return {String} Produced key of hashAlgorithm hash length */ function write(type, hash, passphrase, salt, c){ this.type = type; @@ -107,9 +107,11 @@ function openpgp_type_s2k() { } /** - * produces a key using the specified passphrase and the defined hashAlgorithm - * @param passphrase {String} passphrase containing user input - * @return {String} produced key with a length corresponding to hashAlgorithm hash length + * Produces a key using the specified passphrase and the defined + * hashAlgorithm + * @param {String} passphrase Passphrase containing user input + * @return {String} Produced key with a length corresponding to + * hashAlgorithm hash length */ function produce_key(passphrase, numBytes) { if (this.type == 0) { diff --git a/src/util/util.js b/src/util/util.js index e62475a6..9d6e3f6d 100644 --- a/src/util/util.js +++ b/src/util/util.js @@ -37,9 +37,9 @@ var Util = function() { }; /** - * create hexstring from a binary - * @param str [String] string to convert - * @return [String] string containing the hexadecimal values + * Create hexstring from a binary + * @param {String} str String to convert + * @return {String} String containing the hexadecimal values */ this.hexstrdump = function(str) { if (str == null) @@ -57,9 +57,9 @@ var Util = function() { }; /** - * create binary string from a hex encoded string - * @param str [String] hex string to convert - * @return [String] string containing the binary values + * Create binary string from a hex encoded string + * @param {String} str Hex string to convert + * @return {String} String containing the binary values */ this.hex2bin = function(hex) { var str = ''; @@ -69,9 +69,9 @@ var Util = function() { }; /** - * creating a hex string from an binary array of integers (0..255) - * @param [Array[integer 0..255]] array to convert - * @return [String] hexadecimal representation of the array + * Creating a hex string from an binary array of integers (0..255) + * @param {String} str Array of bytes to convert + * @return {String} Hexadecimal representation of the array */ this.hexidump = function(str) { var r=[]; @@ -87,9 +87,9 @@ var Util = function() { }; /** - * convert a string to an array of integers(0.255) - * @param [String] string to convert - * @return [Array [Integer 0..255]] array of (binary) integers + * Convert a string to an array of integers(0.255) + * @param {String} str String to convert + * @return {Integer[]} An array of (binary) integers */ this.str2bin = function(str) { var result = new Array(); @@ -101,9 +101,9 @@ var Util = function() { }; /** - * convert an array of integers(0.255) to a string - * @param [Array [Integer 0..255]] array of (binary) integers to convert - * @return [String] string representation of the array + * Convert an array of integers(0.255) to a string + * @param {Integer[]} bin An array of (binary) integers to convert + * @return {String} The string representation of the array */ this.bin2str = function(bin) { var result = []; @@ -114,9 +114,9 @@ var Util = function() { }; /** - * convert a string to a Uint8Array - * @param [String] string to convert - * @return [Uint8Array] array of (binary) integers + * Convert a string to a Uint8Array + * @param {String} str String to convert + * @return {Uint8Array} The array of (binary) integers */ this.str2Uint8Array = function(str){ var uintArray = new Uint8Array(new ArrayBuffer(str.length)); @@ -127,9 +127,10 @@ var Util = function() { }; /** - * convert a Uint8Array to a string. This currently functions the same as bin2str. - * @param [Uint8Array] array of (binary) integers to convert - * @return [String] string representation of the array + * Convert a Uint8Array to a string. This currently functions + * the same as bin2str. + * @param {Uint8Array} bin An array of (binary) integers to convert + * @return {String} String representation of the array */ this.Uint8Array2str = function(bin) { var result = []; @@ -140,9 +141,11 @@ var Util = function() { }; /** - * calculates a 16bit sum of a string by adding each character codes modulus 65535 - * @param text [String] string to create a sum of - * @return [Integer] an integer containing the sum of all character codes % 65535 + * Calculates a 16bit sum of a string by adding each character + * codes modulus 65535 + * @param {String} text String to create a sum of + * @return {Integer} An integer containing the sum of all character + * codes % 65535 */ this.calc_checksum = function(text) { var checksum = { s: 0, add: function (sadd) { this.s = (this.s + sadd) % 65536; }}; @@ -159,8 +162,9 @@ var Util = function() { * Javascript context MUST define * a "showMessages(text)" function. Line feeds ('\n') * are automatically converted to HTML line feeds '
' - * @param str [String] string of the debug message - * @return [String] an HTML tt entity containing a paragraph with a style attribute where the debug message is HTMLencoded in. + * @param {String} str String of the debug message + * @return {String} An HTML tt entity containing a paragraph with a + * style attribute where the debug message is HTMLencoded in. */ this.print_debug = function(str) { if (openpgp.config.debug) { @@ -177,8 +181,9 @@ var Util = function() { * a "showMessages(text)" function. Line feeds ('\n') * are automatically converted to HTML line feeds '
' * Different than print_debug because will call hexstrdump iff necessary. - * @param str [String] string of the debug message - * @return [String] an HTML tt entity containing a paragraph with a style attribute where the debug message is HTMLencoded in. + * @param {String} str String of the debug message + * @return {String} An HTML tt entity containing a paragraph with a + * style attribute where the debug message is HTMLencoded in. */ this.print_debug_hexstr_dump = function(str,strToHex) { if (openpgp.config.debug) { @@ -193,8 +198,9 @@ var Util = function() { * The calling Javascript context MUST define * a "showMessages(text)" function. Line feeds ('\n') * are automatically converted to HTML line feeds '
' - * @param str [String] string of the error message - * @return [String] a HTML paragraph entity with a style attribute containing the HTML encoded error message + * @param {String} str String of the error message + * @return {String} A HTML paragraph entity with a style attribute + * containing the HTML encoded error message */ this.print_error = function(str) { str = openpgp_encoding_html_encode(str); @@ -206,8 +212,9 @@ var Util = function() { * The calling Javascript context MUST define * a "showMessages(text)" function. Line feeds ('\n') * are automatically converted to HTML line feeds '
'. - * @param str [String] string of the info message - * @return [String] a HTML paragraph entity with a style attribute containing the HTML encoded info message + * @param {String} str String of the info message + * @return {String} A HTML paragraph entity with a style attribute + * containing the HTML encoded info message */ this.print_info = function(str) { str = openpgp_encoding_html_encode(str); @@ -227,11 +234,13 @@ var Util = function() { var result = string.substring(0, bytes); return this.shiftRight(result, 8-rest); // +String.fromCharCode(string.charCodeAt(bytes -1) << (8-rest) & 0xFF); }; + /** * Shifting a string to n bits right - * @param value [String] the string to shift - * @param bitcount [Integer] amount of bits to shift (MUST be smaller than 9) - * @return [String] resulting string. + * @param {String} value The string to shift + * @param {Integer} bitcount Amount of bits to shift (MUST be smaller + * than 9) + * @return {String} Resulting string. */ this.shiftRight = function(value, bitcount) { var temp = util.str2bin(value); @@ -249,7 +258,7 @@ var Util = function() { /** * Return the algorithm type as string - * @return [String] String representing the message type + * @return {String} String representing the message type */ this.get_hashAlgorithmString = function(algo) { switch(algo) {