Commit 40c415e8 authored by 王亚晖's avatar 王亚晖

添加换热站趋势图

parent 80610aeb
...@@ -1954,6 +1954,11 @@ ...@@ -1954,6 +1954,11 @@
"resolved": "https://registry.npmmirror.com/jsbn/-/jsbn-1.1.0.tgz", "resolved": "https://registry.npmmirror.com/jsbn/-/jsbn-1.1.0.tgz",
"integrity": "sha512-4bYVV3aAMtDTTu4+xsDYa6sy9GyJ69/amsu9sYF2zqjiEoZA5xJi3BrfX3uY+/IekIu7MwdObdbDWpoZdBv3/A==" "integrity": "sha512-4bYVV3aAMtDTTu4+xsDYa6sy9GyJ69/amsu9sYF2zqjiEoZA5xJi3BrfX3uY+/IekIu7MwdObdbDWpoZdBv3/A=="
}, },
"node_modules/jsencrypt": {
"version": "3.3.2",
"resolved": "https://registry.npmjs.org/jsencrypt/-/jsencrypt-3.3.2.tgz",
"integrity": "sha512-arQR1R1ESGdAxY7ZheWr12wCaF2yF47v5qpB76TtV64H1pyGudk9Hvw8Y9tb/FiTIaaTRUyaSnm5T/Y53Ghm/A=="
},
"node_modules/jsesc": { "node_modules/jsesc": {
"version": "2.5.2", "version": "2.5.2",
"resolved": "https://registry.npmmirror.com/jsesc/-/jsesc-2.5.2.tgz", "resolved": "https://registry.npmmirror.com/jsesc/-/jsesc-2.5.2.tgz",
......
{ {
"hash": "728b07f4", "hash": "84d200a5",
"configHash": "2effb732", "configHash": "2effb732",
"lockfileHash": "ca013c0c", "lockfileHash": "7241a640",
"browserHash": "77d5c9ae", "browserHash": "66931b30",
"optimized": { "optimized": {
"@amap/amap-jsapi-loader": { "@amap/amap-jsapi-loader": {
"src": "../../@amap/amap-jsapi-loader/dist/index.js", "src": "../../@amap/amap-jsapi-loader/dist/index.js",
"file": "@amap_amap-jsapi-loader.js", "file": "@amap_amap-jsapi-loader.js",
"fileHash": "e33c347a", "fileHash": "b0393ce1",
"needsInterop": true "needsInterop": true
}, },
"@element-plus/icons-vue": { "@element-plus/icons-vue": {
"src": "../../@element-plus/icons-vue/dist/index.js", "src": "../../@element-plus/icons-vue/dist/index.js",
"file": "@element-plus_icons-vue.js", "file": "@element-plus_icons-vue.js",
"fileHash": "6517ce14", "fileHash": "ea7f5bdb",
"needsInterop": false "needsInterop": false
}, },
"@kyvg/vue3-notification": { "@kyvg/vue3-notification": {
"src": "../../@kyvg/vue3-notification/dist/index.es.js", "src": "../../@kyvg/vue3-notification/dist/index.es.js",
"file": "@kyvg_vue3-notification.js", "file": "@kyvg_vue3-notification.js",
"fileHash": "c4ea0ef4", "fileHash": "b1a921e5",
"needsInterop": false "needsInterop": false
}, },
"@vue/reactivity": { "@vue/reactivity": {
"src": "../../@vue/reactivity/dist/reactivity.esm-bundler.js", "src": "../../@vue/reactivity/dist/reactivity.esm-bundler.js",
"file": "@vue_reactivity.js", "file": "@vue_reactivity.js",
"fileHash": "beb0fcfa", "fileHash": "bfd63396",
"needsInterop": false "needsInterop": false
}, },
"axios": { "axios": {
"src": "../../axios/index.js", "src": "../../axios/index.js",
"file": "axios.js", "file": "axios.js",
"fileHash": "4662a888", "fileHash": "b67450ae",
"needsInterop": false "needsInterop": false
}, },
"echarts": { "echarts": {
"src": "../../echarts/index.js", "src": "../../echarts/index.js",
"file": "echarts.js", "file": "echarts.js",
"fileHash": "fdae03b4", "fileHash": "6cbfcbc7",
"needsInterop": false "needsInterop": false
}, },
"element-plus": { "element-plus": {
"src": "../../element-plus/es/index.mjs", "src": "../../element-plus/es/index.mjs",
"file": "element-plus.js", "file": "element-plus.js",
"fileHash": "3dd15b0a", "fileHash": "4d9594dd",
"needsInterop": false "needsInterop": false
}, },
"element-plus/dist/locale/zh-cn.mjs": { "element-plus/dist/locale/zh-cn.mjs": {
"src": "../../element-plus/dist/locale/zh-cn.mjs", "src": "../../element-plus/dist/locale/zh-cn.mjs",
"file": "element-plus_dist_locale_zh-cn__mjs.js", "file": "element-plus_dist_locale_zh-cn__mjs.js",
"fileHash": "fb2a6fcd", "fileHash": "5a3c9da9",
"needsInterop": false "needsInterop": false
}, },
"mitt": { "mitt": {
"src": "../../mitt/dist/mitt.mjs", "src": "../../mitt/dist/mitt.mjs",
"file": "mitt.js", "file": "mitt.js",
"fileHash": "d14a1f1d", "fileHash": "d2652564",
"needsInterop": false "needsInterop": false
}, },
"vue": { "vue": {
"src": "../../vue/dist/vue.runtime.esm-bundler.js", "src": "../../vue/dist/vue.runtime.esm-bundler.js",
"file": "vue.js", "file": "vue.js",
"fileHash": "1f897608", "fileHash": "5ffbe2f8",
"needsInterop": false "needsInterop": false
}, },
"vue-router": { "vue-router": {
"src": "../../vue-router/dist/vue-router.mjs", "src": "../../vue-router/dist/vue-router.mjs",
"file": "vue-router.js", "file": "vue-router.js",
"fileHash": "50571a34", "fileHash": "7af39549",
"needsInterop": false "needsInterop": false
}, },
"vue3-smooth-scroll": { "vue3-smooth-scroll": {
"src": "../../vue3-smooth-scroll/dist/vue-smooth-scroll.min.js", "src": "../../vue3-smooth-scroll/dist/vue-smooth-scroll.min.js",
"file": "vue3-smooth-scroll.js", "file": "vue3-smooth-scroll.js",
"fileHash": "7ec9fce0", "fileHash": "c46eba72",
"needsInterop": true "needsInterop": true
}, },
"vuex": { "vuex": {
"src": "../../vuex/dist/vuex.esm-bundler.js", "src": "../../vuex/dist/vuex.esm-bundler.js",
"file": "vuex.js", "file": "vuex.js",
"fileHash": "838b51ec", "fileHash": "0db221f9",
"needsInterop": false "needsInterop": false
} }
}, },
......
File: /src/LICENSE.txt
The MIT License (MIT)
Copyright (c) 2015 Form.io
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", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
File: /lib/jsrsasign/LICENSE.txt
CONTAINS CODE FROM YUI LIBRARY SEE LICENSE @ http://yuilibrary.com/license/
The 'jsrsasign'(RSA-Sign JavaScript Library) License
Copyright (c) 2010-2013 Kenji Urushima
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", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
File: /lib/jsbn/LICENSE.txt
Licensing
---------
This software is covered under the following copyright:
/*
* Copyright (c) 2003-2005 Tom Wu
* All Rights Reserved.
*
* 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.
*/
Address all questions regarding this license to:
Tom Wu
tjw@cs.Stanford.EDU
File: /lib/asn1js/LICENSE.txt
ASN.1 JavaScript decoder
Copyright (c) 2008-2013 Lapo Luchini <lapo@lapo.it>
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
\ No newline at end of file
Website
======================
http://travistidwell.com/jsencrypt
Introduction
======================
When browsing the internet looking for a good solution to RSA Javascript
encryption, there is a whole slew of libraries that basically take the fantastic
work done by Tom Wu @ http://www-cs-students.stanford.edu/~tjw/jsbn/ and then
modify that code to do what they want.
What I couldn't find, however, was a simple wrapper around this library that
basically uses the library <a href="https://github.com/travist/jsencrypt/pull/6">practically</a> untouched, but adds a wrapper to provide parsing of
actual Private and Public key-pairs generated with OpenSSL.
This library is the result of these efforts.
How to use this library.
=======================
This library should work hand-in-hand with openssl. With that said, here is how to use this library.
- Within your terminal (Unix based OS) type the following.
```
openssl genrsa -out rsa_1024_priv.pem 1024
```
- This generates a private key, which you can see by doing the following...
```
cat rsa_1024_priv.pem
```
- You can then copy and paste this in the Private Key section of within index.html.
- Next, you can then get the public key by executing the following command.
```
openssl rsa -pubout -in rsa_1024_priv.pem -out rsa_1024_pub.pem
```
- You can see the public key by typing...
```
cat rsa_1024_pub.pem
```
- Now copy and paste this in the Public key within the index.html.
- Now you can then convert to and from encrypted text by doing the following in code.
```html
<!doctype html>
<html>
<head>
<title>JavaScript RSA Encryption</title>
<script src="http://code.jquery.com/jquery-1.8.3.min.js"></script>
<script src="bin/jsencrypt.min.js"></script>
<script type="text/javascript">
// Call this code when the page is done loading.
$(function() {
// Run a quick encryption/decryption when they click.
$('#testme').click(function() {
// Encrypt with the public key...
var encrypt = new JSEncrypt();
encrypt.setPublicKey($('#pubkey').val());
var encrypted = encrypt.encrypt($('#input').val());
// Decrypt with the private key...
var decrypt = new JSEncrypt();
decrypt.setPrivateKey($('#privkey').val());
var uncrypted = decrypt.decrypt(encrypted);
// Now a simple check to see if the round-trip worked.
if (uncrypted == $('#input').val()) {
alert('It works!!!');
}
else {
alert('Something went wrong....');
}
});
});
</script>
</head>
<body>
<label for="privkey">Private Key</label><br/>
<textarea id="privkey" rows="15" cols="65">-----BEGIN RSA PRIVATE KEY-----
MIICXQIBAAKBgQDlOJu6TyygqxfWT7eLtGDwajtNFOb9I5XRb6khyfD1Yt3YiCgQ
WMNW649887VGJiGr/L5i2osbl8C9+WJTeucF+S76xFxdU6jE0NQ+Z+zEdhUTooNR
aY5nZiu5PgDB0ED/ZKBUSLKL7eibMxZtMlUDHjm4gwQco1KRMDSmXSMkDwIDAQAB
AoGAfY9LpnuWK5Bs50UVep5c93SJdUi82u7yMx4iHFMc/Z2hfenfYEzu+57fI4fv
xTQ//5DbzRR/XKb8ulNv6+CHyPF31xk7YOBfkGI8qjLoq06V+FyBfDSwL8KbLyeH
m7KUZnLNQbk8yGLzB3iYKkRHlmUanQGaNMIJziWOkN+N9dECQQD0ONYRNZeuM8zd
8XJTSdcIX4a3gy3GGCJxOzv16XHxD03GW6UNLmfPwenKu+cdrQeaqEixrCejXdAF
z/7+BSMpAkEA8EaSOeP5Xr3ZrbiKzi6TGMwHMvC7HdJxaBJbVRfApFrE0/mPwmP5
rN7QwjrMY+0+AbXcm8mRQyQ1+IGEembsdwJBAN6az8Rv7QnD/YBvi52POIlRSSIM
V7SwWvSK4WSMnGb1ZBbhgdg57DXaspcwHsFV7hByQ5BvMtIduHcT14ECfcECQATe
aTgjFnqE/lQ22Rk0eGaYO80cc643BXVGafNfd9fcvwBMnk0iGX0XRsOozVt5Azil
psLBYuApa66NcVHJpCECQQDTjI2AQhFc1yRnCU/YgDnSpJVm1nASoRUnU8Jfm3Oz
uku7JUXcVpt08DFSceCEX9unCuMcT72rAQlLpdZir876
-----END RSA PRIVATE KEY-----</textarea><br/>
<label for="pubkey">Public Key</label><br/>
<textarea id="pubkey" rows="15" cols="65">-----BEGIN PUBLIC KEY-----
MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDlOJu6TyygqxfWT7eLtGDwajtN
FOb9I5XRb6khyfD1Yt3YiCgQWMNW649887VGJiGr/L5i2osbl8C9+WJTeucF+S76
xFxdU6jE0NQ+Z+zEdhUTooNRaY5nZiu5PgDB0ED/ZKBUSLKL7eibMxZtMlUDHjm4
gwQco1KRMDSmXSMkDwIDAQAB
-----END PUBLIC KEY-----</textarea><br/>
<label for="input">Text to encrypt:</label><br/>
<textarea id="input" name="input" type="text" rows=4 cols=70>This is a test!</textarea><br/>
<input id="testme" type="button" value="Test Me!!!" /><br/>
</body>
</html>
```
- Look at how http://www.travistidwell.com/jsencrypt/demo works to get a better idea.
- Signing and verification works in a similar way.
```javascript
// Sign with the private key...
var sign = new JSEncrypt();
sign.setPrivateKey($('#privkey').val());
var signature = sign.sign($('#input').val(), CryptoJS.SHA256, "sha256");
// Verify with the public key...
var verify = new JSEncrypt();
verify.setPublicKey($('#pubkey').val());
var verified = verify.verify($('#input').val(), signature, CryptoJS.SHA256);
// Now a simple check to see if the round-trip worked.
if (verified) {
alert('It works!!!');
}
else {
alert('Something went wrong....');
}
```
- Note that you have to provide the hash function. In this example we use one from the [CryptoJS](https://github.com/brix/crypto-js) library, but you can use whichever you want.
- Also, unless you use a custom hash function, you should provide the hash type to the `sign` method. Possible values are: `md2`, `md5`, `sha1`, `sha224`, `sha256`, `sha384`, `sha512`, `ripemd160`.
Other Information
========================
This library heavily utilizes the wonderful work of Tom Wu found at http://www-cs-students.stanford.edu/~tjw/jsbn/.
This jsbn library was written using the raw variables to perform encryption. This is great for encryption, but most private keys use a Private Key in the PEM format seen below.
1024 bit RSA Private Key in Base64 Format
-----------------------------------------
```
-----BEGIN RSA PRIVATE KEY-----
MIICXgIBAAKBgQDHikastc8+I81zCg/qWW8dMr8mqvXQ3qbPAmu0RjxoZVI47tvs
kYlFAXOf0sPrhO2nUuooJngnHV0639iTTEYG1vckNaW2R6U5QTdQ5Rq5u+uV3pMk
7w7Vs4n3urQ6jnqt2rTXbC1DNa/PFeAZatbf7ffBBy0IGO0zc128IshYcwIDAQAB
AoGBALTNl2JxTvq4SDW/3VH0fZkQXWH1MM10oeMbB2qO5beWb11FGaOO77nGKfWc
bYgfp5Ogrql4yhBvLAXnxH8bcqqwORtFhlyV68U1y4R+8WxDNh0aevxH8hRS/1X5
031DJm1JlU0E+vStiktN0tC3ebH5hE+1OxbIHSZ+WOWLYX7JAkEA5uigRgKp8ScG
auUijvdOLZIhHWq7y5Wz+nOHUuDw8P7wOTKU34QJAoWEe771p9Pf/GTA/kr0BQnP
QvWUDxGzJwJBAN05C6krwPeryFKrKtjOGJIniIoY72wRnoNcdEEs3HDRhf48YWFo
riRbZylzzzNFy/gmzT6XJQTfktGqq+FZD9UCQGIJaGrxHJgfmpDuAhMzGsUsYtTr
iRox0D1Iqa7dhE693t5aBG010OF6MLqdZA1CXrn5SRtuVVaCSLZEL/2J5UcCQQDA
d3MXucNnN4NPuS/L9HMYJWD7lPoosaORcgyK77bSSNgk+u9WSjbH1uYIAIPSffUZ
bti+jc1dUg5wb+aeZlgJAkEAurrpmpqj5vg087ZngKfFGR5rozDiTsK5DceTV97K
a3Y+Nzl+XWTxDBWk4YPh2ZlKv402hZEfWBYxUDn5ZkH/bw==
-----END RSA PRIVATE KEY-----
```
This library simply takes keys in the following format, and translates it to those variables needed to perform the encryptions used in Tom Wu's library.
Here are some good resources to investigate further.
- http://etherhack.co.uk/asymmetric/docs/rsa_key_breakdown.html
- http://www.di-mgt.com.au/rsa_alg.html
- https://polarssl.org/kb/cryptography/asn1-key-structures-in-der-and-pem
With this information, we can translate a private key format to the variables
required with the jsbn library from Tom Wu by using the following mappings.
```
modulus => n
public exponent => e
private exponent => d
prime1 => p
prime2 => q
exponent1 => dmp1
exponent2 => dmq1
coefficient => coeff
```
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
/**
* @fileOverview
* @name asn1-1.0.js
* @author Kenji Urushima kenji.urushima@gmail.com
* @version asn1 1.0.13 (2017-Jun-02)
* @since jsrsasign 2.1
* @license <a href="https://kjur.github.io/jsrsasign/license/">MIT License</a>
*/
import { JSEncryptRSAKey } from "./JSEncryptRSAKey";
export interface IJSEncryptOptions {
default_key_size?: string;
default_public_exponent?: string;
log?: boolean;
}
/**
*
* @param {Object} [options = {}] - An object to customize JSEncrypt behaviour
* possible parameters are:
* - default_key_size {number} default: 1024 the key size in bit
* - default_public_exponent {string} default: '010001' the hexadecimal representation of the public exponent
* - log {boolean} default: false whether log warn/error or not
* @constructor
*/
export declare class JSEncrypt {
constructor(options?: IJSEncryptOptions);
private default_key_size;
private default_public_exponent;
private log;
private key;
static version: string;
/**
* Method to set the rsa key parameter (one method is enough to set both the public
* and the private key, since the private key contains the public key paramenters)
* Log a warning if logs are enabled
* @param {Object|string} key the pem encoded string or an object (with or without header/footer)
* @public
*/
setKey(key: string): void;
/**
* Proxy method for setKey, for api compatibility
* @see setKey
* @public
*/
setPrivateKey(privkey: string): void;
/**
* Proxy method for setKey, for api compatibility
* @see setKey
* @public
*/
setPublicKey(pubkey: string): void;
/**
* Proxy method for RSAKey object's decrypt, decrypt the string using the private
* components of the rsa key object. Note that if the object was not set will be created
* on the fly (by the getKey method) using the parameters passed in the JSEncrypt constructor
* @param {string} str base64 encoded crypted string to decrypt
* @return {string} the decrypted string
* @public
*/
decrypt(str: string): string | false;
/**
* Proxy method for RSAKey object's encrypt, encrypt the string using the public
* components of the rsa key object. Note that if the object was not set will be created
* on the fly (by the getKey method) using the parameters passed in the JSEncrypt constructor
* @param {string} str the string to encrypt
* @return {string} the encrypted string encoded in base64
* @public
*/
encrypt(str: string): string | false;
/**
* Proxy method for RSAKey object's sign.
* @param {string} str the string to sign
* @param {function} digestMethod hash method
* @param {string} digestName the name of the hash algorithm
* @return {string} the signature encoded in base64
* @public
*/
sign(str: string, digestMethod: (str: string) => string, digestName: string): string | false;
/**
* Proxy method for RSAKey object's verify.
* @param {string} str the string to verify
* @param {string} signature the signature encoded in base64 to compare the string to
* @param {function} digestMethod hash method
* @return {boolean} whether the data and signature match
* @public
*/
verify(str: string, signature: string, digestMethod: (str: string) => string): boolean;
/**
* Getter for the current JSEncryptRSAKey object. If it doesn't exists a new object
* will be created and returned
* @param {callback} [cb] the callback to be called if we want the key to be generated
* in an async fashion
* @returns {JSEncryptRSAKey} the JSEncryptRSAKey object
* @public
*/
getKey(cb?: () => void): JSEncryptRSAKey;
/**
* Returns the pem encoded representation of the private key
* If the key doesn't exists a new key will be created
* @returns {string} pem encoded representation of the private key WITH header and footer
* @public
*/
getPrivateKey(): string;
/**
* Returns the pem encoded representation of the private key
* If the key doesn't exists a new key will be created
* @returns {string} pem encoded representation of the private key WITHOUT header and footer
* @public
*/
getPrivateKeyB64(): string;
/**
* Returns the pem encoded representation of the public key
* If the key doesn't exists a new key will be created
* @returns {string} pem encoded representation of the public key WITH header and footer
* @public
*/
getPublicKey(): string;
/**
* Returns the pem encoded representation of the public key
* If the key doesn't exists a new key will be created
* @returns {string} pem encoded representation of the public key WITHOUT header and footer
* @public
*/
getPublicKeyB64(): string;
}
var _a;
import { b64tohex, hex2b64 } from "./lib/jsbn/base64";
import { JSEncryptRSAKey } from "./JSEncryptRSAKey";
var version = typeof process !== 'undefined'
? (_a = process.env) === null || _a === void 0 ? void 0 : _a.npm_package_version
: undefined;
/**
*
* @param {Object} [options = {}] - An object to customize JSEncrypt behaviour
* possible parameters are:
* - default_key_size {number} default: 1024 the key size in bit
* - default_public_exponent {string} default: '010001' the hexadecimal representation of the public exponent
* - log {boolean} default: false whether log warn/error or not
* @constructor
*/
var JSEncrypt = /** @class */ (function () {
function JSEncrypt(options) {
if (options === void 0) { options = {}; }
options = options || {};
this.default_key_size = options.default_key_size
? parseInt(options.default_key_size, 10)
: 1024;
this.default_public_exponent = options.default_public_exponent || "010001"; // 65537 default openssl public exponent for rsa key type
this.log = options.log || false;
// The private and public key.
this.key = null;
}
/**
* Method to set the rsa key parameter (one method is enough to set both the public
* and the private key, since the private key contains the public key paramenters)
* Log a warning if logs are enabled
* @param {Object|string} key the pem encoded string or an object (with or without header/footer)
* @public
*/
JSEncrypt.prototype.setKey = function (key) {
if (this.log && this.key) {
console.warn("A key was already set, overriding existing.");
}
this.key = new JSEncryptRSAKey(key);
};
/**
* Proxy method for setKey, for api compatibility
* @see setKey
* @public
*/
JSEncrypt.prototype.setPrivateKey = function (privkey) {
// Create the key.
this.setKey(privkey);
};
/**
* Proxy method for setKey, for api compatibility
* @see setKey
* @public
*/
JSEncrypt.prototype.setPublicKey = function (pubkey) {
// Sets the public key.
this.setKey(pubkey);
};
/**
* Proxy method for RSAKey object's decrypt, decrypt the string using the private
* components of the rsa key object. Note that if the object was not set will be created
* on the fly (by the getKey method) using the parameters passed in the JSEncrypt constructor
* @param {string} str base64 encoded crypted string to decrypt
* @return {string} the decrypted string
* @public
*/
JSEncrypt.prototype.decrypt = function (str) {
// Return the decrypted string.
try {
return this.getKey().decrypt(b64tohex(str));
}
catch (ex) {
return false;
}
};
/**
* Proxy method for RSAKey object's encrypt, encrypt the string using the public
* components of the rsa key object. Note that if the object was not set will be created
* on the fly (by the getKey method) using the parameters passed in the JSEncrypt constructor
* @param {string} str the string to encrypt
* @return {string} the encrypted string encoded in base64
* @public
*/
JSEncrypt.prototype.encrypt = function (str) {
// Return the encrypted string.
try {
return hex2b64(this.getKey().encrypt(str));
}
catch (ex) {
return false;
}
};
/**
* Proxy method for RSAKey object's sign.
* @param {string} str the string to sign
* @param {function} digestMethod hash method
* @param {string} digestName the name of the hash algorithm
* @return {string} the signature encoded in base64
* @public
*/
JSEncrypt.prototype.sign = function (str, digestMethod, digestName) {
// return the RSA signature of 'str' in 'hex' format.
try {
return hex2b64(this.getKey().sign(str, digestMethod, digestName));
}
catch (ex) {
return false;
}
};
/**
* Proxy method for RSAKey object's verify.
* @param {string} str the string to verify
* @param {string} signature the signature encoded in base64 to compare the string to
* @param {function} digestMethod hash method
* @return {boolean} whether the data and signature match
* @public
*/
JSEncrypt.prototype.verify = function (str, signature, digestMethod) {
// Return the decrypted 'digest' of the signature.
try {
return this.getKey().verify(str, b64tohex(signature), digestMethod);
}
catch (ex) {
return false;
}
};
/**
* Getter for the current JSEncryptRSAKey object. If it doesn't exists a new object
* will be created and returned
* @param {callback} [cb] the callback to be called if we want the key to be generated
* in an async fashion
* @returns {JSEncryptRSAKey} the JSEncryptRSAKey object
* @public
*/
JSEncrypt.prototype.getKey = function (cb) {
// Only create new if it does not exist.
if (!this.key) {
// Get a new private key.
this.key = new JSEncryptRSAKey();
if (cb && {}.toString.call(cb) === "[object Function]") {
this.key.generateAsync(this.default_key_size, this.default_public_exponent, cb);
return;
}
// Generate the key.
this.key.generate(this.default_key_size, this.default_public_exponent);
}
return this.key;
};
/**
* Returns the pem encoded representation of the private key
* If the key doesn't exists a new key will be created
* @returns {string} pem encoded representation of the private key WITH header and footer
* @public
*/
JSEncrypt.prototype.getPrivateKey = function () {
// Return the private representation of this key.
return this.getKey().getPrivateKey();
};
/**
* Returns the pem encoded representation of the private key
* If the key doesn't exists a new key will be created
* @returns {string} pem encoded representation of the private key WITHOUT header and footer
* @public
*/
JSEncrypt.prototype.getPrivateKeyB64 = function () {
// Return the private representation of this key.
return this.getKey().getPrivateBaseKeyB64();
};
/**
* Returns the pem encoded representation of the public key
* If the key doesn't exists a new key will be created
* @returns {string} pem encoded representation of the public key WITH header and footer
* @public
*/
JSEncrypt.prototype.getPublicKey = function () {
// Return the private representation of this key.
return this.getKey().getPublicKey();
};
/**
* Returns the pem encoded representation of the public key
* If the key doesn't exists a new key will be created
* @returns {string} pem encoded representation of the public key WITHOUT header and footer
* @public
*/
JSEncrypt.prototype.getPublicKeyB64 = function () {
// Return the private representation of this key.
return this.getKey().getPublicBaseKeyB64();
};
JSEncrypt.version = version;
return JSEncrypt;
}());
export { JSEncrypt };
import { RSAKey } from "./lib/jsbn/rsa";
/**
* Create a new JSEncryptRSAKey that extends Tom Wu's RSA key object.
* This object is just a decorator for parsing the key parameter
* @param {string|Object} key - The key in string format, or an object containing
* the parameters needed to build a RSAKey object.
* @constructor
*/
export declare class JSEncryptRSAKey extends RSAKey {
constructor(key?: string);
/**
* Method to parse a pem encoded string containing both a public or private key.
* The method will translate the pem encoded string in a der encoded string and
* will parse private key and public key parameters. This method accepts public key
* in the rsaencryption pkcs #1 format (oid: 1.2.840.113549.1.1.1).
*
* @todo Check how many rsa formats use the same format of pkcs #1.
*
* The format is defined as:
* PublicKeyInfo ::= SEQUENCE {
* algorithm AlgorithmIdentifier,
* PublicKey BIT STRING
* }
* Where AlgorithmIdentifier is:
* AlgorithmIdentifier ::= SEQUENCE {
* algorithm OBJECT IDENTIFIER, the OID of the enc algorithm
* parameters ANY DEFINED BY algorithm OPTIONAL (NULL for PKCS #1)
* }
* and PublicKey is a SEQUENCE encapsulated in a BIT STRING
* RSAPublicKey ::= SEQUENCE {
* modulus INTEGER, -- n
* publicExponent INTEGER -- e
* }
* it's possible to examine the structure of the keys obtained from openssl using
* an asn.1 dumper as the one used here to parse the components: http://lapo.it/asn1js/
* @argument {string} pem the pem encoded string, can include the BEGIN/END header/footer
* @private
*/
parseKey(pem: string): boolean;
/**
* Translate rsa parameters in a hex encoded string representing the rsa key.
*
* The translation follow the ASN.1 notation :
* RSAPrivateKey ::= SEQUENCE {
* version Version,
* modulus INTEGER, -- n
* publicExponent INTEGER, -- e
* privateExponent INTEGER, -- d
* prime1 INTEGER, -- p
* prime2 INTEGER, -- q
* exponent1 INTEGER, -- d mod (p1)
* exponent2 INTEGER, -- d mod (q-1)
* coefficient INTEGER, -- (inverse of q) mod p
* }
* @returns {string} DER Encoded String representing the rsa private key
* @private
*/
getPrivateBaseKey(): string;
/**
* base64 (pem) encoded version of the DER encoded representation
* @returns {string} pem encoded representation without header and footer
* @public
*/
getPrivateBaseKeyB64(): string;
/**
* Translate rsa parameters in a hex encoded string representing the rsa public key.
* The representation follow the ASN.1 notation :
* PublicKeyInfo ::= SEQUENCE {
* algorithm AlgorithmIdentifier,
* PublicKey BIT STRING
* }
* Where AlgorithmIdentifier is:
* AlgorithmIdentifier ::= SEQUENCE {
* algorithm OBJECT IDENTIFIER, the OID of the enc algorithm
* parameters ANY DEFINED BY algorithm OPTIONAL (NULL for PKCS #1)
* }
* and PublicKey is a SEQUENCE encapsulated in a BIT STRING
* RSAPublicKey ::= SEQUENCE {
* modulus INTEGER, -- n
* publicExponent INTEGER -- e
* }
* @returns {string} DER Encoded String representing the rsa public key
* @private
*/
getPublicBaseKey(): string;
/**
* base64 (pem) encoded version of the DER encoded representation
* @returns {string} pem encoded representation without header and footer
* @public
*/
getPublicBaseKeyB64(): string;
/**
* wrap the string in block of width chars. The default value for rsa keys is 64
* characters.
* @param {string} str the pem encoded string without header and footer
* @param {Number} [width=64] - the length the string has to be wrapped at
* @returns {string}
* @private
*/
static wordwrap(str: string, width?: number): string;
/**
* Retrieve the pem encoded private key
* @returns {string} the pem encoded private key with header/footer
* @public
*/
getPrivateKey(): string;
/**
* Retrieve the pem encoded public key
* @returns {string} the pem encoded public key with header/footer
* @public
*/
getPublicKey(): string;
/**
* Check if the object contains the necessary parameters to populate the rsa modulus
* and public exponent parameters.
* @param {Object} [obj={}] - An object that may contain the two public key
* parameters
* @returns {boolean} true if the object contains both the modulus and the public exponent
* properties (n and e)
* @todo check for types of n and e. N should be a parseable bigInt object, E should
* be a parseable integer number
* @private
*/
static hasPublicKeyProperty(obj: object): boolean;
/**
* Check if the object contains ALL the parameters of an RSA key.
* @param {Object} [obj={}] - An object that may contain nine rsa key
* parameters
* @returns {boolean} true if the object contains all the parameters needed
* @todo check for types of the parameters all the parameters but the public exponent
* should be parseable bigint objects, the public exponent should be a parseable integer number
* @private
*/
static hasPrivateKeyProperty(obj: object): boolean;
/**
* Parse the properties of obj in the current rsa object. Obj should AT LEAST
* include the modulus and public exponent (n, e) parameters.
* @param {Object} obj - the object containing rsa parameters
* @private
*/
parsePropertiesFrom(obj: any): void;
}
This diff is collapsed.
import { JSEncrypt } from './JSEncrypt';
export { JSEncrypt };
export default JSEncrypt;
import { JSEncrypt } from './JSEncrypt';
export { JSEncrypt };
export default JSEncrypt;
import { Int10 } from "./int10";
export declare class Stream {
constructor(enc: Stream | number[], pos?: number);
private enc;
pos: number;
get(pos?: number): number;
hexDigits: string;
hexByte(b: number): string;
hexDump(start: number, end: number, raw: boolean): string;
isASCII(start: number, end: number): boolean;
parseStringISO(start: number, end: number): string;
parseStringUTF(start: number, end: number): string;
parseStringBMP(start: number, end: number): string;
parseTime(start: number, end: number, shortYear: boolean): string;
parseInteger(start: number, end: number): string | 0 | -1;
parseBitString(start: number, end: number, maxLength: number): string;
parseOctetString(start: number, end: number, maxLength: number): string;
parseOID(start: number, end: number, maxLength: number): string;
}
export declare class ASN1 {
constructor(stream: Stream, header: number, length: number, tag: ASN1Tag, sub: ASN1[]);
private stream;
private header;
private length;
private tag;
sub: ASN1[];
typeName(): string;
content(maxLength: number): string | 0 | -1;
toString(): string;
toPrettyString(indent: string): string;
posStart(): number;
posContent(): number;
posEnd(): number;
toHexString(): string;
static decodeLength(stream: Stream): number;
/**
* Retrieve the hexadecimal value (as a string) of the current ASN.1 element
* @returns {string}
* @public
*/
getHexStringValue(): string;
static decode(str: Stream | number[]): ASN1;
}
export declare class ASN1Tag {
constructor(stream: Stream);
tagClass: number;
tagConstructed: boolean;
tagNumber: number | Int10;
isUniversal(): boolean;
isEOC(): boolean;
}
This diff is collapsed.
export declare const Base64: {
decode(a: string): number[];
re: RegExp;
unarmor(a: string): number[];
};
// Base64 JavaScript decoder
// Copyright (c) 2008-2013 Lapo Luchini <lapo@lapo.it>
// Permission to use, copy, modify, and/or distribute this software for any
// purpose with or without fee is hereby granted, provided that the above
// copyright notice and this permission notice appear in all copies.
//
// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
/*jshint browser: true, strict: true, immed: true, latedef: true, undef: true, regexdash: false */
var decoder;
export var Base64 = {
decode: function (a) {
var i;
if (decoder === undefined) {
var b64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
var ignore = "= \f\n\r\t\u00A0\u2028\u2029";
decoder = Object.create(null);
for (i = 0; i < 64; ++i) {
decoder[b64.charAt(i)] = i;
}
decoder['-'] = 62; //+
decoder['_'] = 63; //-
for (i = 0; i < ignore.length; ++i) {
decoder[ignore.charAt(i)] = -1;
}
}
var out = [];
var bits = 0;
var char_count = 0;
for (i = 0; i < a.length; ++i) {
var c = a.charAt(i);
if (c == "=") {
break;
}
c = decoder[c];
if (c == -1) {
continue;
}
if (c === undefined) {
throw new Error("Illegal character at offset " + i);
}
bits |= c;
if (++char_count >= 4) {
out[out.length] = (bits >> 16);
out[out.length] = (bits >> 8) & 0xFF;
out[out.length] = bits & 0xFF;
bits = 0;
char_count = 0;
}
else {
bits <<= 6;
}
}
switch (char_count) {
case 1:
throw new Error("Base64 encoding incomplete: at least 2 bits missing");
case 2:
out[out.length] = (bits >> 10);
break;
case 3:
out[out.length] = (bits >> 16);
out[out.length] = (bits >> 8) & 0xFF;
break;
}
return out;
},
re: /-----BEGIN [^-]+-----([A-Za-z0-9+\/=\s]+)-----END [^-]+-----|begin-base64[^\n]+\n([A-Za-z0-9+\/=\s]+)====/,
unarmor: function (a) {
var m = Base64.re.exec(a);
if (m) {
if (m[1]) {
a = m[1];
}
else if (m[2]) {
a = m[2];
}
else {
throw new Error("RegExp out of sync");
}
}
return Base64.decode(a);
}
};
export declare const Hex: {
decode(a: string): number[];
};
// Hex JavaScript decoder
// Copyright (c) 2008-2013 Lapo Luchini <lapo@lapo.it>
// Permission to use, copy, modify, and/or distribute this software for any
// purpose with or without fee is hereby granted, provided that the above
// copyright notice and this permission notice appear in all copies.
//
// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
/*jshint browser: true, strict: true, immed: true, latedef: true, undef: true, regexdash: false */
var decoder;
export var Hex = {
decode: function (a) {
var i;
if (decoder === undefined) {
var hex = "0123456789ABCDEF";
var ignore = " \f\n\r\t\u00A0\u2028\u2029";
decoder = {};
for (i = 0; i < 16; ++i) {
decoder[hex.charAt(i)] = i;
}
hex = hex.toLowerCase();
for (i = 10; i < 16; ++i) {
decoder[hex.charAt(i)] = i;
}
for (i = 0; i < ignore.length; ++i) {
decoder[ignore.charAt(i)] = -1;
}
}
var out = [];
var bits = 0;
var char_count = 0;
for (i = 0; i < a.length; ++i) {
var c = a.charAt(i);
if (c == "=") {
break;
}
c = decoder[c];
if (c == -1) {
continue;
}
if (c === undefined) {
throw new Error("Illegal character at offset " + i);
}
bits |= c;
if (++char_count >= 2) {
out[out.length] = bits;
bits = 0;
char_count = 0;
}
else {
bits <<= 4;
}
}
if (char_count) {
throw new Error("Hex encoding incomplete: 4 bits missing");
}
return out;
}
};
export declare class Int10 {
constructor(value?: string | number);
mulAdd(m: number, c: number): void;
sub(c: number): void;
toString(base?: number): string;
valueOf(): number;
simplify(): number | this;
private buf;
}
// Big integer base-10 printing library
// Copyright (c) 2014 Lapo Luchini <lapo@lapo.it>
// Permission to use, copy, modify, and/or distribute this software for any
// purpose with or without fee is hereby granted, provided that the above
// copyright notice and this permission notice appear in all copies.
//
// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
/*jshint browser: true, strict: true, immed: true, latedef: true, undef: true, regexdash: false */
var max = 10000000000000; // biggest integer that can still fit 2^53 when multiplied by 256
var Int10 = /** @class */ (function () {
function Int10(value) {
this.buf = [+value || 0];
}
Int10.prototype.mulAdd = function (m, c) {
// assert(m <= 256)
var b = this.buf;
var l = b.length;
var i;
var t;
for (i = 0; i < l; ++i) {
t = b[i] * m + c;
if (t < max) {
c = 0;
}
else {
c = 0 | (t / max);
t -= c * max;
}
b[i] = t;
}
if (c > 0) {
b[i] = c;
}
};
Int10.prototype.sub = function (c) {
// assert(m <= 256)
var b = this.buf;
var l = b.length;
var i;
var t;
for (i = 0; i < l; ++i) {
t = b[i] - c;
if (t < 0) {
t += max;
c = 1;
}
else {
c = 0;
}
b[i] = t;
}
while (b[b.length - 1] === 0) {
b.pop();
}
};
Int10.prototype.toString = function (base) {
if ((base || 10) != 10) {
throw new Error("only base 10 is supported");
}
var b = this.buf;
var s = b[b.length - 1].toString();
for (var i = b.length - 2; i >= 0; --i) {
s += (max + b[i]).toString().substring(1);
}
return s;
};
Int10.prototype.valueOf = function () {
var b = this.buf;
var v = 0;
for (var i = b.length - 1; i >= 0; --i) {
v = v * max + b[i];
}
return v;
};
Int10.prototype.simplify = function () {
var b = this.buf;
return (b.length == 1) ? b[0] : this;
};
return Int10;
}());
export { Int10 };
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
export declare function hex2b64(h: string): string;
export declare function b64tohex(s: string): string;
export declare function b64toBA(s: string): number[];
import { int2char } from "./util";
var b64map = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
var b64pad = "=";
export function hex2b64(h) {
var i;
var c;
var ret = "";
for (i = 0; i + 3 <= h.length; i += 3) {
c = parseInt(h.substring(i, i + 3), 16);
ret += b64map.charAt(c >> 6) + b64map.charAt(c & 63);
}
if (i + 1 == h.length) {
c = parseInt(h.substring(i, i + 1), 16);
ret += b64map.charAt(c << 2);
}
else if (i + 2 == h.length) {
c = parseInt(h.substring(i, i + 2), 16);
ret += b64map.charAt(c >> 2) + b64map.charAt((c & 3) << 4);
}
while ((ret.length & 3) > 0) {
ret += b64pad;
}
return ret;
}
// convert a base64 string to hex
export function b64tohex(s) {
var ret = "";
var i;
var k = 0; // b64 state, 0-3
var slop = 0;
for (i = 0; i < s.length; ++i) {
if (s.charAt(i) == b64pad) {
break;
}
var v = b64map.indexOf(s.charAt(i));
if (v < 0) {
continue;
}
if (k == 0) {
ret += int2char(v >> 2);
slop = v & 3;
k = 1;
}
else if (k == 1) {
ret += int2char((slop << 2) | (v >> 4));
slop = v & 0xf;
k = 2;
}
else if (k == 2) {
ret += int2char(slop);
ret += int2char(v >> 2);
slop = v & 3;
k = 3;
}
else {
ret += int2char((slop << 2) | (v >> 4));
ret += int2char(v & 0xf);
k = 0;
}
}
if (k == 1) {
ret += int2char(slop << 2);
}
return ret;
}
// convert a base64 string to a byte/number array
export function b64toBA(s) {
// piggyback on b64tohex for now, optimize later
var h = b64tohex(s);
var i;
var a = [];
for (i = 0; 2 * i < h.length; ++i) {
a[i] = parseInt(h.substring(2 * i, 2 * i + 2), 16);
}
return a;
}
import { SecureRandom } from "./rng";
export declare class BigInteger {
constructor(a: number | number[] | string, b?: number | SecureRandom, c?: number | SecureRandom);
toString(b: number): string;
protected negate(): BigInteger;
abs(): BigInteger;
compareTo(a: BigInteger): number;
bitLength(): number;
mod(a: BigInteger): BigInteger;
modPowInt(e: number, m: BigInteger): BigInteger;
protected clone(): BigInteger;
protected intValue(): number;
protected byteValue(): number;
protected shortValue(): number;
protected signum(): 0 | 1 | -1;
toByteArray(): number[];
protected equals(a: BigInteger): boolean;
protected min(a: BigInteger): BigInteger;
protected max(a: BigInteger): BigInteger;
protected and(a: BigInteger): BigInteger;
protected or(a: BigInteger): BigInteger;
protected xor(a: BigInteger): BigInteger;
protected andNot(a: BigInteger): BigInteger;
protected not(): BigInteger;
protected shiftLeft(n: number): BigInteger;
protected shiftRight(n: number): BigInteger;
protected getLowestSetBit(): number;
protected bitCount(): number;
protected testBit(n: number): boolean;
protected setBit(n: number): BigInteger;
protected clearBit(n: number): BigInteger;
protected flipBit(n: number): BigInteger;
add(a: BigInteger): BigInteger;
subtract(a: BigInteger): BigInteger;
multiply(a: BigInteger): BigInteger;
divide(a: BigInteger): BigInteger;
protected remainder(a: BigInteger): BigInteger;
protected divideAndRemainder(a: BigInteger): BigInteger[];
modPow(e: BigInteger, m: BigInteger): BigInteger;
modInverse(m: BigInteger): BigInteger;
protected pow(e: number): BigInteger;
gcd(a: BigInteger): BigInteger;
isProbablePrime(t: number): boolean;
copyTo(r: BigInteger): void;
fromInt(x: number): void;
protected fromString(s: string | number[], b: number): void;
clamp(): void;
dlShiftTo(n: number, r: BigInteger): void;
drShiftTo(n: number, r: BigInteger): void;
protected lShiftTo(n: number, r: BigInteger): void;
protected rShiftTo(n: number, r: BigInteger): void;
subTo(a: BigInteger, r: BigInteger): void;
multiplyTo(a: BigInteger, r: BigInteger): void;
squareTo(r: BigInteger): void;
divRemTo(m: BigInteger, q: BigInteger, r: BigInteger): void;
invDigit(): number;
protected isEven(): boolean;
protected exp(e: number, z: IReduction): BigInteger;
protected chunkSize(r: number): number;
protected toRadix(b: number): string;
fromRadix(s: string, b: number): void;
protected fromNumber(a: number, b: number | SecureRandom, c?: number | SecureRandom): void;
protected bitwiseTo(a: BigInteger, op: (a: number, b: number) => number, r: BigInteger): void;
protected changeBit(n: number, op: (a: number, b: number) => number): BigInteger;
protected addTo(a: BigInteger, r: BigInteger): void;
protected dMultiply(n: number): void;
dAddOffset(n: number, w: number): void;
multiplyLowerTo(a: BigInteger, n: number, r: BigInteger): void;
multiplyUpperTo(a: BigInteger, n: number, r: BigInteger): void;
protected modInt(n: number): number;
protected millerRabin(t: number): boolean;
protected square(): BigInteger;
gcda(a: BigInteger, callback: (x: BigInteger) => void): void;
fromNumberAsync(a: number, b: number | SecureRandom, c: number | SecureRandom, callback: () => void): void;
s: number;
t: number;
DB: number;
DM: number;
DV: number;
FV: number;
F1: number;
F2: number;
am: (i: number, x: number, w: BigInteger, j: number, c: number, n: number) => number;
[index: number]: number;
static ONE: BigInteger;
static ZERO: BigInteger;
}
export interface IReduction {
convert(x: BigInteger): BigInteger;
revert(x: BigInteger): BigInteger;
mulTo(x: BigInteger, y: BigInteger, r: BigInteger): void;
sqrTo(x: BigInteger, r: BigInteger): void;
}
export declare function nbi(): BigInteger;
export declare function parseBigInt(str: string, r: number): BigInteger;
export declare function intAt(s: string, i: number): number;
export declare function nbv(i: number): BigInteger;
export declare function nbits(x: number): number;
This diff is collapsed.
export declare class Arcfour {
constructor();
init(key: number[]): void;
next(): number;
private i;
private j;
private S;
}
export declare function prng_newstate(): Arcfour;
export declare let rng_psize: number;
// prng4.js - uses Arcfour as a PRNG
var Arcfour = /** @class */ (function () {
function Arcfour() {
this.i = 0;
this.j = 0;
this.S = [];
}
// Arcfour.prototype.init = ARC4init;
// Initialize arcfour context from key, an array of ints, each from [0..255]
Arcfour.prototype.init = function (key) {
var i;
var j;
var t;
for (i = 0; i < 256; ++i) {
this.S[i] = i;
}
j = 0;
for (i = 0; i < 256; ++i) {
j = (j + this.S[i] + key[i % key.length]) & 255;
t = this.S[i];
this.S[i] = this.S[j];
this.S[j] = t;
}
this.i = 0;
this.j = 0;
};
// Arcfour.prototype.next = ARC4next;
Arcfour.prototype.next = function () {
var t;
this.i = (this.i + 1) & 255;
this.j = (this.j + this.S[this.i]) & 255;
t = this.S[this.i];
this.S[this.i] = this.S[this.j];
this.S[this.j] = t;
return this.S[(t + this.S[this.i]) & 255];
};
return Arcfour;
}());
export { Arcfour };
// Plug in your RNG constructor here
export function prng_newstate() {
return new Arcfour();
}
// Pool size must be a multiple of 4 and greater than 32.
// An array of bytes the size of the pool will be passed to init()
export var rng_psize = 256;
export declare class SecureRandom {
nextBytes(ba: number[]): void;
}
// Random number generator - requires a PRNG backend, e.g. prng4.js
import { prng_newstate, rng_psize } from "./prng4";
var rng_state;
var rng_pool = null;
var rng_pptr;
// Initialize the pool with junk if needed.
if (rng_pool == null) {
rng_pool = [];
rng_pptr = 0;
var t = void 0;
if (typeof window !== 'undefined' && window.crypto && window.crypto.getRandomValues) {
// Extract entropy (2048 bits) from RNG if available
var z = new Uint32Array(256);
window.crypto.getRandomValues(z);
for (t = 0; t < z.length; ++t) {
rng_pool[rng_pptr++] = z[t] & 255;
}
}
// Use mouse events for entropy, if we do not have enough entropy by the time
// we need it, entropy will be generated by Math.random.
var count = 0;
var onMouseMoveListener_1 = function (ev) {
count = count || 0;
if (count >= 256 || rng_pptr >= rng_psize) {
if (window.removeEventListener) {
window.removeEventListener("mousemove", onMouseMoveListener_1, false);
}
else if (window.detachEvent) {
window.detachEvent("onmousemove", onMouseMoveListener_1);
}
return;
}
try {
var mouseCoordinates = ev.x + ev.y;
rng_pool[rng_pptr++] = mouseCoordinates & 255;
count += 1;
}
catch (e) {
// Sometimes Firefox will deny permission to access event properties for some reason. Ignore.
}
};
if (typeof window !== 'undefined') {
if (window.addEventListener) {
window.addEventListener("mousemove", onMouseMoveListener_1, false);
}
else if (window.attachEvent) {
window.attachEvent("onmousemove", onMouseMoveListener_1);
}
}
}
function rng_get_byte() {
if (rng_state == null) {
rng_state = prng_newstate();
// At this point, we may not have collected enough entropy. If not, fall back to Math.random
while (rng_pptr < rng_psize) {
var random = Math.floor(65536 * Math.random());
rng_pool[rng_pptr++] = random & 255;
}
rng_state.init(rng_pool);
for (rng_pptr = 0; rng_pptr < rng_pool.length; ++rng_pptr) {
rng_pool[rng_pptr] = 0;
}
rng_pptr = 0;
}
// TODO: allow reseeding after first request
return rng_state.next();
}
var SecureRandom = /** @class */ (function () {
function SecureRandom() {
}
SecureRandom.prototype.nextBytes = function (ba) {
for (var i = 0; i < ba.length; ++i) {
ba[i] = rng_get_byte();
}
};
return SecureRandom;
}());
export { SecureRandom };
import { BigInteger } from "./jsbn";
export declare class RSAKey {
constructor();
doPublic(x: BigInteger): BigInteger;
doPrivate(x: BigInteger): BigInteger;
setPublic(N: string, E: string): void;
encrypt(text: string): string;
setPrivate(N: string, E: string, D: string): void;
setPrivateEx(N: string, E: string, D: string, P: string, Q: string, DP: string, DQ: string, C: string): void;
generate(B: number, E: string): void;
decrypt(ctext: string): string;
generateAsync(B: number, E: string, callback: () => void): void;
sign(text: string, digestMethod: (str: string) => string, digestName: string): string;
verify(text: string, signature: string, digestMethod: (str: string) => string): boolean;
protected n: BigInteger;
protected e: number;
protected d: BigInteger;
protected p: BigInteger;
protected q: BigInteger;
protected dmp1: BigInteger;
protected dmq1: BigInteger;
protected coeff: BigInteger;
}
This diff is collapsed.
export declare function int2char(n: number): string;
export declare function op_and(x: number, y: number): number;
export declare function op_or(x: number, y: number): number;
export declare function op_xor(x: number, y: number): number;
export declare function op_andnot(x: number, y: number): number;
export declare function lbit(x: number): number;
export declare function cbit(x: number): number;
var BI_RM = "0123456789abcdefghijklmnopqrstuvwxyz";
export function int2char(n) {
return BI_RM.charAt(n);
}
//#region BIT_OPERATIONS
// (public) this & a
export function op_and(x, y) {
return x & y;
}
// (public) this | a
export function op_or(x, y) {
return x | y;
}
// (public) this ^ a
export function op_xor(x, y) {
return x ^ y;
}
// (public) this & ~a
export function op_andnot(x, y) {
return x & ~y;
}
// return index of lowest 1-bit in x, x < 2^31
export function lbit(x) {
if (x == 0) {
return -1;
}
var r = 0;
if ((x & 0xffff) == 0) {
x >>= 16;
r += 16;
}
if ((x & 0xff) == 0) {
x >>= 8;
r += 8;
}
if ((x & 0xf) == 0) {
x >>= 4;
r += 4;
}
if ((x & 3) == 0) {
x >>= 2;
r += 2;
}
if ((x & 1) == 0) {
++r;
}
return r;
}
// return number of 1 bits in x
export function cbit(x) {
var r = 0;
while (x != 0) {
x &= x - 1;
++r;
}
return r;
}
//#endregion BIT_OPERATIONS
This diff is collapsed.
/*!
Copyright (c) 2011, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.com/yui/license.html
version: 2.9.0
*/
export var YAHOO = {};
YAHOO.lang = {
/**
* Utility to set up the prototype, constructor and superclass properties to
* support an inheritance strategy that can chain constructors and methods.
* Static members will not be inherited.
*
* @method extend
* @static
* @param {Function} subc the object to modify
* @param {Function} superc the object to inherit
* @param {Object} overrides additional properties/methods to add to the
* subclass prototype. These will override the
* matching items obtained from the superclass
* if present.
*/
extend: function (subc, superc, overrides) {
if (!superc || !subc) {
throw new Error("YAHOO.lang.extend failed, please check that " +
"all dependencies are included.");
}
var F = function () { };
F.prototype = superc.prototype;
subc.prototype = new F();
subc.prototype.constructor = subc;
subc.superclass = superc.prototype;
if (superc.prototype.constructor == Object.prototype.constructor) {
superc.prototype.constructor = superc;
}
if (overrides) {
var i;
for (i in overrides) {
subc.prototype[i] = overrides[i];
}
/*
* IE will not enumerate native functions in a derived object even if the
* function was overridden. This is a workaround for specific functions
* we care about on the Object prototype.
* @property _IEEnumFix
* @param {Function} r the object to receive the augmentation
* @param {Function} s the object that supplies the properties to augment
* @static
* @private
*/
var _IEEnumFix = function () { }, ADD = ["toString", "valueOf"];
try {
if (/MSIE/.test(navigator.userAgent)) {
_IEEnumFix = function (r, s) {
for (i = 0; i < ADD.length; i = i + 1) {
var fname = ADD[i], f = s[fname];
if (typeof f === 'function' && f != Object.prototype[fname]) {
r[fname] = f;
}
}
};
}
}
catch (ex) { }
;
_IEEnumFix(subc.prototype, overrides);
}
}
};
{"version": "3.3.0"}
\ No newline at end of file
{
"name": "jsencrypt",
"version": "3.3.2",
"description": "A Javascript library to perform OpenSSL RSA Encryption, Decryption, and Key Generation.",
"main": "bin/jsencrypt.js",
"module": "lib/index.js",
"browser": "lib/index.js",
"types": "lib/index.d.ts",
"dependencies": {},
"devDependencies": {
"@babel/core": "^7.20.12",
"@babel/preset-env": "^7.20.2",
"@babel/preset-typescript": "^7.18.6",
"@babel/register": "^7.18.9",
"@types/expect": "^24.3.0",
"@types/mocha": "^10.0.0",
"@types/node": "^18.11.4",
"chai": "^4.3.6",
"dirty-chai": "^2.0.1",
"fs-jetpack": "^5.1.0",
"mocha": "^10.0.0",
"process": "^0.11.10",
"ts-mocha": "^10.0.0",
"ts-node": "^10.9.1",
"typescript": "^4.2.4",
"url": "^0.11.0",
"webpack": "^5.35.1",
"webpack-cli": "^4.6.0"
},
"files": [
"bin",
"lib"
],
"scripts": {
"build:dev": "tsc && tsc --project tsconfig-def.json && webpack",
"build:test": "tsc && tsc --project tsconfig-def.json && webpack --config webpack.test.js",
"build:prod": "tsc && tsc --project tsconfig-def.json && webpack --config webpack.prod.js",
"build": "npm run build:dev && npm run build:test && npm run build:prod",
"serve": "bundle exec jekyll server --config _config.build.yml",
"test": "ts-mocha test/test.rsa.js"
},
"author": "Travis Tidwell <travis@form.io>",
"contributors": [
{
"name": "Travis Tidwell",
"email": "travis@form.io",
"url": "http://github.com/travist"
},
{
"name": "Antonio",
"url": "https://github.com/zoloft"
},
{
"name": "Julio",
"url": "https://github.com/jmgaya"
},
{
"name": "Taehyun Hwang",
"url": "https://github.com/HwangTaehyun"
}
],
"homepage": "http://www.travistidwell.com/jsencrypt",
"repository": {
"type": "git",
"url": "git://github.com/travist/jsencrypt.git"
},
"bugs": {
"url": "http://github.com/travist/jsencrypt/issues"
},
"license": "MIT"
}
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
"echarts": "^5.5.0", "echarts": "^5.5.0",
"element-plus": "^2.7.5", "element-plus": "^2.7.5",
"file-saver": "^2.0.5", "file-saver": "^2.0.5",
"jsencrypt": "^3.3.2",
"less": "^4.2.0", "less": "^4.2.0",
"mitt": "^3.0.1", "mitt": "^3.0.1",
"node-sass": "^9.0.0", "node-sass": "^9.0.0",
...@@ -2507,6 +2508,11 @@ ...@@ -2507,6 +2508,11 @@
"resolved": "https://registry.npmmirror.com/jsbn/-/jsbn-1.1.0.tgz", "resolved": "https://registry.npmmirror.com/jsbn/-/jsbn-1.1.0.tgz",
"integrity": "sha512-4bYVV3aAMtDTTu4+xsDYa6sy9GyJ69/amsu9sYF2zqjiEoZA5xJi3BrfX3uY+/IekIu7MwdObdbDWpoZdBv3/A==" "integrity": "sha512-4bYVV3aAMtDTTu4+xsDYa6sy9GyJ69/amsu9sYF2zqjiEoZA5xJi3BrfX3uY+/IekIu7MwdObdbDWpoZdBv3/A=="
}, },
"node_modules/jsencrypt": {
"version": "3.3.2",
"resolved": "https://registry.npmjs.org/jsencrypt/-/jsencrypt-3.3.2.tgz",
"integrity": "sha512-arQR1R1ESGdAxY7ZheWr12wCaF2yF47v5qpB76TtV64H1pyGudk9Hvw8Y9tb/FiTIaaTRUyaSnm5T/Y53Ghm/A=="
},
"node_modules/jsesc": { "node_modules/jsesc": {
"version": "2.5.2", "version": "2.5.2",
"resolved": "https://registry.npmmirror.com/jsesc/-/jsesc-2.5.2.tgz", "resolved": "https://registry.npmmirror.com/jsesc/-/jsesc-2.5.2.tgz",
......
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
"echarts": "^5.5.0", "echarts": "^5.5.0",
"element-plus": "^2.7.5", "element-plus": "^2.7.5",
"file-saver": "^2.0.5", "file-saver": "^2.0.5",
"jsencrypt": "^3.3.2",
"less": "^4.2.0", "less": "^4.2.0",
"mitt": "^3.0.1", "mitt": "^3.0.1",
"node-sass": "^9.0.0", "node-sass": "^9.0.0",
......
// export const ExternalSERVEICE='http://218.69.97.198:8001' export const ExternalSERVEICE='http://218.69.97.198:8001'
// export const WithinSERVEICE='http://192.168.1.252:8001' export const WithinSERVEICE='http://192.168.1.252:8001'
export const ExternalSERVEICE='http://localhost:5013' //export const ExternalSERVEICE='http://localhost:5013'
export const WithinSERVEICE='http://localhost:5013' //export const WithinSERVEICE='http://localhost:5013'
export const CURRLOGO="LOGO_gangyi.png" export const CURRLOGO="LOGO_gangyi.png"
...@@ -169,9 +169,16 @@ const routes = [ ...@@ -169,9 +169,16 @@ const routes = [
},{ },{
path: '/EnergyView', path: '/EnergyView',
name: 'EnergyViewPage', name: 'EnergyViewPage',
component: () => import('@/views/HandlerPage/QOQ.vue'),//EnergyViewPage component: () => import('@/views/HandlerPage/EnergyViewPage.vue'),
meta: { meta: {
title: '趋势图' title: '供热站趋势图'
}
},{
path: '/Handler/TransferEnergyView',
name: 'EnergyViewPage',
component: () => import('@/views/HandlerPage/TransferEnergyView.vue'),
meta: {
title: '换热站趋势图'
} }
},{ },{
path: '/HeatAnalysis', path: '/HeatAnalysis',
......
<template>换热站趋势图</template>
\ No newline at end of file
...@@ -302,7 +302,7 @@ function login() { ...@@ -302,7 +302,7 @@ function login() {
$message.success('登录成功,正在跳转!'); $message.success('登录成功,正在跳转!');
store.commit('setUserInfo', result.data); store.commit('setUserInfo', result.data);
// router.push({ path: '/Home'}); // router.push({ path: '/Home'});
router.push({ path: '/GisHome'}); router.push({ path: '/GisHome'});
}); });
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment