|
| 1 | +/** @const */ |
| 2 | +var forge = {}; |
| 3 | +forge.random = {}; |
| 4 | +/** |
| 5 | + * @param {number} count |
| 6 | + * @return {string} |
| 7 | + */ |
| 8 | +forge.random.getBytesSync = function(count){}; |
| 9 | + |
| 10 | +forge.util = {}; |
| 11 | +/** @constructor */ |
| 12 | +forge.util.ByteStringBuffer = function(){}; |
| 13 | +/** |
| 14 | + * @return {string} |
| 15 | + */ |
| 16 | +forge.util.ByteStringBuffer.prototype.getBytes = function(){}; |
| 17 | +/** |
| 18 | + * @param {string} value |
| 19 | + * @return {forge.util.ByteStringBuffer} |
| 20 | + */ |
| 21 | +forge.util.ByteStringBuffer.prototype.putBytes = function(value){}; |
| 22 | +/** |
| 23 | + * @param {number} i |
| 24 | + * @return {forge.util.ByteStringBuffer} |
| 25 | + */ |
| 26 | +forge.util.ByteStringBuffer.prototype.putInt24Le = function(i){}; |
| 27 | +/** |
| 28 | + * @param {number} i |
| 29 | + * @return {forge.util.ByteStringBuffer} |
| 30 | + */ |
| 31 | +forge.util.ByteStringBuffer.prototype.putInt32Le = function(i){}; |
| 32 | +/** |
| 33 | + * @param {number} b |
| 34 | + * @param {number} n |
| 35 | + * @return {forge.util.ByteStringBuffer} |
| 36 | + */ |
| 37 | +forge.util.ByteStringBuffer.prototype.fillWithByte = function(b, n){}; |
| 38 | +/** |
| 39 | + * @param {number} count |
| 40 | + * @return {forge.util.ByteStringBuffer} |
| 41 | + */ |
| 42 | +forge.util.ByteStringBuffer.prototype.truncate = function(count){}; |
| 43 | +/** |
| 44 | + * @return {string} |
| 45 | + */ |
| 46 | +forge.util.ByteStringBuffer.prototype.toHex = function(){}; |
| 47 | +/** @type {string} */ |
| 48 | +forge.util.ByteStringBuffer.prototype.data; |
| 49 | +/** |
| 50 | + * @param {string} input |
| 51 | + * @param {string=} encoding |
| 52 | + * @return {forge.util.ByteStringBuffer} |
| 53 | + */ |
| 54 | +forge.util.createBuffer = function(input, encoding){}; |
| 55 | +/** |
| 56 | + * @param {string} hex |
| 57 | + * @return {string} |
| 58 | + */ |
| 59 | +forge.util.hexToBytes = function(hex){}; |
| 60 | +/** |
| 61 | + * @param {string} value |
| 62 | + * @return {string} |
| 63 | + */ |
| 64 | +forge.util.decodeUtf8 = function(value){}; |
| 65 | + |
| 66 | +/** @constructor */ |
| 67 | +forge.asn1 = function(){}; |
| 68 | +/** |
| 69 | + * @typedef |
| 70 | + * {{ |
| 71 | + * strict: (boolean|undefined), |
| 72 | + * parseAllBytes: (boolean|undefined), |
| 73 | + * decodeBitStrings: (boolean|undefined), |
| 74 | + * }} |
| 75 | + */ |
| 76 | +var DerOption; |
| 77 | +/** |
| 78 | + * @param {forge.util.ByteStringBuffer|string} bytes |
| 79 | + * @param {DerOption=} options |
| 80 | + * @return {forge.asn1} |
| 81 | + */ |
| 82 | +forge.asn1.fromDer = function(bytes, options){}; |
| 83 | +/** |
| 84 | + * @param {forge.asn1} obj |
| 85 | + * @return {forge.util.ByteStringBuffer} |
| 86 | + */ |
| 87 | +forge.asn1.toDer = function(obj){}; |
| 88 | +/** |
| 89 | + * @param {number} num |
| 90 | + * @return {forge.util.ByteStringBuffer} |
| 91 | + */ |
| 92 | +forge.asn1.integerToDer = function(num){}; |
| 93 | +/** |
| 94 | + * @param {string} oid |
| 95 | + * @return {forge.util.ByteStringBuffer} |
| 96 | + */ |
| 97 | +forge.asn1.oidToDer = function(oid){}; |
| 98 | +forge.asn1.Type = {}; |
| 99 | +/** @type {number} */ |
| 100 | +forge.asn1.Type.UTF8; |
| 101 | +/** @type {number} */ |
| 102 | +forge.asn1.Type.SET; |
| 103 | +/** @type {number} */ |
| 104 | +forge.asn1.Type.SEQUENCE; |
| 105 | +/** @type {number} */ |
| 106 | +forge.asn1.Type.BOOLEAN; |
| 107 | +/** @type {number} */ |
| 108 | +forge.asn1.Type.INTEGER; |
| 109 | +/** @type {number} */ |
| 110 | +forge.asn1.Type.OID; |
| 111 | +/** @type {number} */ |
| 112 | +forge.asn1.Type.NULL; |
| 113 | +/** @type {number} */ |
| 114 | +forge.asn1.Type.OCTETSTRING; |
| 115 | +forge.asn1.Class = {}; |
| 116 | +/** @type {string} */ |
| 117 | +forge.asn1.Class.UNIVERSAL; |
| 118 | +/** |
| 119 | + * @param {string} tagClass |
| 120 | + * @param {number} type |
| 121 | + * @param {boolean} constructed |
| 122 | + * @param {Array<string>} value |
| 123 | + * @param {Object=} options |
| 124 | + * @return {forge.asn1} |
| 125 | + */ |
| 126 | +forge.asn1.create = function(tagClass, type, constructed, value, options){}; |
| 127 | +/** @type {Array<forge.asn1>} */ |
| 128 | +forge.asn1.prototype.value; |
| 129 | + |
| 130 | +/** @constructor */ |
| 131 | +const forge_BigInteger = function(){}; |
| 132 | +/** |
| 133 | + * @param {forge_BigInteger} a |
| 134 | + * @return {number} |
| 135 | + */ |
| 136 | +forge_BigInteger.prototype.compareTo = function(a){}; |
| 137 | +/** @constructor */ |
| 138 | +const forge_cert = function(){}; |
| 139 | +/** @type {forge_key} */ |
| 140 | +forge_cert.prototype.publicKey; |
| 141 | +/** @type {forge_cert_issuer} */ |
| 142 | +forge_cert.prototype.issuer; |
| 143 | +/** @constructor */ |
| 144 | +const forge_key = function(){}; |
| 145 | +/** @type {forge_BigInteger} */ |
| 146 | +forge_key.prototype.n; |
| 147 | +/** @type {forge_BigInteger} */ |
| 148 | +forge_key.prototype.e; |
| 149 | +/** @constructor */ |
| 150 | +const forge_cert_issuer = function(){}; |
| 151 | +/** @type {Array<forge_cert_attr>} */ |
| 152 | +forge_cert_issuer.prototype.attributes; |
| 153 | +/** |
| 154 | + * @typedef |
| 155 | + * {{ |
| 156 | + * valueTagClass: (string|undefined), |
| 157 | + * type: (string|undefined), |
| 158 | + * value: (string|undefined), |
| 159 | + * }} |
| 160 | + */ |
| 161 | +var forge_cert_attr; |
| 162 | +/** |
| 163 | + * @typedef |
| 164 | + * {{ |
| 165 | + * key: (forge_key|undefined), |
| 166 | + * certificate: (forge_cert|undefined), |
| 167 | + * digestAlgorithm: (string|undefined), |
| 168 | + * authenticatedAttributes: (Array<forge_cert_attr>|undefined), |
| 169 | + * unauthenticatedAttributes: (Array<forge_cert_attr>|undefined), |
| 170 | + * signature: (string|undefined), |
| 171 | + * }} |
| 172 | + */ |
| 173 | +var forge_signer; |
| 174 | + |
| 175 | +/** @constructor */ |
| 176 | +forge.pkcs7 = function(){}; |
| 177 | +/** |
| 178 | + * @return {forge.pkcs7} |
| 179 | + */ |
| 180 | +forge.pkcs7.createSignedData = function(){}; |
| 181 | +/** |
| 182 | + * @param {forge_cert} cert |
| 183 | + */ |
| 184 | +forge.pkcs7.prototype.addCertificate = function(cert){}; |
| 185 | +/** |
| 186 | + * @param {forge_signer} signer |
| 187 | + */ |
| 188 | +forge.pkcs7.prototype.addSigner = function(signer){}; |
| 189 | +/** @type {Array<forge_signer>} */ |
| 190 | +forge.pkcs7.prototype.signers; |
| 191 | +/** @type {Array<forge.asn1>} */ |
| 192 | +forge.pkcs7.prototype.signerInfos; |
| 193 | +/** |
| 194 | + * @typedef |
| 195 | + * {{ |
| 196 | + * detached: (boolean|undefined), |
| 197 | + * }} |
| 198 | + */ |
| 199 | +var forge_sign_option; |
| 200 | +/** |
| 201 | + * @param {forge_sign_option} options |
| 202 | + */ |
| 203 | +forge.pkcs7.prototype.sign = function(options){}; |
| 204 | +/** |
| 205 | + * @return {forge.asn1} |
| 206 | + */ |
| 207 | +forge.pkcs7.prototype.toAsn1 = function(){}; |
| 208 | + |
| 209 | +/** @constructor */ |
| 210 | +forge.pkcs12 = function(){}; |
| 211 | +/** |
| 212 | + * @param {forge.asn1} obj |
| 213 | + * @param {boolean=} strict |
| 214 | + * @param {string=} password |
| 215 | + * @return {forge.pkcs12} |
| 216 | + */ |
| 217 | +forge.pkcs12.pkcs12FromAsn1 = function(obj, strict, password){}; |
| 218 | +/** |
| 219 | + * @typedef |
| 220 | + * {{ |
| 221 | + * localKeyId: (string|undefined), |
| 222 | + * localKeyIdHex: (string|undefined), |
| 223 | + * friendlyName: (string|undefined), |
| 224 | + * bagType: (string|undefined), |
| 225 | + * }} |
| 226 | + */ |
| 227 | +var P12BagsFilter; |
| 228 | +/** |
| 229 | + * @typedef |
| 230 | + * {{ |
| 231 | + * cert: forge_cert, |
| 232 | + * key: forge_key, |
| 233 | + * }} |
| 234 | + */ |
| 235 | +var P12Bag; |
| 236 | +/** |
| 237 | + * @param {P12BagsFilter} filter |
| 238 | + * @return {Object<string, Object<string|number, P12Bag>>} |
| 239 | + */ |
| 240 | +forge.pkcs12.prototype.getBags = function(filter){}; |
| 241 | + |
| 242 | +forge.oids = {}; |
| 243 | +/** @type {string} */ |
| 244 | +forge.oids.sha256; |
| 245 | +forge.pki = {}; |
| 246 | +forge.pki.oids = {}; |
| 247 | +/** @type {string} */ |
| 248 | +forge.pki.oids.certBag; |
| 249 | +/** @type {string} */ |
| 250 | +forge.pki.oids.pkcs8ShroudedKeyBag; |
| 251 | +/** @type {string} */ |
| 252 | +forge.pki.oids.sha256; |
| 253 | +/** @type {string} */ |
| 254 | +forge.pki.oids.contentType; |
| 255 | +/** @type {string} */ |
| 256 | +forge.pki.oids.data; |
| 257 | +/** @type {string} */ |
| 258 | +forge.pki.oids.messageDigest; |
| 259 | +/** @type {string} */ |
| 260 | +forge.pki.oids.signingTime; |
| 261 | + |
| 262 | +forge.md = {}; |
| 263 | +/** @constructor */ |
| 264 | +forge.md.digest = function(){}; |
| 265 | +/** |
| 266 | + * @param {string=} msg |
| 267 | + * @param {string=} encoding |
| 268 | + * @return {forge.md.digest} |
| 269 | + */ |
| 270 | +forge.md.digest.prototype.update = function(msg, encoding){}; |
| 271 | +/** |
| 272 | + * @return {forge.util.ByteStringBuffer} |
| 273 | + */ |
| 274 | +forge.md.digest.prototype.digest = function(){}; |
| 275 | +forge.md.md5 = {}; |
| 276 | +forge.md.sha256 = {}; |
| 277 | +/** |
| 278 | + * @return {forge.md.digest} |
| 279 | + */ |
| 280 | +forge.md.md5.create = function(){}; |
| 281 | +/** |
| 282 | + * @return {forge.md.digest} |
| 283 | + */ |
| 284 | +forge.md.sha256.create = function(){}; |
| 285 | + |
| 286 | +forge.cipher = {}; |
| 287 | +/** @constructor */ |
| 288 | +forge.cipher.BlockCipher = function(){}; |
| 289 | +/** |
| 290 | + * @typedef |
| 291 | + * {{ |
| 292 | + * iv: (string|undefined), |
| 293 | + * additionalData: (string|undefined), |
| 294 | + * tagLength: (number|undefined), |
| 295 | + * tag: (string|undefined), |
| 296 | + * output: (forge.util.ByteStringBuffer|undefined), |
| 297 | + * }} |
| 298 | + */ |
| 299 | +var CipherOptions; |
| 300 | +/** |
| 301 | + * @param {CipherOptions} options |
| 302 | + */ |
| 303 | +forge.cipher.BlockCipher.prototype.start = function(options){}; |
| 304 | +/** |
| 305 | + * @param {forge.util.ByteStringBuffer} input |
| 306 | + */ |
| 307 | +forge.cipher.BlockCipher.prototype.update = function(input){}; |
| 308 | +/** |
| 309 | + * @return {boolean} |
| 310 | + */ |
| 311 | +forge.cipher.BlockCipher.prototype.finish = function(){}; |
| 312 | +/** @type {forge.util.ByteStringBuffer} */ |
| 313 | +forge.cipher.BlockCipher.prototype.output; |
| 314 | +/** |
| 315 | + * @param {string} algorithm |
| 316 | + * @param {forge.util.ByteStringBuffer} key |
| 317 | + * @return {forge.cipher.BlockCipher} |
| 318 | + */ |
| 319 | +forge.cipher.createCipher = function(algorithm, key) {}; |
0 commit comments