Started modifying inline docs to work with jsdoc3 project, https://github.com/jsdoc3/jsdoc. Built doc based on our source and added to doc directory. Our inline docs need more cleanup, but this document structure looks promising.
This commit is contained in:
parent
207313da5a
commit
f300b0a1c0
468
doc/JXG.Util.html
Normal file
468
doc/JXG.Util.html
Normal file
File diff suppressed because one or more lines are too long
7382
doc/global.html
Normal file
7382
doc/global.html
Normal file
File diff suppressed because one or more lines are too long
141
doc/index.html
Normal file
141
doc/index.html
Normal file
File diff suppressed because one or more lines are too long
1245
doc/openpgp.html
Normal file
1245
doc/openpgp.html
Normal file
File diff suppressed because one or more lines are too long
278
doc/styles/jsdoc-default.css
Normal file
278
doc/styles/jsdoc-default.css
Normal file
|
@ -0,0 +1,278 @@
|
|||
html
|
||||
{
|
||||
overflow: auto;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
body
|
||||
{
|
||||
font: 14px "DejaVu Sans Condensed", "Liberation Sans", "Nimbus Sans L", Tahoma, Geneva, "Helvetica Neue", Helvetica, Arial, sans serif;
|
||||
line-height: 130%;
|
||||
color: #000;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
a {
|
||||
color: #444;
|
||||
}
|
||||
|
||||
a:visited {
|
||||
color: #444;
|
||||
}
|
||||
|
||||
a:active {
|
||||
color: #444;
|
||||
}
|
||||
|
||||
header
|
||||
{
|
||||
display: block;
|
||||
padding: 6px 4px;
|
||||
}
|
||||
|
||||
.class-description {
|
||||
font-style: italic;
|
||||
font-family: Palatino, 'Palatino Linotype', serif;
|
||||
font-size: 130%;
|
||||
line-height: 140%;
|
||||
margin-bottom: 1em;
|
||||
margin-top: 1em;
|
||||
}
|
||||
|
||||
#main {
|
||||
float: left;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
section
|
||||
{
|
||||
display: block;
|
||||
|
||||
background-color: #fff;
|
||||
padding: 12px 24px;
|
||||
border-bottom: 1px solid #ccc;
|
||||
margin-right: 240px;
|
||||
}
|
||||
|
||||
.variation {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.optional:after {
|
||||
content: "opt";
|
||||
font-size: 60%;
|
||||
color: #aaa;
|
||||
font-style: italic;
|
||||
font-weight: lighter;
|
||||
}
|
||||
|
||||
nav
|
||||
{
|
||||
display: block;
|
||||
float: left;
|
||||
margin-left: -230px;
|
||||
margin-top: 28px;
|
||||
width: 220px;
|
||||
border-left: 1px solid #ccc;
|
||||
padding-left: 9px;
|
||||
}
|
||||
|
||||
nav ul {
|
||||
font-family: 'Lucida Grande', 'Lucida Sans Unicode', arial, sans-serif;
|
||||
font-size: 100%;
|
||||
line-height: 17px;
|
||||
padding:0;
|
||||
margin:0;
|
||||
list-style-type:none;
|
||||
}
|
||||
|
||||
nav h2 a, nav h2 a:visited {
|
||||
color: #A35A00;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
nav h3 {
|
||||
margin-top: 12px;
|
||||
}
|
||||
|
||||
nav li {
|
||||
margin-top: 6px;
|
||||
}
|
||||
|
||||
nav a {
|
||||
color: #5C5954;
|
||||
}
|
||||
|
||||
nav a:visited {
|
||||
color: #5C5954;
|
||||
}
|
||||
|
||||
nav a:active {
|
||||
color: #5C5954;
|
||||
}
|
||||
|
||||
footer {
|
||||
display: block;
|
||||
padding: 6px;
|
||||
margin-top: 12px;
|
||||
font-style: italic;
|
||||
font-size: 90%;
|
||||
}
|
||||
|
||||
h1
|
||||
{
|
||||
font-size: 200%;
|
||||
font-weight: bold;
|
||||
letter-spacing: -0.01em;
|
||||
margin: 6px 0 9px 0;
|
||||
}
|
||||
|
||||
h2
|
||||
{
|
||||
font-size: 170%;
|
||||
font-weight: bold;
|
||||
letter-spacing: -0.01em;
|
||||
margin: 6px 0 3px 0;
|
||||
}
|
||||
|
||||
h3
|
||||
{
|
||||
font-size: 150%;
|
||||
font-weight: bold;
|
||||
letter-spacing: -0.01em;
|
||||
margin-top: 16px;
|
||||
margin: 6px 0 3px 0;
|
||||
}
|
||||
|
||||
h4
|
||||
{
|
||||
font-size: 130%;
|
||||
font-weight: bold;
|
||||
letter-spacing: -0.01em;
|
||||
margin-top: 16px;
|
||||
margin: 18px 0 3px 0;
|
||||
color: #A35A00;
|
||||
}
|
||||
|
||||
h5, .container-overview .subsection-title
|
||||
{
|
||||
font-size: 120%;
|
||||
font-weight: bold;
|
||||
letter-spacing: -0.01em;
|
||||
margin: 8px 0 3px -16px;
|
||||
}
|
||||
|
||||
h6
|
||||
{
|
||||
font-size: 100%;
|
||||
letter-spacing: -0.01em;
|
||||
margin: 6px 0 3px 0;
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
.ancestors { color: #999; }
|
||||
.ancestors a
|
||||
{
|
||||
color: #999 !important;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.important
|
||||
{
|
||||
font-weight: bold;
|
||||
color: #950B02;
|
||||
}
|
||||
|
||||
.yes-def {
|
||||
text-indent: -1000px;
|
||||
}
|
||||
|
||||
.type-signature {
|
||||
color: #aaa;
|
||||
}
|
||||
|
||||
.name, .signature {
|
||||
font-family: Consolas, "Lucida Console", Monaco, monospace;
|
||||
}
|
||||
|
||||
.details { margin-top: 14px; }
|
||||
.details dt { width:100px; float:left; border-left: 2px solid #DDD; padding-left: 10px; padding-top: 6px; }
|
||||
.details dd { margin-left: 50px; }
|
||||
.details ul { margin: 0; }
|
||||
.details ul { list-style-type: none; }
|
||||
.details li { margin-left: 30px; padding-top: 6px; }
|
||||
|
||||
.description {
|
||||
margin-bottom: 1em;
|
||||
margin-left: -16px;
|
||||
margin-top: 1em;
|
||||
}
|
||||
|
||||
.code-caption
|
||||
{
|
||||
font-style: italic;
|
||||
font-family: Palatino, 'Palatino Linotype', serif;
|
||||
font-size: 107%;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.sh_sourceCode
|
||||
{
|
||||
border: 1px solid #ddd;
|
||||
width: 80%;
|
||||
}
|
||||
|
||||
.sh_sourceCode code
|
||||
{
|
||||
font-family: Consolas, 'Lucida Console', Monaco, monospace;
|
||||
font-size: 100%;
|
||||
line-height: 18px;
|
||||
display: block;
|
||||
padding: 4px 12px;
|
||||
margin: 0;
|
||||
background-color: #fff;
|
||||
color: #000;
|
||||
border-left: 3px #ddd solid;
|
||||
}
|
||||
|
||||
.params, .props
|
||||
{
|
||||
border-spacing: 0;
|
||||
border: 0;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
|
||||
.params .name, .props .name, .name code {
|
||||
color: #A35A00;
|
||||
font-family: Consolas, 'Lucida Console', Monaco, monospace;
|
||||
font-size: 100%;
|
||||
}
|
||||
|
||||
.params td, .params th, .props td, .props th
|
||||
{
|
||||
border: 1px solid #ddd;
|
||||
margin: 0px;
|
||||
text-align: left;
|
||||
vertical-align: top;
|
||||
padding: 4px 6px;
|
||||
display: table-cell;
|
||||
}
|
||||
|
||||
.params thead tr, .props thead tr
|
||||
{
|
||||
background-color: #ddd;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.params .params thead tr, .props .props thead tr
|
||||
{
|
||||
background-color: #fff;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.params th, .props th { border-right: 1px solid #aaa; }
|
||||
.params thead .last, .props thead .last { border-right: 1px solid #ddd; }
|
||||
|
||||
.disabled {
|
||||
color: #454545;
|
||||
}
|
150
doc/styles/node-dark.css
Normal file
150
doc/styles/node-dark.css
Normal file
|
@ -0,0 +1,150 @@
|
|||
.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;
|
||||
}
|
|
@ -657,9 +657,9 @@ function openpgp_packet_signature() {
|
|||
};
|
||||
/**
|
||||
* verifys the signature packet. Note: not signature types are implemented
|
||||
* @param data [String] data which on the signature applies
|
||||
* @param key [openpgp_msg_privatekey] the public key to verify the signature
|
||||
* @return
|
||||
* @param {String} data data which on the signature applies
|
||||
* @param {openpgp_msg_privatekey} key the public key to verify the signature
|
||||
* @return {boolean} True if message is verified, else false.
|
||||
*/
|
||||
function verify(data, key) {
|
||||
switch(this.signatureType) {
|
||||
|
@ -7160,7 +7160,7 @@ function RSA() {
|
|||
* RSA q as BigInteger
|
||||
* @param u
|
||||
* RSA u as BigInteger
|
||||
* @return
|
||||
* @return {BigInteger} The decrypted value of the message
|
||||
*/
|
||||
function decrypt(m, d, p, q, u) {
|
||||
var xp = m.mod(p).modPow(d.mod(p.subtract(BigInteger.ONE)), p);
|
||||
|
@ -9570,6 +9570,9 @@ function openpgp_crypto_generateKeyPair(keyType, numBits, passphrase, s2kHash, s
|
|||
/**
|
||||
* GPG4Browsers Core interface. A single instance is hold
|
||||
* from the beginning. To use this library call "openpgp.init()"
|
||||
* @alias openpgp
|
||||
* @class
|
||||
* @classdesc Main Openpgp.js class. Use this to initiate and make all calls to this library.
|
||||
*/
|
||||
function _openpgp () {
|
||||
this.tostring = "";
|
||||
|
@ -9590,9 +9593,9 @@ function _openpgp () {
|
|||
/**
|
||||
* reads several publicKey objects from a ascii armored
|
||||
* representation an returns openpgp_msg_publickey packets
|
||||
* @param armoredText [String] OpenPGP armored text containing
|
||||
* @param {String} armoredText OpenPGP armored text containing
|
||||
* the public key(s)
|
||||
* @return [Array[openpgp_msg_publickey]] on error the function
|
||||
* @return {Array[openpgp_msg_publickey]} on error the function
|
||||
* returns null
|
||||
*/
|
||||
function read_publicKey(armoredText) {
|
||||
|
@ -9636,9 +9639,9 @@ function _openpgp () {
|
|||
/**
|
||||
* reads several privateKey objects from a ascii armored
|
||||
* representation an returns openpgp_msg_privatekey objects
|
||||
* @param armoredText [String] OpenPGP armored text containing
|
||||
* @param {String} armoredText OpenPGP armored text containing
|
||||
* the private key(s)
|
||||
* @return [Array[openpgp_msg_privatekey]] on error the function
|
||||
* @return {Array[openpgp_msg_privatekey]} on error the function
|
||||
* returns null
|
||||
*/
|
||||
function read_privateKey(armoredText) {
|
||||
|
@ -9667,8 +9670,8 @@ function _openpgp () {
|
|||
/**
|
||||
* reads message packets out of an OpenPGP armored text and
|
||||
* returns an array of message objects
|
||||
* @param armoredText [String] text to be parsed
|
||||
* @return [Array[openpgp_msg_message]] on error the function
|
||||
* @param {String} armoredText text to be parsed
|
||||
* @return {Array[openpgp_msg_message]} on error the function
|
||||
* returns null
|
||||
*/
|
||||
function read_message(armoredText) {
|
||||
|
@ -9800,10 +9803,10 @@ 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 privatekey {obj: [openpgp_msg_privatekey]} private key to be used to sign the message
|
||||
* @param publickeys [Array {obj: [openpgp_msg_publickey]}] public keys to be used to encrypt the message
|
||||
* @param messagetext [String] message text to encrypt and sign
|
||||
* @return [String] a binary string representation of the message which can be OpenPGP armored
|
||||
* @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 {String} messagetext message text to encrypt and sign
|
||||
* @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 = "";
|
||||
|
@ -9856,10 +9859,10 @@ function _openpgp () {
|
|||
/**
|
||||
* creates a binary string representation of an encrypted message.
|
||||
* The message will be encrypted with the public keys specified
|
||||
* @param publickeys [Array {obj: [openpgp_msg_publickey]}] public
|
||||
* @param {Array {obj: [openpgp_msg_publickey]}} publickeys public
|
||||
* keys to be used to encrypt the message
|
||||
* @param messagetext [String] message text to encrypt
|
||||
* @return [String] a binary string representation of the message
|
||||
* @param {String} messagetext message text to encrypt
|
||||
* @return {String} a binary string representation of the message
|
||||
* which can be OpenPGP armored
|
||||
*/
|
||||
function write_encrypted_message(publickeys, messagetext) {
|
||||
|
@ -9898,10 +9901,10 @@ function _openpgp () {
|
|||
/**
|
||||
* creates a binary string representation a signed message.
|
||||
* The message will be signed with the specified private key.
|
||||
* @param privatekey {obj: [openpgp_msg_privatekey]} private
|
||||
* @param {obj: [openpgp_msg_privatekey]} privatekey private
|
||||
* key to be used to sign the message
|
||||
* @param messagetext [String] message text to sign
|
||||
* @return [Object: text [String], openpgp: [String] a binary
|
||||
* @param {String} messagetext message text to sign
|
||||
* @return {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
|
||||
*/
|
||||
|
@ -9913,9 +9916,9 @@ function _openpgp () {
|
|||
|
||||
/**
|
||||
* generates a new key pair for openpgp. Beta stage. Currently only supports RSA keys, and no subkeys.
|
||||
* @param keyType [int] to indicate what type of key to make. RSA is 1. Follows algorithms outlined in OpenPGP.
|
||||
* @param numBits [int] number of bits for the key creation. (should be 1024+, generally)
|
||||
* @userId [string] assumes already in form of "User Name <username@email.com>"
|
||||
* @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 <username@email.com>"
|
||||
* @return {privateKey: [openpgp_msg_privatekey], privateKeyArmored: [string], publicKeyArmored: [string]}
|
||||
*/
|
||||
function generate_key_pair(keyType, numBits, userId, passphrase){
|
||||
|
@ -10256,7 +10259,7 @@ function openpgp_config() {
|
|||
keyserver: "keyserver.linux.it" // "pgp.mit.edu:11371"
|
||||
};
|
||||
|
||||
this.versionstring ="OpenPGP.js 20120730";
|
||||
this.versionstring ="OpenPGP.js v.1.20120821";
|
||||
this.commentstring ="http://openpgpjs.org";
|
||||
/**
|
||||
* reads the config out of the HTML5 local storage
|
||||
|
@ -10772,7 +10775,7 @@ function openpgp_encoding_armor_addheader() {
|
|||
* @param data
|
||||
* @param partindex
|
||||
* @param parttotal
|
||||
* @return
|
||||
* @return {string} Armored text
|
||||
*/
|
||||
function openpgp_encoding_armor(messagetype, data, partindex, parttotal) {
|
||||
var result = "";
|
||||
|
@ -14794,7 +14797,7 @@ function openpgp_keyring() {
|
|||
|
||||
/**
|
||||
* Checks if at least one private key is in the keyring
|
||||
* @return
|
||||
* @return {boolean} True if there are private keys, else false.
|
||||
*/
|
||||
function hasPrivateKey() {
|
||||
return this.privateKeys.length > 0;
|
||||
|
@ -14822,7 +14825,7 @@ function openpgp_keyring() {
|
|||
/**
|
||||
* searches all public keys in the keyring matching the address or address part of the user ids
|
||||
* @param email_address
|
||||
* @return
|
||||
* @return {array[openpgp_msg_publickey]} the public keys associated with provided email address.
|
||||
*/
|
||||
function getPublicKeyForAddress(email_address) {
|
||||
var results = new Array();
|
||||
|
@ -14849,8 +14852,8 @@ function openpgp_keyring() {
|
|||
|
||||
/**
|
||||
* Searches the keyring for a private key containing the specified email address
|
||||
* @param email_address [String] email address to search for
|
||||
* @return [Array[openpgp_msg_privatekey] private keys found
|
||||
* @param {String} email_address email address to search for
|
||||
* @return {Array[openpgp_msg_privatekey} private keys found
|
||||
*/
|
||||
function getPrivateKeyForAddress(email_address) {
|
||||
var results = new Array();
|
||||
|
@ -14878,7 +14881,7 @@ function openpgp_keyring() {
|
|||
/**
|
||||
* 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
|
||||
* @return {Array[openpgp_msg_privatekey]} public keys found
|
||||
*/
|
||||
function getPublicKeysForKeyId(keyId) {
|
||||
var result = new Array();
|
||||
|
|
2
resources/openpgp.min.js
vendored
2
resources/openpgp.min.js
vendored
|
@ -392,7 +392,7 @@ return this.len=a-c};this.write=function(){};this.toString=function(){for(var a=
|
|||
this.subKeys.length;b++)a+=" "+this.subKeys[b].toString();return a};this.validate=function(){for(var a=0;a<this.revocationSignatures.length;a++)if(this.revocationSignatures[a].verify(this.publicKeyPacket.header+this.publicKeyPacket.data,this.publicKeyPacket))return!1;if(0!=this.subKeys.length){for(var b=!1,a=0;a<this.subKeys.length;a++)if(3==this.subKeys[a].verifyKey()){b=!0;break}if(!b)return!1}b=!1;for(a=0;a<this.userIds.length;a++)if(0==this.userIds[a].verify(this.publicKeyPacket)){b=!0;break}return!b?
|
||||
!1:!0};this.getFingerprint=function(){return this.publicKeyPacket.getFingerprint()};this.getKeyId=function(){return this.publicKeyPacket.getKeyId()};this.verifyBasicSignatures=function(){for(var a=0;a<this.revocationSignatures.length;)return this.revocationSignatures[a].verify(this.publicKeyPacket.header+this.publicKeyPacket.data,this.publicKeyPacket),!1;if(0!=this.subKeys.length){for(var b=!1,a=0;a<this.subKeys.length;a++)if(null!=this.subKeys[a]&&3==this.subKeys[a].verifyKey()){b=!0;break}if(!b)return!1}b=
|
||||
this.getKeyId();for(a=0;a<this.userIds.length;a++)for(var c=0;c<this.userIds[a].certificationRevocationSignatures.length;c++)if(this.userIds[a].certificationSignatures[c].getIssuer==b&&4!=this.userIds[a].certificationSignatures[c].verifyBasic(this.publicKeyPacket))return!1;return!0}}
|
||||
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 20120730";this.commentstring="http://openpgpjs.org";this.debug=!1;this.read=function(){var a=JSON.parse(window.localStorage.getItem("config"));null==a?(this.config=this.default_config,this.write()):this.config=a};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.20120821";this.commentstring="http://openpgpjs.org";this.debug=!1;this.read=function(){var a=JSON.parse(window.localStorage.getItem("config"));null==a?(this.config=this.default_config,this.write()):this.config=a};this.write=function(){window.localStorage.setItem("config",
|
||||
JSON.stringify(this.config))}}
|
||||
function openpgp_msg_privatekey(){this.subKeys=[];this.privateKeyPacket=null;this.userIds=[];this.userAttributes=[];this.revocationSignatures=[];this.subKeys=[];this.getSigningKey=function(){if((17==this.privateKeyPacket.publicKey.publicKeyAlgorithm||2!=this.privateKeyPacket.publicKey.publicKeyAlgorithm)&&3==this.privateKeyPacket.publicKey.verifyKey())return this.privateKeyPacket;if(4==this.privateKeyPacket.publicKey.version)for(var a=0;a<this.privateKeyPacket.subKeys.length;a++)if((17==this.privateKeyPacket.subKeys[a].publicKey.publicKeyAlgorithm||
|
||||
2!=this.privateKeyPacket.subKeys[a].publicKey.publicKeyAlgorithm)&&3==this.privateKeyPacket.subKeys[a].publicKey.verifyKey())return this.privateKeyPacket.subKeys[a];return null};this.getFingerprint=function(){return this.privateKeyPacket.publicKey.getFingerprint()};this.getPreferredSignatureHashAlgorithm=function(){var a=this.getSigningKey();return null==a?(util.print_error("private key is for encryption only! Cannot create a signature."),null):17==a.publicKey.publicKeyAlgorithm?(new DSA).select_hash_algorithm(a.publicKey.MPIs[1].toBigInteger()):
|
||||
|
|
|
@ -39,7 +39,7 @@ function RSA() {
|
|||
* RSA q as BigInteger
|
||||
* @param u
|
||||
* RSA u as BigInteger
|
||||
* @return
|
||||
* @return {BigInteger} The decrypted value of the message
|
||||
*/
|
||||
function decrypt(m, d, p, q, u) {
|
||||
var xp = m.mod(p).modPow(d.mod(p.subtract(BigInteger.ONE)), p);
|
||||
|
|
|
@ -122,7 +122,7 @@ function openpgp_encoding_armor_addheader() {
|
|||
* @param data
|
||||
* @param partindex
|
||||
* @param parttotal
|
||||
* @return
|
||||
* @return {string} Armored text
|
||||
*/
|
||||
function openpgp_encoding_armor(messagetype, data, partindex, parttotal) {
|
||||
var result = "";
|
||||
|
|
|
@ -18,6 +18,9 @@
|
|||
/**
|
||||
* GPG4Browsers Core interface. A single instance is hold
|
||||
* from the beginning. To use this library call "openpgp.init()"
|
||||
* @alias openpgp
|
||||
* @class
|
||||
* @classdesc Main Openpgp.js class. Use this to initiate and make all calls to this library.
|
||||
*/
|
||||
function _openpgp () {
|
||||
this.tostring = "";
|
||||
|
@ -38,9 +41,9 @@ function _openpgp () {
|
|||
/**
|
||||
* reads several publicKey objects from a ascii armored
|
||||
* representation an returns openpgp_msg_publickey packets
|
||||
* @param armoredText [String] OpenPGP armored text containing
|
||||
* @param {String} armoredText OpenPGP armored text containing
|
||||
* the public key(s)
|
||||
* @return [Array[openpgp_msg_publickey]] on error the function
|
||||
* @return {Array[openpgp_msg_publickey]} on error the function
|
||||
* returns null
|
||||
*/
|
||||
function read_publicKey(armoredText) {
|
||||
|
@ -84,9 +87,9 @@ function _openpgp () {
|
|||
/**
|
||||
* reads several privateKey objects from a ascii armored
|
||||
* representation an returns openpgp_msg_privatekey objects
|
||||
* @param armoredText [String] OpenPGP armored text containing
|
||||
* @param {String} armoredText OpenPGP armored text containing
|
||||
* the private key(s)
|
||||
* @return [Array[openpgp_msg_privatekey]] on error the function
|
||||
* @return {Array[openpgp_msg_privatekey]} on error the function
|
||||
* returns null
|
||||
*/
|
||||
function read_privateKey(armoredText) {
|
||||
|
@ -115,8 +118,8 @@ function _openpgp () {
|
|||
/**
|
||||
* reads message packets out of an OpenPGP armored text and
|
||||
* returns an array of message objects
|
||||
* @param armoredText [String] text to be parsed
|
||||
* @return [Array[openpgp_msg_message]] on error the function
|
||||
* @param {String} armoredText text to be parsed
|
||||
* @return {Array[openpgp_msg_message]} on error the function
|
||||
* returns null
|
||||
*/
|
||||
function read_message(armoredText) {
|
||||
|
@ -248,10 +251,10 @@ 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 privatekey {obj: [openpgp_msg_privatekey]} private key to be used to sign the message
|
||||
* @param publickeys [Array {obj: [openpgp_msg_publickey]}] public keys to be used to encrypt the message
|
||||
* @param messagetext [String] message text to encrypt and sign
|
||||
* @return [String] a binary string representation of the message which can be OpenPGP armored
|
||||
* @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 {String} messagetext message text to encrypt and sign
|
||||
* @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 = "";
|
||||
|
@ -304,10 +307,10 @@ function _openpgp () {
|
|||
/**
|
||||
* creates a binary string representation of an encrypted message.
|
||||
* The message will be encrypted with the public keys specified
|
||||
* @param publickeys [Array {obj: [openpgp_msg_publickey]}] public
|
||||
* @param {Array {obj: [openpgp_msg_publickey]}} publickeys public
|
||||
* keys to be used to encrypt the message
|
||||
* @param messagetext [String] message text to encrypt
|
||||
* @return [String] a binary string representation of the message
|
||||
* @param {String} messagetext message text to encrypt
|
||||
* @return {String} a binary string representation of the message
|
||||
* which can be OpenPGP armored
|
||||
*/
|
||||
function write_encrypted_message(publickeys, messagetext) {
|
||||
|
@ -346,10 +349,10 @@ function _openpgp () {
|
|||
/**
|
||||
* creates a binary string representation a signed message.
|
||||
* The message will be signed with the specified private key.
|
||||
* @param privatekey {obj: [openpgp_msg_privatekey]} private
|
||||
* @param {obj: [openpgp_msg_privatekey]} privatekey private
|
||||
* key to be used to sign the message
|
||||
* @param messagetext [String] message text to sign
|
||||
* @return [Object: text [String], openpgp: [String] a binary
|
||||
* @param {String} messagetext message text to sign
|
||||
* @return {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
|
||||
*/
|
||||
|
@ -361,9 +364,9 @@ function _openpgp () {
|
|||
|
||||
/**
|
||||
* generates a new key pair for openpgp. Beta stage. Currently only supports RSA keys, and no subkeys.
|
||||
* @param keyType [int] to indicate what type of key to make. RSA is 1. Follows algorithms outlined in OpenPGP.
|
||||
* @param numBits [int] number of bits for the key creation. (should be 1024+, generally)
|
||||
* @userId [string] assumes already in form of "User Name <username@email.com>"
|
||||
* @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 <username@email.com>"
|
||||
* @return {privateKey: [openpgp_msg_privatekey], privateKeyArmored: [string], publicKeyArmored: [string]}
|
||||
*/
|
||||
function generate_key_pair(keyType, numBits, userId, passphrase){
|
||||
|
|
|
@ -54,7 +54,7 @@ function openpgp_keyring() {
|
|||
|
||||
/**
|
||||
* Checks if at least one private key is in the keyring
|
||||
* @return
|
||||
* @return {boolean} True if there are private keys, else false.
|
||||
*/
|
||||
function hasPrivateKey() {
|
||||
return this.privateKeys.length > 0;
|
||||
|
@ -82,7 +82,7 @@ function openpgp_keyring() {
|
|||
/**
|
||||
* searches all public keys in the keyring matching the address or address part of the user ids
|
||||
* @param email_address
|
||||
* @return
|
||||
* @return {array[openpgp_msg_publickey]} the public keys associated with provided email address.
|
||||
*/
|
||||
function getPublicKeyForAddress(email_address) {
|
||||
var results = new Array();
|
||||
|
@ -109,8 +109,8 @@ function openpgp_keyring() {
|
|||
|
||||
/**
|
||||
* Searches the keyring for a private key containing the specified email address
|
||||
* @param email_address [String] email address to search for
|
||||
* @return [Array[openpgp_msg_privatekey] private keys found
|
||||
* @param {String} email_address email address to search for
|
||||
* @return {Array[openpgp_msg_privatekey} private keys found
|
||||
*/
|
||||
function getPrivateKeyForAddress(email_address) {
|
||||
var results = new Array();
|
||||
|
@ -138,7 +138,7 @@ function openpgp_keyring() {
|
|||
/**
|
||||
* 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
|
||||
* @return {Array[openpgp_msg_privatekey]} public keys found
|
||||
*/
|
||||
function getPublicKeysForKeyId(keyId) {
|
||||
var result = new Array();
|
||||
|
|
|
@ -477,9 +477,9 @@ function openpgp_packet_signature() {
|
|||
};
|
||||
/**
|
||||
* verifys the signature packet. Note: not signature types are implemented
|
||||
* @param data [String] data which on the signature applies
|
||||
* @param key [openpgp_msg_privatekey] the public key to verify the signature
|
||||
* @return
|
||||
* @param {String} data data which on the signature applies
|
||||
* @param {openpgp_msg_privatekey} key the public key to verify the signature
|
||||
* @return {boolean} True if message is verified, else false.
|
||||
*/
|
||||
function verify(data, key) {
|
||||
switch(this.signatureType) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user