@chilkat/react-native 11.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (530) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/ChilkatRN.podspec +44 -0
  3. package/LICENSE +254 -0
  4. package/README.md +67 -0
  5. package/android/CMakeLists.txt +60 -0
  6. package/android/build.gradle +148 -0
  7. package/android/gradle.properties +5 -0
  8. package/android/src/main/AndroidManifest.xml +2 -0
  9. package/android/src/main/cpp/cpp-adapter.cpp +12 -0
  10. package/android/src/main/java/com/margelo/nitro/chilkat/ChilkatRNPackage.java +33 -0
  11. package/chilkat-checksums.json +9 -0
  12. package/cpp/HybridAi.cpp +660 -0
  13. package/cpp/HybridAi.hpp +159 -0
  14. package/cpp/HybridAsn.cpp +403 -0
  15. package/cpp/HybridAsn.hpp +105 -0
  16. package/cpp/HybridAuthAws.cpp +188 -0
  17. package/cpp/HybridAuthAws.hpp +55 -0
  18. package/cpp/HybridAuthAzureSAS.cpp +142 -0
  19. package/cpp/HybridAuthAzureSAS.hpp +47 -0
  20. package/cpp/HybridAuthAzureStorage.cpp +144 -0
  21. package/cpp/HybridAuthAzureStorage.hpp +47 -0
  22. package/cpp/HybridAuthGoogle.cpp +215 -0
  23. package/cpp/HybridAuthGoogle.hpp +67 -0
  24. package/cpp/HybridBinData.cpp +439 -0
  25. package/cpp/HybridBinData.hpp +112 -0
  26. package/cpp/HybridBz2.cpp +177 -0
  27. package/cpp/HybridBz2.hpp +58 -0
  28. package/cpp/HybridCache.cpp +314 -0
  29. package/cpp/HybridCache.hpp +82 -0
  30. package/cpp/HybridCert.cpp +840 -0
  31. package/cpp/HybridCert.hpp +196 -0
  32. package/cpp/HybridCertChain.cpp +149 -0
  33. package/cpp/HybridCertChain.hpp +50 -0
  34. package/cpp/HybridCertStore.cpp +276 -0
  35. package/cpp/HybridCertStore.hpp +78 -0
  36. package/cpp/HybridCharset.cpp +333 -0
  37. package/cpp/HybridCharset.hpp +83 -0
  38. package/cpp/HybridCkDateTime.cpp +384 -0
  39. package/cpp/HybridCkDateTime.hpp +105 -0
  40. package/cpp/HybridCodeSign.cpp +156 -0
  41. package/cpp/HybridCodeSign.hpp +55 -0
  42. package/cpp/HybridCompression.cpp +422 -0
  43. package/cpp/HybridCompression.hpp +100 -0
  44. package/cpp/HybridCrypt2.cpp +1517 -0
  45. package/cpp/HybridCrypt2.hpp +320 -0
  46. package/cpp/HybridCsr.cpp +292 -0
  47. package/cpp/HybridCsr.hpp +77 -0
  48. package/cpp/HybridCsv.cpp +382 -0
  49. package/cpp/HybridCsv.hpp +101 -0
  50. package/cpp/HybridDh.cpp +137 -0
  51. package/cpp/HybridDh.hpp +47 -0
  52. package/cpp/HybridDirTree.cpp +167 -0
  53. package/cpp/HybridDirTree.hpp +53 -0
  54. package/cpp/HybridDkim.cpp +249 -0
  55. package/cpp/HybridDkim.hpp +74 -0
  56. package/cpp/HybridDns.cpp +193 -0
  57. package/cpp/HybridDns.hpp +64 -0
  58. package/cpp/HybridDsa.cpp +453 -0
  59. package/cpp/HybridDsa.hpp +112 -0
  60. package/cpp/HybridDtObj.cpp +172 -0
  61. package/cpp/HybridDtObj.hpp +57 -0
  62. package/cpp/HybridEcc.cpp +195 -0
  63. package/cpp/HybridEcc.hpp +55 -0
  64. package/cpp/HybridEdDSA.cpp +147 -0
  65. package/cpp/HybridEdDSA.hpp +47 -0
  66. package/cpp/HybridEmail.cpp +1911 -0
  67. package/cpp/HybridEmail.hpp +419 -0
  68. package/cpp/HybridEmailBundle.cpp +204 -0
  69. package/cpp/HybridEmailBundle.hpp +64 -0
  70. package/cpp/HybridFileAccess.cpp +631 -0
  71. package/cpp/HybridFileAccess.hpp +149 -0
  72. package/cpp/HybridFtp2.cpp +2308 -0
  73. package/cpp/HybridFtp2.hpp +462 -0
  74. package/cpp/HybridGlobal.cpp +221 -0
  75. package/cpp/HybridGlobal.hpp +68 -0
  76. package/cpp/HybridGzip.cpp +440 -0
  77. package/cpp/HybridGzip.hpp +105 -0
  78. package/cpp/HybridHashtable.cpp +211 -0
  79. package/cpp/HybridHashtable.hpp +64 -0
  80. package/cpp/HybridHtmlToText.cpp +136 -0
  81. package/cpp/HybridHtmlToText.hpp +47 -0
  82. package/cpp/HybridHtmlToXml.cpp +218 -0
  83. package/cpp/HybridHtmlToXml.hpp +65 -0
  84. package/cpp/HybridHttp.cpp +2067 -0
  85. package/cpp/HybridHttp.hpp +416 -0
  86. package/cpp/HybridHttpCurl.cpp +337 -0
  87. package/cpp/HybridHttpCurl.hpp +93 -0
  88. package/cpp/HybridHttpRequest.cpp +455 -0
  89. package/cpp/HybridHttpRequest.hpp +109 -0
  90. package/cpp/HybridHttpResponse.cpp +340 -0
  91. package/cpp/HybridHttpResponse.hpp +86 -0
  92. package/cpp/HybridImap.cpp +1818 -0
  93. package/cpp/HybridImap.hpp +363 -0
  94. package/cpp/HybridJavaKeyStore.cpp +387 -0
  95. package/cpp/HybridJavaKeyStore.hpp +98 -0
  96. package/cpp/HybridJs.cpp +154 -0
  97. package/cpp/HybridJs.hpp +54 -0
  98. package/cpp/HybridJsonArray.cpp +441 -0
  99. package/cpp/HybridJsonArray.hpp +120 -0
  100. package/cpp/HybridJsonObject.cpp +1125 -0
  101. package/cpp/HybridJsonObject.hpp +260 -0
  102. package/cpp/HybridJwe.cpp +294 -0
  103. package/cpp/HybridJwe.hpp +82 -0
  104. package/cpp/HybridJws.cpp +290 -0
  105. package/cpp/HybridJws.hpp +82 -0
  106. package/cpp/HybridJwt.cpp +198 -0
  107. package/cpp/HybridJwt.hpp +57 -0
  108. package/cpp/HybridLog.cpp +212 -0
  109. package/cpp/HybridLog.hpp +63 -0
  110. package/cpp/HybridMailMan.cpp +1853 -0
  111. package/cpp/HybridMailMan.hpp +386 -0
  112. package/cpp/HybridMailboxes.cpp +165 -0
  113. package/cpp/HybridMailboxes.hpp +54 -0
  114. package/cpp/HybridMcp.cpp +322 -0
  115. package/cpp/HybridMcp.hpp +85 -0
  116. package/cpp/HybridMessageSet.cpp +162 -0
  117. package/cpp/HybridMessageSet.hpp +54 -0
  118. package/cpp/HybridMht.cpp +700 -0
  119. package/cpp/HybridMht.hpp +165 -0
  120. package/cpp/HybridMime.cpp +1119 -0
  121. package/cpp/HybridMime.hpp +266 -0
  122. package/cpp/HybridNtlm.cpp +333 -0
  123. package/cpp/HybridNtlm.hpp +83 -0
  124. package/cpp/HybridOAuth1.cpp +307 -0
  125. package/cpp/HybridOAuth1.hpp +78 -0
  126. package/cpp/HybridOAuth2.cpp +515 -0
  127. package/cpp/HybridOAuth2.hpp +127 -0
  128. package/cpp/HybridPdf.cpp +370 -0
  129. package/cpp/HybridPdf.hpp +103 -0
  130. package/cpp/HybridPem.cpp +327 -0
  131. package/cpp/HybridPem.hpp +88 -0
  132. package/cpp/HybridPfx.cpp +343 -0
  133. package/cpp/HybridPfx.hpp +87 -0
  134. package/cpp/HybridPkcs11.cpp +318 -0
  135. package/cpp/HybridPkcs11.hpp +88 -0
  136. package/cpp/HybridPrivateKey.cpp +464 -0
  137. package/cpp/HybridPrivateKey.hpp +117 -0
  138. package/cpp/HybridPrng.cpp +192 -0
  139. package/cpp/HybridPrng.hpp +57 -0
  140. package/cpp/HybridPublicKey.cpp +238 -0
  141. package/cpp/HybridPublicKey.hpp +68 -0
  142. package/cpp/HybridRest.cpp +993 -0
  143. package/cpp/HybridRest.hpp +214 -0
  144. package/cpp/HybridRsa.cpp +348 -0
  145. package/cpp/HybridRsa.hpp +90 -0
  146. package/cpp/HybridSCard.cpp +328 -0
  147. package/cpp/HybridSCard.hpp +91 -0
  148. package/cpp/HybridSFtp.cpp +1889 -0
  149. package/cpp/HybridSFtp.hpp +366 -0
  150. package/cpp/HybridSFtpDir.cpp +119 -0
  151. package/cpp/HybridSFtpDir.hpp +43 -0
  152. package/cpp/HybridSFtpFile.cpp +203 -0
  153. package/cpp/HybridSFtpFile.hpp +60 -0
  154. package/cpp/HybridScMinidriver.cpp +341 -0
  155. package/cpp/HybridScMinidriver.hpp +88 -0
  156. package/cpp/HybridScp.cpp +398 -0
  157. package/cpp/HybridScp.hpp +96 -0
  158. package/cpp/HybridSecrets.cpp +328 -0
  159. package/cpp/HybridSecrets.hpp +84 -0
  160. package/cpp/HybridSecureString.cpp +175 -0
  161. package/cpp/HybridSecureString.hpp +55 -0
  162. package/cpp/HybridServerSentEvent.cpp +112 -0
  163. package/cpp/HybridServerSentEvent.hpp +41 -0
  164. package/cpp/HybridSocket.cpp +1567 -0
  165. package/cpp/HybridSocket.hpp +336 -0
  166. package/cpp/HybridSpider.cpp +543 -0
  167. package/cpp/HybridSpider.hpp +138 -0
  168. package/cpp/HybridSsh.cpp +1330 -0
  169. package/cpp/HybridSsh.hpp +282 -0
  170. package/cpp/HybridSshKey.cpp +310 -0
  171. package/cpp/HybridSshKey.hpp +83 -0
  172. package/cpp/HybridSshTunnel.cpp +687 -0
  173. package/cpp/HybridSshTunnel.hpp +159 -0
  174. package/cpp/HybridStream.cpp +496 -0
  175. package/cpp/HybridStream.hpp +123 -0
  176. package/cpp/HybridStringArray.cpp +368 -0
  177. package/cpp/HybridStringArray.hpp +99 -0
  178. package/cpp/HybridStringBuilder.cpp +739 -0
  179. package/cpp/HybridStringBuilder.hpp +178 -0
  180. package/cpp/HybridStringTable.cpp +218 -0
  181. package/cpp/HybridStringTable.hpp +66 -0
  182. package/cpp/HybridTar.cpp +547 -0
  183. package/cpp/HybridTar.hpp +134 -0
  184. package/cpp/HybridTrustedRoots.cpp +178 -0
  185. package/cpp/HybridTrustedRoots.hpp +61 -0
  186. package/cpp/HybridUnixCompress.cpp +191 -0
  187. package/cpp/HybridUnixCompress.hpp +60 -0
  188. package/cpp/HybridUpload.cpp +427 -0
  189. package/cpp/HybridUpload.hpp +114 -0
  190. package/cpp/HybridUrl.cpp +152 -0
  191. package/cpp/HybridUrl.hpp +48 -0
  192. package/cpp/HybridWebSocket.cpp +378 -0
  193. package/cpp/HybridWebSocket.hpp +103 -0
  194. package/cpp/HybridXml.cpp +1527 -0
  195. package/cpp/HybridXml.hpp +340 -0
  196. package/cpp/HybridXmlCertVault.cpp +215 -0
  197. package/cpp/HybridXmlCertVault.hpp +63 -0
  198. package/cpp/HybridXmlDSig.cpp +328 -0
  199. package/cpp/HybridXmlDSig.hpp +88 -0
  200. package/cpp/HybridXmlDSigGen.cpp +549 -0
  201. package/cpp/HybridXmlDSigGen.hpp +126 -0
  202. package/cpp/HybridXmp.cpp +329 -0
  203. package/cpp/HybridXmp.hpp +86 -0
  204. package/cpp/HybridZip.cpp +1000 -0
  205. package/cpp/HybridZip.hpp +226 -0
  206. package/cpp/HybridZipCrc.cpp +162 -0
  207. package/cpp/HybridZipCrc.hpp +57 -0
  208. package/cpp/HybridZipEntry.cpp +395 -0
  209. package/cpp/HybridZipEntry.hpp +102 -0
  210. package/cpp/runtime/AsyncCall.hpp +96 -0
  211. package/cpp/runtime/Bytes.hpp +49 -0
  212. package/cpp/runtime/ChilkatError.hpp +66 -0
  213. package/cpp/runtime/ChilkatObject.hpp +219 -0
  214. package/cpp/runtime/ProgLang.hpp +9 -0
  215. package/cpp/runtime/ProgressAdapter.hpp +43 -0
  216. package/nitro.json +113 -0
  217. package/nitrogen/generated/.gitattributes +1 -0
  218. package/nitrogen/generated/android/ChilkatRN+autolinking.cmake +179 -0
  219. package/nitrogen/generated/android/ChilkatRN+autolinking.gradle +27 -0
  220. package/nitrogen/generated/android/ChilkatRNOnLoad.cpp +1029 -0
  221. package/nitrogen/generated/android/ChilkatRNOnLoad.hpp +34 -0
  222. package/nitrogen/generated/android/kotlin/com/margelo/nitro/chilkat/ChilkatRNOnLoad.kt +35 -0
  223. package/nitrogen/generated/ios/ChilkatRN+autolinking.rb +62 -0
  224. package/nitrogen/generated/ios/ChilkatRN-Swift-Cxx-Bridge.cpp +17 -0
  225. package/nitrogen/generated/ios/ChilkatRN-Swift-Cxx-Bridge.hpp +27 -0
  226. package/nitrogen/generated/ios/ChilkatRN-Swift-Cxx-Umbrella.hpp +38 -0
  227. package/nitrogen/generated/ios/ChilkatRNAutolinking.mm +1015 -0
  228. package/nitrogen/generated/ios/ChilkatRNAutolinking.swift +16 -0
  229. package/nitrogen/generated/shared/c++/HybridAiSpec.cpp +114 -0
  230. package/nitrogen/generated/shared/c++/HybridAiSpec.hpp +175 -0
  231. package/nitrogen/generated/shared/c++/HybridAsnSpec.cpp +70 -0
  232. package/nitrogen/generated/shared/c++/HybridAsnSpec.hpp +116 -0
  233. package/nitrogen/generated/shared/c++/HybridAuthAwsSpec.cpp +49 -0
  234. package/nitrogen/generated/shared/c++/HybridAuthAwsSpec.hpp +89 -0
  235. package/nitrogen/generated/shared/c++/HybridAuthAzureSASSpec.cpp +38 -0
  236. package/nitrogen/generated/shared/c++/HybridAuthAzureSASSpec.hpp +78 -0
  237. package/nitrogen/generated/shared/c++/HybridAuthAzureStorageSpec.cpp +41 -0
  238. package/nitrogen/generated/shared/c++/HybridAuthAzureStorageSpec.hpp +81 -0
  239. package/nitrogen/generated/shared/c++/HybridAuthGoogleSpec.cpp +56 -0
  240. package/nitrogen/generated/shared/c++/HybridAuthGoogleSpec.hpp +108 -0
  241. package/nitrogen/generated/shared/c++/HybridBinDataSpec.cpp +69 -0
  242. package/nitrogen/generated/shared/c++/HybridBinDataSpec.hpp +116 -0
  243. package/nitrogen/generated/shared/c++/HybridBz2Spec.cpp +47 -0
  244. package/nitrogen/generated/shared/c++/HybridBz2Spec.hpp +93 -0
  245. package/nitrogen/generated/shared/c++/HybridCacheSpec.cpp +57 -0
  246. package/nitrogen/generated/shared/c++/HybridCacheSpec.hpp +106 -0
  247. package/nitrogen/generated/shared/c++/HybridCertChainSpec.cpp +40 -0
  248. package/nitrogen/generated/shared/c++/HybridCertChainSpec.hpp +89 -0
  249. package/nitrogen/generated/shared/c++/HybridCertSpec.cpp +138 -0
  250. package/nitrogen/generated/shared/c++/HybridCertSpec.hpp +205 -0
  251. package/nitrogen/generated/shared/c++/HybridCertStoreSpec.cpp +55 -0
  252. package/nitrogen/generated/shared/c++/HybridCertStoreSpec.hpp +104 -0
  253. package/nitrogen/generated/shared/c++/HybridCharsetSpec.cpp +61 -0
  254. package/nitrogen/generated/shared/c++/HybridCharsetSpec.hpp +101 -0
  255. package/nitrogen/generated/shared/c++/HybridCkDateTimeSpec.cpp +66 -0
  256. package/nitrogen/generated/shared/c++/HybridCkDateTimeSpec.hpp +115 -0
  257. package/nitrogen/generated/shared/c++/HybridCodeSignSpec.cpp +44 -0
  258. package/nitrogen/generated/shared/c++/HybridCodeSignSpec.hpp +93 -0
  259. package/nitrogen/generated/shared/c++/HybridCompressionSpec.cpp +79 -0
  260. package/nitrogen/generated/shared/c++/HybridCompressionSpec.hpp +134 -0
  261. package/nitrogen/generated/shared/c++/HybridCrypt2Spec.cpp +215 -0
  262. package/nitrogen/generated/shared/c++/HybridCrypt2Spec.hpp +283 -0
  263. package/nitrogen/generated/shared/c++/HybridCsrSpec.cpp +61 -0
  264. package/nitrogen/generated/shared/c++/HybridCsrSpec.hpp +116 -0
  265. package/nitrogen/generated/shared/c++/HybridCsvSpec.cpp +72 -0
  266. package/nitrogen/generated/shared/c++/HybridCsvSpec.hpp +121 -0
  267. package/nitrogen/generated/shared/c++/HybridDhSpec.cpp +37 -0
  268. package/nitrogen/generated/shared/c++/HybridDhSpec.hpp +77 -0
  269. package/nitrogen/generated/shared/c++/HybridDirTreeSpec.cpp +46 -0
  270. package/nitrogen/generated/shared/c++/HybridDirTreeSpec.hpp +86 -0
  271. package/nitrogen/generated/shared/c++/HybridDkimSpec.cpp +60 -0
  272. package/nitrogen/generated/shared/c++/HybridDkimSpec.hpp +109 -0
  273. package/nitrogen/generated/shared/c++/HybridDnsSpec.cpp +51 -0
  274. package/nitrogen/generated/shared/c++/HybridDnsSpec.hpp +97 -0
  275. package/nitrogen/generated/shared/c++/HybridDsaSpec.cpp +73 -0
  276. package/nitrogen/generated/shared/c++/HybridDsaSpec.hpp +116 -0
  277. package/nitrogen/generated/shared/c++/HybridDtObjSpec.cpp +50 -0
  278. package/nitrogen/generated/shared/c++/HybridDtObjSpec.hpp +90 -0
  279. package/nitrogen/generated/shared/c++/HybridEccSpec.cpp +41 -0
  280. package/nitrogen/generated/shared/c++/HybridEccSpec.hpp +96 -0
  281. package/nitrogen/generated/shared/c++/HybridEdDSASpec.cpp +38 -0
  282. package/nitrogen/generated/shared/c++/HybridEdDSASpec.hpp +90 -0
  283. package/nitrogen/generated/shared/c++/HybridEmailBundleSpec.cpp +45 -0
  284. package/nitrogen/generated/shared/c++/HybridEmailBundleSpec.hpp +91 -0
  285. package/nitrogen/generated/shared/c++/HybridEmailSpec.cpp +259 -0
  286. package/nitrogen/generated/shared/c++/HybridEmailSpec.hpp +326 -0
  287. package/nitrogen/generated/shared/c++/HybridFileAccessSpec.cpp +90 -0
  288. package/nitrogen/generated/shared/c++/HybridFileAccessSpec.hpp +140 -0
  289. package/nitrogen/generated/shared/c++/HybridFtp2Spec.cpp +367 -0
  290. package/nitrogen/generated/shared/c++/HybridFtp2Spec.hpp +434 -0
  291. package/nitrogen/generated/shared/c++/HybridGlobalSpec.cpp +59 -0
  292. package/nitrogen/generated/shared/c++/HybridGlobalSpec.hpp +99 -0
  293. package/nitrogen/generated/shared/c++/HybridGzipSpec.cpp +79 -0
  294. package/nitrogen/generated/shared/c++/HybridGzipSpec.hpp +134 -0
  295. package/nitrogen/generated/shared/c++/HybridHashtableSpec.cpp +45 -0
  296. package/nitrogen/generated/shared/c++/HybridHashtableSpec.hpp +91 -0
  297. package/nitrogen/generated/shared/c++/HybridHtmlToTextSpec.cpp +40 -0
  298. package/nitrogen/generated/shared/c++/HybridHtmlToTextSpec.hpp +83 -0
  299. package/nitrogen/generated/shared/c++/HybridHtmlToXmlSpec.cpp +49 -0
  300. package/nitrogen/generated/shared/c++/HybridHtmlToXmlSpec.hpp +95 -0
  301. package/nitrogen/generated/shared/c++/HybridHttpCurlSpec.cpp +67 -0
  302. package/nitrogen/generated/shared/c++/HybridHttpCurlSpec.hpp +125 -0
  303. package/nitrogen/generated/shared/c++/HybridHttpRequestSpec.cpp +76 -0
  304. package/nitrogen/generated/shared/c++/HybridHttpRequestSpec.hpp +122 -0
  305. package/nitrogen/generated/shared/c++/HybridHttpResponseSpec.cpp +64 -0
  306. package/nitrogen/generated/shared/c++/HybridHttpResponseSpec.hpp +119 -0
  307. package/nitrogen/generated/shared/c++/HybridHttpSpec.cpp +334 -0
  308. package/nitrogen/generated/shared/c++/HybridHttpSpec.hpp +407 -0
  309. package/nitrogen/generated/shared/c++/HybridImapSpec.cpp +275 -0
  310. package/nitrogen/generated/shared/c++/HybridImapSpec.hpp +360 -0
  311. package/nitrogen/generated/shared/c++/HybridJavaKeyStoreSpec.cpp +65 -0
  312. package/nitrogen/generated/shared/c++/HybridJavaKeyStoreSpec.hpp +132 -0
  313. package/nitrogen/generated/shared/c++/HybridJsSpec.cpp +43 -0
  314. package/nitrogen/generated/shared/c++/HybridJsSpec.hpp +92 -0
  315. package/nitrogen/generated/shared/c++/HybridJsonArraySpec.cpp +76 -0
  316. package/nitrogen/generated/shared/c++/HybridJsonArraySpec.hpp +131 -0
  317. package/nitrogen/generated/shared/c++/HybridJsonObjectSpec.cpp +154 -0
  318. package/nitrogen/generated/shared/c++/HybridJsonObjectSpec.hpp +218 -0
  319. package/nitrogen/generated/shared/c++/HybridJweSpec.cpp +57 -0
  320. package/nitrogen/generated/shared/c++/HybridJweSpec.hpp +112 -0
  321. package/nitrogen/generated/shared/c++/HybridJwsSpec.cpp +57 -0
  322. package/nitrogen/generated/shared/c++/HybridJwsSpec.hpp +115 -0
  323. package/nitrogen/generated/shared/c++/HybridJwtSpec.cpp +43 -0
  324. package/nitrogen/generated/shared/c++/HybridJwtSpec.hpp +92 -0
  325. package/nitrogen/generated/shared/c++/HybridLogSpec.cpp +44 -0
  326. package/nitrogen/generated/shared/c++/HybridLogSpec.hpp +85 -0
  327. package/nitrogen/generated/shared/c++/HybridMailManSpec.cpp +311 -0
  328. package/nitrogen/generated/shared/c++/HybridMailManSpec.hpp +396 -0
  329. package/nitrogen/generated/shared/c++/HybridMailboxesSpec.cpp +40 -0
  330. package/nitrogen/generated/shared/c++/HybridMailboxesSpec.hpp +80 -0
  331. package/nitrogen/generated/shared/c++/HybridMcpSpec.cpp +68 -0
  332. package/nitrogen/generated/shared/c++/HybridMcpSpec.hpp +117 -0
  333. package/nitrogen/generated/shared/c++/HybridMessageSetSpec.cpp +41 -0
  334. package/nitrogen/generated/shared/c++/HybridMessageSetSpec.hpp +84 -0
  335. package/nitrogen/generated/shared/c++/HybridMhtSpec.cpp +138 -0
  336. package/nitrogen/generated/shared/c++/HybridMhtSpec.hpp +181 -0
  337. package/nitrogen/generated/shared/c++/HybridMimeSpec.cpp +169 -0
  338. package/nitrogen/generated/shared/c++/HybridMimeSpec.hpp +233 -0
  339. package/nitrogen/generated/shared/c++/HybridNtlmSpec.cpp +69 -0
  340. package/nitrogen/generated/shared/c++/HybridNtlmSpec.hpp +109 -0
  341. package/nitrogen/generated/shared/c++/HybridOAuth1Spec.cpp +67 -0
  342. package/nitrogen/generated/shared/c++/HybridOAuth1Spec.hpp +110 -0
  343. package/nitrogen/generated/shared/c++/HybridOAuth2Spec.cpp +107 -0
  344. package/nitrogen/generated/shared/c++/HybridOAuth2Spec.hpp +156 -0
  345. package/nitrogen/generated/shared/c++/HybridPdfSpec.cpp +73 -0
  346. package/nitrogen/generated/shared/c++/HybridPdfSpec.hpp +134 -0
  347. package/nitrogen/generated/shared/c++/HybridPemSpec.cpp +63 -0
  348. package/nitrogen/generated/shared/c++/HybridPemSpec.hpp +124 -0
  349. package/nitrogen/generated/shared/c++/HybridPfxSpec.cpp +61 -0
  350. package/nitrogen/generated/shared/c++/HybridPfxSpec.hpp +122 -0
  351. package/nitrogen/generated/shared/c++/HybridPkcs11Spec.cpp +60 -0
  352. package/nitrogen/generated/shared/c++/HybridPkcs11Spec.hpp +115 -0
  353. package/nitrogen/generated/shared/c++/HybridPrivateKeySpec.cpp +76 -0
  354. package/nitrogen/generated/shared/c++/HybridPrivateKeySpec.hpp +131 -0
  355. package/nitrogen/generated/shared/c++/HybridPrngSpec.cpp +42 -0
  356. package/nitrogen/generated/shared/c++/HybridPrngSpec.hpp +85 -0
  357. package/nitrogen/generated/shared/c++/HybridPublicKeySpec.cpp +48 -0
  358. package/nitrogen/generated/shared/c++/HybridPublicKeySpec.hpp +91 -0
  359. package/nitrogen/generated/shared/c++/HybridRestSpec.cpp +150 -0
  360. package/nitrogen/generated/shared/c++/HybridRestSpec.hpp +229 -0
  361. package/nitrogen/generated/shared/c++/HybridRsaSpec.cpp +68 -0
  362. package/nitrogen/generated/shared/c++/HybridRsaSpec.hpp +120 -0
  363. package/nitrogen/generated/shared/c++/HybridSCardSpec.cpp +64 -0
  364. package/nitrogen/generated/shared/c++/HybridSCardSpec.hpp +116 -0
  365. package/nitrogen/generated/shared/c++/HybridSFtpDirSpec.cpp +35 -0
  366. package/nitrogen/generated/shared/c++/HybridSFtpDirSpec.hpp +78 -0
  367. package/nitrogen/generated/shared/c++/HybridSFtpFileSpec.cpp +57 -0
  368. package/nitrogen/generated/shared/c++/HybridSFtpFileSpec.hpp +98 -0
  369. package/nitrogen/generated/shared/c++/HybridSFtpSpec.cpp +284 -0
  370. package/nitrogen/generated/shared/c++/HybridSFtpSpec.hpp +354 -0
  371. package/nitrogen/generated/shared/c++/HybridScMinidriverSpec.cpp +61 -0
  372. package/nitrogen/generated/shared/c++/HybridScMinidriverSpec.hpp +119 -0
  373. package/nitrogen/generated/shared/c++/HybridScpSpec.cpp +78 -0
  374. package/nitrogen/generated/shared/c++/HybridScpSpec.hpp +127 -0
  375. package/nitrogen/generated/shared/c++/HybridSecretsSpec.cpp +65 -0
  376. package/nitrogen/generated/shared/c++/HybridSecretsSpec.hpp +120 -0
  377. package/nitrogen/generated/shared/c++/HybridSecureStringSpec.cpp +42 -0
  378. package/nitrogen/generated/shared/c++/HybridSecureStringSpec.hpp +88 -0
  379. package/nitrogen/generated/shared/c++/HybridServerSentEventSpec.cpp +35 -0
  380. package/nitrogen/generated/shared/c++/HybridServerSentEventSpec.hpp +75 -0
  381. package/nitrogen/generated/shared/c++/HybridSocketSpec.cpp +262 -0
  382. package/nitrogen/generated/shared/c++/HybridSocketSpec.hpp +327 -0
  383. package/nitrogen/generated/shared/c++/HybridSpiderSpec.cpp +110 -0
  384. package/nitrogen/generated/shared/c++/HybridSpiderSpec.hpp +153 -0
  385. package/nitrogen/generated/shared/c++/HybridSshKeySpec.cpp +59 -0
  386. package/nitrogen/generated/shared/c++/HybridSshKeySpec.hpp +102 -0
  387. package/nitrogen/generated/shared/c++/HybridSshSpec.cpp +215 -0
  388. package/nitrogen/generated/shared/c++/HybridSshSpec.hpp +276 -0
  389. package/nitrogen/generated/shared/c++/HybridSshTunnelSpec.cpp +136 -0
  390. package/nitrogen/generated/shared/c++/HybridSshTunnelSpec.hpp +191 -0
  391. package/nitrogen/generated/shared/c++/HybridStreamSpec.cpp +100 -0
  392. package/nitrogen/generated/shared/c++/HybridStreamSpec.hpp +150 -0
  393. package/nitrogen/generated/shared/c++/HybridStringArraySpec.cpp +66 -0
  394. package/nitrogen/generated/shared/c++/HybridStringArraySpec.hpp +109 -0
  395. package/nitrogen/generated/shared/c++/HybridStringBuilderSpec.cpp +104 -0
  396. package/nitrogen/generated/shared/c++/HybridStringBuilderSpec.hpp +156 -0
  397. package/nitrogen/generated/shared/c++/HybridStringTableSpec.cpp +46 -0
  398. package/nitrogen/generated/shared/c++/HybridStringTableSpec.hpp +89 -0
  399. package/nitrogen/generated/shared/c++/HybridTarSpec.cpp +110 -0
  400. package/nitrogen/generated/shared/c++/HybridTarSpec.hpp +156 -0
  401. package/nitrogen/generated/shared/c++/HybridTrustedRootsSpec.cpp +48 -0
  402. package/nitrogen/generated/shared/c++/HybridTrustedRootsSpec.hpp +97 -0
  403. package/nitrogen/generated/shared/c++/HybridUnixCompressSpec.cpp +48 -0
  404. package/nitrogen/generated/shared/c++/HybridUnixCompressSpec.hpp +91 -0
  405. package/nitrogen/generated/shared/c++/HybridUploadSpec.cpp +98 -0
  406. package/nitrogen/generated/shared/c++/HybridUploadSpec.hpp +141 -0
  407. package/nitrogen/generated/shared/c++/HybridUrlSpec.cpp +42 -0
  408. package/nitrogen/generated/shared/c++/HybridUrlSpec.hpp +82 -0
  409. package/nitrogen/generated/shared/c++/HybridWebSocketSpec.cpp +80 -0
  410. package/nitrogen/generated/shared/c++/HybridWebSocketSpec.hpp +135 -0
  411. package/nitrogen/generated/shared/c++/HybridXmlCertVaultSpec.cpp +45 -0
  412. package/nitrogen/generated/shared/c++/HybridXmlCertVaultSpec.hpp +94 -0
  413. package/nitrogen/generated/shared/c++/HybridXmlDSigGenSpec.cpp +99 -0
  414. package/nitrogen/generated/shared/c++/HybridXmlDSigGenSpec.hpp +163 -0
  415. package/nitrogen/generated/shared/c++/HybridXmlDSigSpec.cpp +62 -0
  416. package/nitrogen/generated/shared/c++/HybridXmlDSigSpec.hpp +126 -0
  417. package/nitrogen/generated/shared/c++/HybridXmlSpec.cpp +203 -0
  418. package/nitrogen/generated/shared/c++/HybridXmlSpec.hpp +253 -0
  419. package/nitrogen/generated/shared/c++/HybridXmpSpec.cpp +58 -0
  420. package/nitrogen/generated/shared/c++/HybridXmpSpec.hpp +104 -0
  421. package/nitrogen/generated/shared/c++/HybridZipCrcSpec.cpp +43 -0
  422. package/nitrogen/generated/shared/c++/HybridZipCrcSpec.hpp +92 -0
  423. package/nitrogen/generated/shared/c++/HybridZipEntrySpec.cpp +82 -0
  424. package/nitrogen/generated/shared/c++/HybridZipEntrySpec.hpp +137 -0
  425. package/nitrogen/generated/shared/c++/HybridZipSpec.cpp +176 -0
  426. package/nitrogen/generated/shared/c++/HybridZipSpec.hpp +231 -0
  427. package/package.json +46 -0
  428. package/react-native.config.js +9 -0
  429. package/scripts/fetch-chilkat.js +184 -0
  430. package/src/index.ts +306 -0
  431. package/src/runtime/chilkat.ts +25 -0
  432. package/src/specs/Ai.nitro.ts +1288 -0
  433. package/src/specs/Asn.nitro.ts +509 -0
  434. package/src/specs/AuthAws.nitro.ts +234 -0
  435. package/src/specs/AuthAzureSAS.nitro.ts +205 -0
  436. package/src/specs/AuthAzureStorage.nitro.ts +172 -0
  437. package/src/specs/AuthGoogle.nitro.ts +291 -0
  438. package/src/specs/BinData.nitro.ts +470 -0
  439. package/src/specs/Bz2.nitro.ts +269 -0
  440. package/src/specs/Cache.nitro.ts +483 -0
  441. package/src/specs/Cert.nitro.ts +1279 -0
  442. package/src/specs/CertChain.nitro.ts +312 -0
  443. package/src/specs/CertStore.nitro.ts +430 -0
  444. package/src/specs/Charset.nitro.ts +518 -0
  445. package/src/specs/CkDateTime.nitro.ts +492 -0
  446. package/src/specs/CodeSign.nitro.ts +307 -0
  447. package/src/specs/Compression.nitro.ts +654 -0
  448. package/src/specs/Crypt2.nitro.ts +2387 -0
  449. package/src/specs/Csr.nitro.ts +461 -0
  450. package/src/specs/Csv.nitro.ts +670 -0
  451. package/src/specs/Dh.nitro.ts +343 -0
  452. package/src/specs/DirTree.nitro.ts +332 -0
  453. package/src/specs/Dkim.nitro.ts +595 -0
  454. package/src/specs/Dns.nitro.ts +271 -0
  455. package/src/specs/Dsa.nitro.ts +653 -0
  456. package/src/specs/DtObj.nitro.ts +198 -0
  457. package/src/specs/Ecc.nitro.ts +375 -0
  458. package/src/specs/EdDSA.nitro.ts +273 -0
  459. package/src/specs/Email.nitro.ts +2921 -0
  460. package/src/specs/EmailBundle.nitro.ts +334 -0
  461. package/src/specs/FileAccess.nitro.ts +836 -0
  462. package/src/specs/Ftp2.nitro.ts +3943 -0
  463. package/src/specs/Global.nitro.ts +319 -0
  464. package/src/specs/Gzip.nitro.ts +646 -0
  465. package/src/specs/Hashtable.nitro.ts +356 -0
  466. package/src/specs/HtmlToText.nitro.ts +238 -0
  467. package/src/specs/HtmlToXml.nitro.ts +323 -0
  468. package/src/specs/Http.nitro.ts +3095 -0
  469. package/src/specs/HttpCurl.nitro.ts +550 -0
  470. package/src/specs/HttpRequest.nitro.ts +522 -0
  471. package/src/specs/HttpResponse.nitro.ts +424 -0
  472. package/src/specs/Imap.nitro.ts +2991 -0
  473. package/src/specs/JavaKeyStore.nitro.ts +619 -0
  474. package/src/specs/Js.nitro.ts +263 -0
  475. package/src/specs/JsonArray.nitro.ts +681 -0
  476. package/src/specs/JsonObject.nitro.ts +1454 -0
  477. package/src/specs/Jwe.nitro.ts +756 -0
  478. package/src/specs/Jws.nitro.ts +733 -0
  479. package/src/specs/Jwt.nitro.ts +380 -0
  480. package/src/specs/Log.nitro.ts +258 -0
  481. package/src/specs/MailMan.nitro.ts +3571 -0
  482. package/src/specs/Mailboxes.nitro.ts +251 -0
  483. package/src/specs/Mcp.nitro.ts +491 -0
  484. package/src/specs/MessageSet.nitro.ts +320 -0
  485. package/src/specs/Mht.nitro.ts +1684 -0
  486. package/src/specs/Mime.nitro.ts +1745 -0
  487. package/src/specs/Ntlm.nitro.ts +556 -0
  488. package/src/specs/OAuth1.nitro.ts +331 -0
  489. package/src/specs/OAuth2.nitro.ts +1023 -0
  490. package/src/specs/Pdf.nitro.ts +740 -0
  491. package/src/specs/Pem.nitro.ts +484 -0
  492. package/src/specs/Pfx.nitro.ts +1003 -0
  493. package/src/specs/Pkcs11.nitro.ts +559 -0
  494. package/src/specs/PrivateKey.nitro.ts +994 -0
  495. package/src/specs/Prng.nitro.ts +348 -0
  496. package/src/specs/PublicKey.nitro.ts +610 -0
  497. package/src/specs/Rest.nitro.ts +1972 -0
  498. package/src/specs/Rsa.nitro.ts +453 -0
  499. package/src/specs/SCard.nitro.ts +739 -0
  500. package/src/specs/SFtp.nitro.ts +3138 -0
  501. package/src/specs/SFtpDir.nitro.ts +213 -0
  502. package/src/specs/SFtpFile.nitro.ts +452 -0
  503. package/src/specs/ScMinidriver.nitro.ts +443 -0
  504. package/src/specs/Scp.nitro.ts +708 -0
  505. package/src/specs/Secrets.nitro.ts +470 -0
  506. package/src/specs/SecureString.nitro.ts +231 -0
  507. package/src/specs/ServerSentEvent.nitro.ts +183 -0
  508. package/src/specs/Socket.nitro.ts +3335 -0
  509. package/src/specs/Spider.nitro.ts +609 -0
  510. package/src/specs/Ssh.nitro.ts +2842 -0
  511. package/src/specs/SshKey.nitro.ts +740 -0
  512. package/src/specs/SshTunnel.nitro.ts +1243 -0
  513. package/src/specs/Stream.nitro.ts +737 -0
  514. package/src/specs/StringArray.nitro.ts +396 -0
  515. package/src/specs/StringBuilder.nitro.ts +920 -0
  516. package/src/specs/StringTable.nitro.ts +271 -0
  517. package/src/specs/Tar.nitro.ts +804 -0
  518. package/src/specs/TrustedRoots.nitro.ts +360 -0
  519. package/src/specs/UnixCompress.nitro.ts +293 -0
  520. package/src/specs/Upload.nitro.ts +623 -0
  521. package/src/specs/Url.nitro.ts +246 -0
  522. package/src/specs/WebSocket.nitro.ts +840 -0
  523. package/src/specs/Xml.nitro.ts +1988 -0
  524. package/src/specs/XmlCertVault.nitro.ts +259 -0
  525. package/src/specs/XmlDSig.nitro.ts +464 -0
  526. package/src/specs/XmlDSigGen.nitro.ts +978 -0
  527. package/src/specs/Xmp.nitro.ts +364 -0
  528. package/src/specs/Zip.nitro.ts +1611 -0
  529. package/src/specs/ZipCrc.nitro.ts +229 -0
  530. package/src/specs/ZipEntry.nitro.ts +782 -0
@@ -0,0 +1,2387 @@
1
+ // Generated by ReactNativeNs.RnGenerator -- do not edit.
2
+ import type { HybridObject } from 'react-native-nitro-modules'
3
+ import type { BinData } from './BinData.nitro'
4
+ import type { Cert } from './Cert.nitro'
5
+ import type { Http } from './Http.nitro'
6
+ import type { JsonObject } from './JsonObject.nitro'
7
+ import type { PrivateKey } from './PrivateKey.nitro'
8
+ import type { SecureString } from './SecureString.nitro'
9
+ import type { StringBuilder } from './StringBuilder.nitro'
10
+ import type { XmlCertVault } from './XmlCertVault.nitro'
11
+
12
+ /**
13
+ * Encrypt, decrypt, hash, sign, verify, encode, and authenticate data.
14
+ *
15
+ * `Crypt2` is a broad cryptographic utility class for
16
+ * applications that need symmetric encryption, decryption, hashing, HMACs,
17
+ * key derivation, random data generation, one-time passwords, binary encoding,
18
+ * PKCS#7/CMS signatures, CAdES options, and certificate-based public-key
19
+ * encryption and decryption. It works with strings, files, byte data,
20
+ * `BinData`, and `StringBuilder` objects, making it useful
21
+ * for both small in-memory operations and file-based cryptographic workflows.
22
+ *
23
+ * **Encryption and decryption**
24
+ *
25
+ * Encrypt and decrypt strings, files, byte arrays, and Chilkat buffer
26
+ * objects using configurable algorithms, modes, keys, IVs, padding, and
27
+ * encodings.
28
+ *
29
+ * **Hashes and HMACs**
30
+ *
31
+ * Compute message digests and keyed message authentication codes for text,
32
+ * files, byte data, and in-memory buffers.
33
+ *
34
+ * **PKCS#7 / CMS signatures**
35
+ *
36
+ * Create and verify signed data, detached signatures, opaque signatures,
37
+ * and certificate-based signature formats used in many security workflows.
38
+ *
39
+ * **CAdES support**
40
+ *
41
+ * Use CAdES-related options when advanced CMS signature profiles are
42
+ * required for compliance or interoperability.
43
+ *
44
+ * **Key and random utilities**
45
+ *
46
+ * Derive keys, generate random bytes, create one-time passwords, and
47
+ * prepare keying material for cryptographic operations.
48
+ *
49
+ * **Encoding and data conversion**
50
+ *
51
+ * Encode and decode binary data using formats such as Base64, hex, URL
52
+ * encoding, and other supported binary encodings.
53
+ *
54
+ * **Common pattern:**
55
+ * Choose the cryptographic operation, set the algorithm and related options,
56
+ * provide keys, certificates, passwords, IVs, or encoding settings as needed,
57
+ * then call the method matching the data form: string, file, bytes,
58
+ * `BinData`, or `StringBuilder`. Check
59
+ * `LastErrorText` when diagnosing algorithm, key, certificate,
60
+ * signature, or encoding issues.
61
+ *
62
+ * For an extended overview, see
63
+ * [Crypt2 Class Overview](https://www.chilkatsoft.com/crypt2_class_overview.asp).
64
+ *
65
+ * Each `Crypt2` instance owns a native Chilkat object. It is released when the JavaScript object is
66
+ * garbage collected, or immediately by `dispose()`; any use after `dispose()` throws.
67
+ * Create one with `new Crypt2()`.
68
+ *
69
+ * Methods that can take a while (network, files, compression, key generation) also have an
70
+ * `...Async` form returning a `Promise`; it runs on a native worker thread so the UI keeps
71
+ * rendering. While such a call is pending, every other call on this object throws, except
72
+ * {@link Crypt2.abort} and assigning {@link Crypt2.onPercentDone} / {@link Crypt2.onProgressInfo}.
73
+ */
74
+ export interface Crypt2 extends HybridObject<{ ios: 'c++', android: 'c++' }> {
75
+ // ---- Properties ----
76
+
77
+ /**
78
+ * Provides HTML-formatted information about the last called method or property. If a method call
79
+ * fails or behaves unexpectedly, check this property for details. Note that information is
80
+ * available regardless of the method call's success.
81
+ *
82
+ * This property is read-only.
83
+ */
84
+ readonly lastErrorHtml: string
85
+
86
+ /**
87
+ * Provides plain text information about the last called method or property. If a method call
88
+ * fails or behaves unexpectedly, check this property for details. Note that information is
89
+ * available regardless of the method call's success.
90
+ *
91
+ * This property is read-only.
92
+ */
93
+ readonly lastErrorText: string
94
+
95
+ /**
96
+ * Provides XML-formatted information about the last called method or property. If a method call
97
+ * fails or behaves unexpectedly, check this property for details. Note that information is
98
+ * available regardless of the method call's success.
99
+ *
100
+ * This property is read-only.
101
+ */
102
+ readonly lastErrorXml: string
103
+
104
+ /**
105
+ * Version of the component/library, such as "10.1.0"
106
+ *
107
+ * This property is read-only.
108
+ */
109
+ readonly version: string
110
+
111
+ /**
112
+ * If set to a file path, this property logs the LastErrorText of each Chilkat method or property
113
+ * call to the specified file. This logging helps identify the context and history of Chilkat
114
+ * calls leading up to any crash or hang, aiding in debugging.
115
+ *
116
+ * Enabling the VerboseLogging property provides more detailed information.
117
+ *
118
+ * This property is mainly used for debugging rare instances where a Chilkat method call causes a
119
+ * hang or crash, which should generally not happen.
120
+ *
121
+ * Possible causes of hangs include:
122
+ *
123
+ * - A timeout property set to 0, indicating an infinite timeout.
124
+ *
125
+ * - A hang occurring within an event callback in the application code.
126
+ *
127
+ * - An internal bug in the Chilkat code causing the hang.
128
+ */
129
+ debugLogFilePath: string
130
+
131
+ /**
132
+ * If set to `true`, then the contents of LastErrorText (or LastErrorXml, or LastErrorHtml) may
133
+ * contain more verbose information. The default value is `false`. Verbose logging should only be
134
+ * used for debugging. The potentially large quantity of logged information may adversely affect
135
+ * peformance.
136
+ */
137
+ verboseLogging: boolean
138
+
139
+ /**
140
+ * Indicates the success or failure of the most recent method call: `true` means success, `false`
141
+ * means failure. This property remains unchanged by property setters or getters. This method is
142
+ * present to address challenges in checking for null or Nothing returns in certain programming
143
+ * languages. Note: This property does not apply to methods that return integer values or to
144
+ * boolean-returning methods where the boolean does not indicate success or failure.
145
+ */
146
+ lastMethodSuccess: boolean
147
+
148
+ /**
149
+ * Setting this property to `true` will abort the current method, but only for those methods
150
+ * having an `Async` alternative. The property automatically resets to `false` at the start of
151
+ * each method and after an abort. Both synchronous and asynchronous methods can be aborted;
152
+ * synchronous methods require setting this property from another thread.
153
+ */
154
+ abortCurrent: boolean
155
+
156
+ /**
157
+ * This property indicates the block size in bytes for the chosen encryption algorithm. For
158
+ * instance, if the {@link Crypt2.cryptAlgorithm} is set to `AES`, the BlockSize is automatically
159
+ * set to 16 bytes. In contrast, the block size for the `ChaCha20` streaming algorithm is 1 byte.
160
+ *
161
+ * This property is read-only.
162
+ */
163
+ readonly blockSize: number
164
+
165
+ /**
166
+ * This property applies to all `PKCS7` signature creation methods. When set to `true`, it ensures
167
+ * the inclusion of required attributes (such as `content-type`, `message-digest`, and
168
+ * `signing-certificate-v2`) to qualify the signature as at least a `CAdES-BES` signature. By
169
+ * default, this property is set to `false`.
170
+ */
171
+ cadesEnabled: boolean
172
+
173
+ /**
174
+ * This property is for PKCS7 CMS signatures that wish to include CAdES `signature policy
175
+ * attributes`. Set it to the `base64`-encoded hash of the policy document at the {@link
176
+ * Crypt2.cadesSigPolicyUri} using either `SHA256` or `SHA1`.
177
+ */
178
+ cadesSigPolicyHash: string
179
+
180
+ /**
181
+ * This property is for PKCS7 CMS signatures that wish to include CAdES `signature policy
182
+ * attributes`.
183
+ * The `CAdES Signature Policy ID` is an object identifier (`OID`) included in a CAdES signature
184
+ * that specifies the exact signature policy the signer followed. It is the OID associated with
185
+ * the policy URL. An example OID would look like this: `2.16.840.1.101.3.2.1.48.1`
186
+ *
187
+ * An application that wishes to include signature policy attributes should set all three
188
+ * properties: {@link Crypt2.cadesSigPolicyHash}, {@link Crypt2.cadesSigPolicyUri}, and {@link
189
+ * Crypt2.cadesSigPolicyId}.
190
+ */
191
+ cadesSigPolicyId: string
192
+
193
+ /**
194
+ * This property is for PKCS7 CMS signatures that wish to include CAdES `signature policy
195
+ * attributes`. The `signature policy URI` in a `CAdES` digital signature is a link that points to
196
+ * a document describing the rules and conditions under which the signature was created.
197
+ * Typically the Signature Policy URI in a CAdES signature points to a `.der` file, not a PDF or
198
+ * human-readable document.
199
+ *
200
+ * For example: `http://example.com/policies/my-policy.der`
201
+ */
202
+ cadesSigPolicyUri: string
203
+
204
+ /**
205
+ * This property specifies the character encoding used to represent text as bytes for encryption
206
+ * and hashing. By default, it uses the computer's `ANSI` charset, such as `Windows-1252` for
207
+ * locales like the United States, United Kingdom, Western Europe, Australia, and New Zealand.
208
+ *
209
+ * Most applications are **advised to set this property** to `UTF-8`. Chilkat plans to change its
210
+ * default to UTF-8 in a future major version to align with current standards. The current default
211
+ * of ANSI stems from a time when UTF-8 was not widely adopted.
212
+ */
213
+ charset: string
214
+
215
+ /**
216
+ * Sets the `cipher mode` for **block encryption algorithms** (AES, Blowfish,TwoFish, DES, 3DES,
217
+ * RC2). Possible values are `CBC` (the default), `ECB`, `CTR`, `OFB`, `GCM`, and `CFB`. These
218
+ * acronyms have the following meanings:
219
+ *
220
+ * - `CBC`: Cipher Block Chaining,
221
+ *
222
+ * - `ECB`: Electronic CookBook
223
+ *
224
+ * - `CTR`: Counter Mode
225
+ *
226
+ * - `CFB`: Cipher Feedback
227
+ *
228
+ * - `OFB`: Output Feedback
229
+ *
230
+ * - `GCM`: Galois/Counter Mode
231
+ *
232
+ * - `XTS`: AES-XTS (starting in Chilkat v9.5.0.91, only works with AES encryption)
233
+ *
234
+ * The `GCM` (Galois/Counter Mode) is available with any cipher having a 16-byte block size, such
235
+ * as AES. The CFB, OFB, CTR, and GCM modes convert block ciphers into stream ciphers. In these
236
+ * modes of operation, the {@link Crypt2.paddingScheme} property is unused because no padding
237
+ * occurs.
238
+ *
239
+ * **Starting in v9.5.0.91** Chilkat supports `AES-XTS` mode. XTS mode additionally uses a tweak
240
+ * key and tweak value, which are set via the {@link Crypt2.xtsSetEncodedTweakKey}, {@link
241
+ * Crypt2.xtsSetEncodedTweakValue}, and {@link Crypt2.xtsSetDataUnitNumber}. (The latter two
242
+ * functions provide alternative means of setting the tweak value.) Chilkat fully supports AES-XTS
243
+ * mode with `ciphertext-stealing`, which means it will correctly encrypt/decrypt data with size
244
+ * not divisible by the block size (i.e. divisible by 16 bytes).
245
+ */
246
+ cipherMode: string
247
+
248
+ /**
249
+ * Selects the encryption algorithm for encrypting and decrypting. Possible values are:
250
+ *
251
+ * Algorithm
252
+ * Type
253
+ * Symmetric?
254
+ * Key Size(s)
255
+ * Block/Stream
256
+ * Mode of Operation
257
+ * Notes
258
+ *
259
+ * | `aes` |
260
+ * | Block cipher |
261
+ * | ✔ Yes |
262
+ * | 128, 192, 256 bits |
263
+ * | Block (128-bit) |
264
+ * | CBC, CTR, GCM, etc. |
265
+ * | Widely used, FIPS-approved |
266
+ *
267
+ * | `pki` (Public-Key Encryption) |
268
+ * | Asymmetric |
269
+ * | ✗ No |
270
+ * | 1024–4096+ bits |
271
+ * | N/A |
272
+ * | N/A |
273
+ * | Used for key exchange, not bulk data |
274
+ *
275
+ * | `chacha20` |
276
+ * | Stream cipher |
277
+ * | ✔ Yes |
278
+ * | 256 bits |
279
+ * | Stream |
280
+ * | N/A |
281
+ * | High speed, secure, designed for simplicity |
282
+ *
283
+ * | `des` |
284
+ * | Block cipher |
285
+ * | ✔ Yes |
286
+ * | 56 bits |
287
+ * | Block (64-bit) |
288
+ * | ECB, CBC, etc. |
289
+ * | Deprecated, insecure |
290
+ *
291
+ * | `3des` |
292
+ * | Block cipher |
293
+ * | ✔ Yes |
294
+ * | 112 or 168 bits |
295
+ * | Block (64-bit) |
296
+ * | ECB, CBC, etc. |
297
+ * | Legacy use, weak by modern standards |
298
+ *
299
+ * | `rc2` |
300
+ * | Block cipher |
301
+ * | ✔ Yes |
302
+ * | 40–128 bits (variable) |
303
+ * | Block (64-bit) |
304
+ * | ECB, CBC, etc. |
305
+ * | Obsolete, variable strength |
306
+ *
307
+ * | `blowfish2` (Blowfish) |
308
+ * | Block cipher |
309
+ * | ✔ Yes |
310
+ * | 32–448 bits (variable) |
311
+ * | Block (64-bit) |
312
+ * | ECB, CBC, etc. |
313
+ * | Fast, but 64-bit block size is a limitation |
314
+ *
315
+ * | `twofish` |
316
+ * | Block cipher |
317
+ * | ✔ Yes |
318
+ * | Up to 256 bits |
319
+ * | Block (128-bit) |
320
+ * | ECB, CBC, etc. |
321
+ * | AES finalist, secure and flexible |
322
+ *
323
+ * | `pbes1` |
324
+ * | Key derivation |
325
+ * | ✔ Yes |
326
+ * | Based on underlying cipher |
327
+ * | Block (varies) |
328
+ * | PKCS#5 v1.5 |
329
+ * | Obsolete, uses DES/RC2 |
330
+ *
331
+ * | `pbes2` |
332
+ * | Key derivation |
333
+ * | ✔ Yes |
334
+ * | Based on underlying cipher |
335
+ * | Block (varies) |
336
+ * | PKCS#5 v2.0 |
337
+ * | Modern, supports AES, SHA, etc. |
338
+ *
339
+ * | `arc4` (RC4) |
340
+ * | Stream cipher |
341
+ * | ✔ Yes |
342
+ * | 40–2048 bits (variable) |
343
+ * | Stream |
344
+ * | N/A |
345
+ * | Deprecated, insecure due to biases |
346
+ */
347
+ cryptAlgorithm: string
348
+
349
+ /**
350
+ * The EncodingMode property specifies the `binary encoding` format (e.g., `base64`, `hex`,
351
+ * `base58`, `base64url`)
352
+ * used by functions ending in `"ENC"`, like {@link Crypt2.encryptStringENC} and {@link
353
+ * Crypt2.decryptStringENC}.
354
+ * For encryption functions, EncodingMode determines the encoding of the output. For decryption
355
+ * functions, it specifies the encoding of the input data.
356
+ *
357
+ * A `list of supported binary encodings` is available at the link below.
358
+ *
359
+ * The default value is `base64`
360
+ */
361
+ encodingMode: string
362
+
363
+ /**
364
+ * Using the `FirstChunk` and {@link Crypt2.lastChunk} properties is the way to do streaming
365
+ * encryption or decryption with Chilkat.
366
+ *
367
+ * By default, both FirstChunk and LastChunk are set to `true`, indicating that the data passed to
368
+ * the encryption or decryption method is the full amount. To process data in multiple chunks,
369
+ * adjust these settings as follows:
370
+ *
371
+ * 1. For the first chunk, set FirstChunk = `true` and LastChunk = `false`.
372
+ *
373
+ * 2. For intermediate chunks, set both FirstChunk = `false` and LastChunk = `false`.
374
+ *
375
+ * 3. For the final chunk, set FirstChunk = `false` and LastChunk = `true`.
376
+ *
377
+ * You can feed data chunks of any size, regardless of the encryption algorithm's block size
378
+ * (e.g., 16 bytes for AES). Chilkat will handle buffering and, upon receiving the final chunk,
379
+ * pad the output to the appropriate block size according to the selected {@link
380
+ * Crypt2.paddingScheme}.
381
+ */
382
+ firstChunk: boolean
383
+
384
+ /**
385
+ * Selects the hash algorithm used by methods that create hashes. The valid choices are `sha256`,
386
+ * `sha384`, `sha512`, `sha3-224`, `sha3-256`, `sha3-384`, `sha3-512`, `sha1`, `md2`, `md5`,
387
+ * `haval`, `ripemd128`, `ripemd160`,`ripemd256`, or `ripemd320`.
388
+ *
389
+ * (Chilkat supports `SHA-2` because it includes the SHA-256, SHA-384, and SHA-512 hash
390
+ * functions.)
391
+ *
392
+ * **The default value is `sha256`.**
393
+ *
394
+ * Note: The HAVAL hash algorithm is affected by two other properties: {@link Crypt2.havalRounds}
395
+ * and {@link Crypt2.keyLength}.
396
+ *
397
+ * - The HavalRounds may have values of 3, 4, or 5.
398
+ *
399
+ * - For HAVAL hashing, the KeyLength can be 128, 160, 192, 224, or 256.
400
+ */
401
+ hashAlgorithm: string
402
+
403
+ /**
404
+ * Applies to the HAVAL hash algorithm only and must be set to the integer value 3, 4, or 5. The
405
+ * default value is 3.
406
+ */
407
+ havalRounds: number
408
+
409
+ /**
410
+ * The interval in milliseconds between each `AbortCheck` event callback, which enables an
411
+ * application to abort certain method calls before they complete. **By default, HeartbeatMs is
412
+ * set to **`0`**, meaning no AbortCheck event callbacks will trigger.**
413
+ *
414
+ * Methods with event callbacks include: {@link Crypt2.ckDecryptFile}, {@link
415
+ * Crypt2.ckEncryptFile}, `HashFile`, and {@link Crypt2.hashFileENC}.
416
+ */
417
+ heartbeatMs: number
418
+
419
+ /**
420
+ * This applies only to creating digital signatures. By default (`true`), any additional
421
+ * certificates in the authentication chain are included in the PKCS7 digital signature.
422
+ */
423
+ includeCertChain: boolean
424
+
425
+ /**
426
+ * The initial counter for the `ChaCha20` encryption algorithm, which has a default value of 0, is
427
+ * pre-agreed by both the encryptor and decryptor.
428
+ */
429
+ initialCount: number
430
+
431
+ /**
432
+ * The iteration count in password-based encryption (PBE) establishes the computational difficulty
433
+ * for encryption and decryption, thereby enhancing resistance to exhaustive search attacks. The
434
+ * default iteration count is `1024`, which is considered low, so it is recommended that
435
+ * applications increase this number when using `pbes2` encryption.
436
+ *
437
+ * **PBES2 Iteration Count Recommendation**s
438
+ *
439
+ * Aim for a **100–200 ms** derive time on your target hardware.
440
+ *
441
+ * -
442
+ * Server/Desktop:
443
+ * `100000 – 1000000+`
444
+ *
445
+ * -
446
+ * Mobile/Embedded:
447
+ * `50000 - 100000`
448
+ *
449
+ * Benchmark annually and increase iterations as hardware improves.
450
+ */
451
+ iterationCount: number
452
+
453
+ /**
454
+ * The key length `in bits` for symmetric encryption algorithms. The default value is `256`.
455
+ */
456
+ keyLength: number
457
+
458
+ /**
459
+ * See the documentation for the {@link Crypt2.firstChunk} property.
460
+ */
461
+ lastChunk: boolean
462
+
463
+ /**
464
+ * Selects the MAC algorithm to be used for any of the Mac methods, such as MacStringENC,
465
+ * MacBytes, etc. The default value is `hmac`. Possible values are `hmac` and `poly1305`.
466
+ */
467
+ macAlgorithm: string
468
+
469
+ /**
470
+ * This property is set upon verifying a digital signature and indicates the number of signer
471
+ * certificates. You can retrieve each signing certificate using the {@link Crypt2.lastSignerCert}
472
+ * method with an index ranging from `0` to `NumSignerCerts`-1.
473
+ *
474
+ * This property is read-only.
475
+ */
476
+ readonly numSignerCerts: number
477
+
478
+ /**
479
+ * This property defines the padding scheme Chilkat uses for adding padding to input data during
480
+ * encryption and removing it during decryption. It is applicable only to symmetric block ciphers,
481
+ * such as AES, Blowfish, and Twofish, which require input sizes matching their exact block size.
482
+ * Padding ensures the last block is completely filled.
483
+ *
484
+ * The possible values are:
485
+ *
486
+ * -
487
+ * **PKCS#5/PKCS#7 (RFC 1423)** `default`
488
+ *
489
+ * \*Each pad byte = number of padding bytes.\*
490
+ *
491
+ * Block size: 8
492
+ *
493
+ * Data: "HELLO" (5 bytes)
494
+ *
495
+ * Padding: 0x03 0x03 0x03
496
+ *
497
+ * -
498
+ * **FIPS 81**
499
+ *
500
+ * \*Last byte = count; others = random.\*
501
+ *
502
+ * Block size: 8
503
+ *
504
+ * Data: "HELLO"
505
+ *
506
+ * Padding: 0xA4 0x2F 0x9C 0x03
507
+ *
508
+ * -
509
+ * **Random**
510
+ *
511
+ * \*All pad bytes random; decryptor must know original length.\*
512
+ *
513
+ * Block size: 8
514
+ *
515
+ * Data: "HELLO"
516
+ *
517
+ * Padding: 0x7D 0x20 0xCB 0x81
518
+ *
519
+ * -
520
+ * **Null (0x00)**
521
+ *
522
+ * \*Pad with zeros; no padding if already exact.\*
523
+ *
524
+ * Block size: 8
525
+ *
526
+ * Data: "HEL" (3 bytes)
527
+ *
528
+ * Padding: 0x00 0x00 0x00 0x00 0x00
529
+ *
530
+ * -
531
+ * **Space (0x20)**
532
+ *
533
+ * \*Pad with spaces; no padding if already exact.\*
534
+ *
535
+ * Block size: 8
536
+ *
537
+ * Data: "HEL" (3 bytes)
538
+ *
539
+ * Padding: 0x20 0x20 0x20 0x20 0x20
540
+ */
541
+ paddingScheme: number
542
+
543
+ /**
544
+ * If the {@link Crypt2.cryptAlgorithm} property is set to `pbes1` or `pbes2`, this property
545
+ * defines the symmetric encryption algorithm to be used for password-based encryption (PBE). The
546
+ * default is `"des"`. Applications should set this property equal to `"aes"`.
547
+ */
548
+ pbesAlgorithm: string
549
+
550
+ /**
551
+ * The password to be used when the {@link Crypt2.cryptAlgorithm} is `"pbes1"` or `"pbes2"`.
552
+ */
553
+ pbesPassword: string
554
+
555
+ /**
556
+ * This property determines the underlying symmetric encryption algorithm when the {@link
557
+ * Crypt2.cryptAlgorithm} property is set to `pki` for selecting PKCS7 public-key encryption.
558
+ *
559
+ * The default is `aes`.
560
+ */
561
+ pkcs7CryptAlg: string
562
+
563
+ /**
564
+ * The effective key length (in bits) for the `RC2` encryption algorithm. When using RC2, set both
565
+ * the {@link Crypt2.keyLength} and Rc2EffectiveKeyLength properties to values between 8 and 1024,
566
+ * inclusive. The default setting for both is 128.
567
+ *
568
+ * The default value is `128`
569
+ *
570
+ * RC2 is an old symmetric encryption algorithm, now considered insecure due to its small key size
571
+ * and vulnerability to cryptanalysis. Modern algorithms like AES are recommended instead.
572
+ */
573
+ rc2EffectiveKeyLength: number
574
+
575
+ /**
576
+ * When UU encoding, this is the filename to be embedded in UU encoded output. The default is
577
+ * `file.dat`. When UU decoding, this is the filename found in the UU encoded input.
578
+ */
579
+ uuFilename: string
580
+
581
+ /**
582
+ * When UU encoding, this is the file permissions mode to be embedded in UU encoded output. The
583
+ * default is `644`. When UU decoding, this property is set to the mode found in the UU encoded
584
+ * input.
585
+ */
586
+ uuMode: string
587
+
588
+ /**
589
+ * The BCrypt work factor determines the computational cost of {@link Crypt2.bCryptHash} and
590
+ * {@link Crypt2.bCryptVerify}. It represents the base-2 logarithm of the number of hashing
591
+ * rounds. For instance, a work factor of 12 corresponds to 2^12 hashing rounds. This cost factor
592
+ * is designed to make computations challenging enough to deter brute-force attacks.
593
+ *
594
+ * The work factor must be set between 4 and 31, inclusive, with a `default value of 10`.
595
+ */
596
+ bCryptWorkFactor: number
597
+
598
+ /**
599
+ * This property applies when creating RSA signatures.
600
+ *
601
+ * It defines the `RSA signature scheme`. The default is `PKCS1-v1_5`. You can change it to
602
+ * `RSASSA-PSS` (or `pss`) to use the RSASSA-PSS signature scheme.
603
+ *
604
+ * -
605
+ * **PKCS#1 v1.5**
606
+ *
607
+ * \*Older, deterministic scheme.\*
608
+ *
609
+ * - Simple padding.
610
+ *
611
+ * - Vulnerable to certain attacks if not used carefully.
612
+ *
613
+ * - Still widely used for compatibility.
614
+ *
615
+ * -
616
+ * **RSASSA-PSS**
617
+ *
618
+ * \*Newer, probabilistic scheme (recommended by modern standards).\*
619
+ *
620
+ * - Adds random salt for each signature.
621
+ *
622
+ * - More secure against chosen-plaintext and padding oracle attacks.
623
+ *
624
+ * - Recommended by modern standards like PKCS#1 v2.1 and FIPS.
625
+ */
626
+ signingAlg: string
627
+
628
+ /**
629
+ * Selects the hash algorithm for use within OAEP padding when encrypting using `pki` with
630
+ * RSAES-OAEP. The valid choices are `sha1`, `sha256`, `sha384`, `sha512`,
631
+ *
632
+ * The default value is `sha256`
633
+ */
634
+ oaepHash: string
635
+
636
+ /**
637
+ * Selects the RSA encryption scheme when encrypting using `pki` (with a certificate and private
638
+ * key). The default value is `false`, which selects RSAES_PKCS1-V1_5. If set to `true`, then
639
+ * RSAES_OAEP is used.
640
+ */
641
+ oaepPadding: boolean
642
+
643
+ /**
644
+ * Selects the MGF hash algorithm for use within OAEP padding when encrypting using `pki` with
645
+ * RSAES-OAEP. The valid choices are `sha1`, `sha256`, `sha384`, `sha512`, The default is
646
+ * `sha256`.
647
+ */
648
+ oaepMgfHash: string
649
+
650
+ /**
651
+ * Contains JSON to specify the authenticated (signed) attributes or unauthenticated (unsigned)
652
+ * attributes that are to be included in CMS signatures. The default value is:
653
+ *
654
+ * ```
655
+ * {
656
+ * "contentType": true,
657
+ * "signingTime": true,
658
+ * "messageDigest": true
659
+ * }
660
+ * ```
661
+ */
662
+ signingAttributes: string
663
+
664
+ /**
665
+ * A JSON string to manage additional CMS (PKCS7) signature and validation options. Possible
666
+ * options are:
667
+ *
668
+ * - boolean `OmitAlgorithmIdNull`: Set this JSON member to `true` to omit the explicit NULL
669
+ * within an AlgorithmIdentifier ASN.1 within the PKCS7. This should almost never be used, but
670
+ * helps for rare cases where a validator dislikes the explicit NULL being present.
671
+ *
672
+ * - boolean `ValidateTimestampTokens`: Tells Chilkat to also validate the timestamp tokens when
673
+ * validating a signature that includes a timestamp.
674
+ *
675
+ * - boolean `ConstructedOctets`: When set to `true`, tells Chilkat to use the `ASN.1 constructed
676
+ * octets` format for the data contained in the CMS (PKCS7) signed-data.
677
+ *
678
+ * - boolean `CanonicalizeITIDA`: This applies to `Egypt ITIDA`, which requires signed documents
679
+ * in a CAdES-BES CMS format, using ITIDA’s JSON canonicalization (for JSON payloads), with only
680
+ * the Base64‑encoded signature attached - not the original data itself. When set to `true`,
681
+ * Chilkat will `automatically do the special ITIDA JSON canonicalization`.
682
+ */
683
+ cmsOptions: string
684
+
685
+ /**
686
+ * This is a catch-all property to be used for uncommon needs. This property defaults to the empty
687
+ * string and should typically remain empty.
688
+ *
689
+ * Can be set to a list of the following comma separated keywords:
690
+ *
691
+ * - `UseConstructedOctets` - Introduced in v9.5.0.83. When creating opaque CMS signatures
692
+ * (signatures that embed the data being signed), will use the `constructed octets` form of the
693
+ * ASN.1 that holds the data. This is to satify some validators that are brittle/fragile/picky
694
+ * and require a particular format, such as for the ICP-Brazil Digital Signature Standard.
695
+ */
696
+ uncommonOptions: string
697
+
698
+ // ---- Methods ----
699
+
700
+ /**
701
+ * Adds a certificate for public-key encryption. To enable public-key encryption with digital
702
+ * certificates, set the {@link Crypt2.cryptAlgorithm} property to `pki`. Call {@link
703
+ * Crypt2.addEncryptCert} separately for each certificate you wish to use for encryption.
704
+ *
705
+ * Any of the `Encrypt*` methods will do `RSA public-key encryption` when the `CryptAlgorithm` is
706
+ * set to the keyword `pki`. The output is a `PKCS#7 enveloped-data` secure container.
707
+ */
708
+ addEncryptCert(cert: Cert): void
709
+
710
+ /**
711
+ * Adds a `PFX` file to the object's list of sources for locating certificates and private keys
712
+ * during public-key decryption or signing. To add multiple PFX sources, call this method multiple
713
+ * times.
714
+ *
715
+ * **Note:** Information about the certificate(s) needed for `public-key decryption` are included
716
+ * in the `PKCS#7 enveloped-data`. Chilkat will automatically find a usable certificate and
717
+ * private key from sources like Windows certificate stores, the Apple keychain, or other sources
718
+ * provided by the application.
719
+ *
720
+ * @throws Error if the call fails (the message names the reason); the full log is in
721
+ * {@link Crypt2.lastErrorText}.
722
+ */
723
+ addPfxSourceFile(pfxFilePath: string, pfxPassword: string): void
724
+
725
+ /**
726
+ * File-to-file decryption that supports files of any size by using internal streaming mode.
727
+ *
728
+ * This call blocks the JavaScript thread until Chilkat returns; from UI code prefer
729
+ * {@link Crypt2.ckDecryptFileAsync}.
730
+ *
731
+ * @throws Error if the call fails (the message names the reason); the full log is in
732
+ * {@link Crypt2.lastErrorText}.
733
+ */
734
+ ckDecryptFile(srcFile: string, destFile: string): void
735
+
736
+ /**
737
+ * Asynchronous form of {@link Crypt2.ckDecryptFile}: the same call on a native worker thread,
738
+ * settling on the JavaScript thread. While it is pending, other calls on this object throw,
739
+ * except {@link Crypt2.abort} (which cancels it) and the {@link Crypt2.onPercentDone} /
740
+ * {@link Crypt2.onProgressInfo} callbacks, which report progress while it runs.
741
+ *
742
+ * The promise rejects with an Error if the call fails; the full log is in
743
+ * {@link Crypt2.lastErrorText}.
744
+ */
745
+ ckDecryptFileAsync(srcFile: string, destFile: string): Promise<void>
746
+
747
+ /**
748
+ * Encrypts a file to another file using streaming mode, allowing files of virtually any size to
749
+ * be processed without loading the entire file into memory. The exception is when the
750
+ * `CryptAlgorithm` property is set to `"pki"`, in which case the entire input file must reside in
751
+ * memory because public-key encryption is performed in-memory rather than as a streaming
752
+ * operation.
753
+ *
754
+ * This call blocks the JavaScript thread until Chilkat returns; from UI code prefer
755
+ * {@link Crypt2.ckEncryptFileAsync}.
756
+ *
757
+ * @throws Error if the call fails (the message names the reason); the full log is in
758
+ * {@link Crypt2.lastErrorText}.
759
+ */
760
+ ckEncryptFile(srcFile: string, destFile: string): void
761
+
762
+ /**
763
+ * Asynchronous form of {@link Crypt2.ckEncryptFile}: the same call on a native worker thread,
764
+ * settling on the JavaScript thread. While it is pending, other calls on this object throw,
765
+ * except {@link Crypt2.abort} (which cancels it) and the {@link Crypt2.onPercentDone} /
766
+ * {@link Crypt2.onProgressInfo} callbacks, which report progress while it runs.
767
+ *
768
+ * The promise rejects with an Error if the call fails; the full log is in
769
+ * {@link Crypt2.lastErrorText}.
770
+ */
771
+ ckEncryptFileAsync(srcFile: string, destFile: string): Promise<void>
772
+
773
+ /**
774
+ * Clears the internal list of digital certificates to be used for public-key encryption.
775
+ */
776
+ clearEncryptCerts(): void
777
+
778
+ /**
779
+ * Calculates the CRC for a file's contents using the CRC algorithm specified by `crcAlg`.
780
+ * Possible algorithms are:
781
+ *
782
+ * - `crc-32` - This is the CRC used in the Zip file format.
783
+ *
784
+ * - `crc8`
785
+ *
786
+ * This call blocks the JavaScript thread until Chilkat returns; from UI code prefer
787
+ * {@link Crypt2.crcFileAsync}.
788
+ */
789
+ crcFile(crcAlg: string, path: string): number
790
+
791
+ /**
792
+ * Asynchronous form of {@link Crypt2.crcFile}: the same call on a native worker thread,
793
+ * settling on the JavaScript thread. While it is pending, other calls on this object throw,
794
+ * except {@link Crypt2.abort} (which cancels it) and the {@link Crypt2.onPercentDone} /
795
+ * {@link Crypt2.onProgressInfo} callbacks, which report progress while it runs.
796
+ */
797
+ crcFileAsync(crcAlg: string, path: string): Promise<number>
798
+
799
+ /**
800
+ * Signs the contents of `inFilename` and writes the enveloping (i.e. opaque) `PKCS7` signature
801
+ * (`.p7m`) to `p7mPath`.
802
+ *
803
+ * In a **PKCS#7/CMS signature**, the signer computes a **cryptographic hash** (e.g. SHA-256) of
804
+ * the data, then uses their **private key** to sign that hash.
805
+ *
806
+ * The signature = `Sign( Hash(data) )`
807
+ *
808
+ * This signed hash is what gets stored in the signature file. For enveloping/opaque signatures,
809
+ * the signed data is also stored in the signature file.
810
+ *
811
+ * Set the `HashAlgorithm` property to specify the hash algorithmg. The valid options are
812
+ * `sha256`, `sha1`, `sha384`, and `sha512`.
813
+ *
814
+ * This call blocks the JavaScript thread until Chilkat returns; from UI code prefer
815
+ * {@link Crypt2.createP7MAsync}.
816
+ *
817
+ * @throws Error if the call fails (the message names the reason); the full log is in
818
+ * {@link Crypt2.lastErrorText}.
819
+ */
820
+ createP7M(inFilename: string, p7mPath: string): void
821
+
822
+ /**
823
+ * Asynchronous form of {@link Crypt2.createP7M}: the same call on a native worker thread,
824
+ * settling on the JavaScript thread. While it is pending, other calls on this object throw,
825
+ * except {@link Crypt2.abort} (which cancels it) and the {@link Crypt2.onPercentDone} /
826
+ * {@link Crypt2.onProgressInfo} callbacks, which report progress while it runs.
827
+ *
828
+ * The promise rejects with an Error if the call fails; the full log is in
829
+ * {@link Crypt2.lastErrorText}.
830
+ */
831
+ createP7MAsync(inFilename: string, p7mPath: string): Promise<void>
832
+
833
+ /**
834
+ * Signs the contents of `inFilename` and writes the detached `PKCS7` signature (`.p7s`) to
835
+ * `p7sPath`.
836
+ *
837
+ * In a **PKCS#7/CMS detached signature**, the signer computes a **cryptographic hash** (e.g.
838
+ * SHA-256) of the data, then uses their **private key** to sign that hash.
839
+ *
840
+ * The signature = `Sign( Hash(data) )`
841
+ *
842
+ * This signed hash is what gets stored in the signature file.
843
+ *
844
+ * Set the `HashAlgorithm` property to specify the hash algorithmg. The valid options are
845
+ * `sha256`, `sha1`, `sha384`, and `sha512`.
846
+ *
847
+ * This call blocks the JavaScript thread until Chilkat returns; from UI code prefer
848
+ * {@link Crypt2.createP7SAsync}.
849
+ *
850
+ * @throws Error if the call fails (the message names the reason); the full log is in
851
+ * {@link Crypt2.lastErrorText}.
852
+ */
853
+ createP7S(inFilename: string, p7sPath: string): void
854
+
855
+ /**
856
+ * Asynchronous form of {@link Crypt2.createP7S}: the same call on a native worker thread,
857
+ * settling on the JavaScript thread. While it is pending, other calls on this object throw,
858
+ * except {@link Crypt2.abort} (which cancels it) and the {@link Crypt2.onPercentDone} /
859
+ * {@link Crypt2.onProgressInfo} callbacks, which report progress while it runs.
860
+ *
861
+ * The promise rejects with an Error if the call fails; the full log is in
862
+ * {@link Crypt2.lastErrorText}.
863
+ */
864
+ createP7SAsync(inFilename: string, p7sPath: string): Promise<void>
865
+
866
+ /**
867
+ * Decodes from an encoding back to the original string. The `encoding` can be set to any of the
868
+ * following strings: `base64`, `hex`, `quoted-printable`, `url`, `base32`, `Q`, `B`,
869
+ * `url_rc1738`, `url_rfc2396`, `url_rfc3986`, `url_oauth`, `uu`, `modBase64`, or `html` (for HTML
870
+ * entity encoding).
871
+ *
872
+ * @throws Error if the call fails (the message names the reason); the full log is in
873
+ * {@link Crypt2.lastErrorText}.
874
+ */
875
+ decodeString(inStr: string, charset: string, encoding: string): string
876
+
877
+ /**
878
+ * Decrypts encoded encrypted data, and returns the decrypted data as a binary encoded string. For
879
+ * example:
880
+ *
881
+ * **Input** → **Decode** `EncodingMode` → **Decrypt** → **Encode** `EncodingMode` → **Output**
882
+ *
883
+ * The encoding (e.g. `base64`, `hex`, etc.) is determined by the {@link Crypt2.encodingMode}
884
+ * property.
885
+ *
886
+ * This method supports `symmetric key` and `public key` decryption. For more information on
887
+ * **properties that affect decryption**, such as {@link Crypt2.cryptAlgorithm}, {@link
888
+ * Crypt2.cipherMode}, etc., refer to the {@link Crypt2.decryptBd} method documentation.
889
+ *
890
+ * @throws Error if the call fails (the message names the reason); the full log is in
891
+ * {@link Crypt2.lastErrorText}.
892
+ */
893
+ decryptEncoded(encodedEncryptedData: string): string
894
+
895
+ /**
896
+ * This function is intended for use when the **expected decrypted output is text**. It decrypts
897
+ * binary encoded encrypted bytes passed in `str` and appends the resulting string to ARG2. Ensure
898
+ * that the {@link Crypt2.charset} property, such as `utf-8,` matches the one used during
899
+ * encryption to interpret the decrypted bytes correctly as characters.
900
+ *
901
+ * **Input** → **Decode using** `EncodingMode` → **Decrypt** → **Interpret Bytes according to**
902
+ * `Charset` → **Output**
903
+ *
904
+ * The encoding (e.g. `base64`, `hex`, etc.) is determined by the {@link Crypt2.encodingMode}
905
+ * property.
906
+ *
907
+ * This method supports `symmetric key` and `public key` decryption. For more information on
908
+ * **properties that affect decryption**, such as {@link Crypt2.cryptAlgorithm}, {@link
909
+ * Crypt2.cipherMode}, etc., refer to the {@link Crypt2.decryptBd} method documentation.
910
+ *
911
+ * @throws Error if the call fails (the message names the reason); the full log is in
912
+ * {@link Crypt2.lastErrorText}.
913
+ */
914
+ decryptStringENC(str: string): string
915
+
916
+ /**
917
+ * Encode binary data to base64, hex, quoted-printable, or URL-encoding. The ARG3 can be set to
918
+ * any of the following strings: `base64`, `hex`, `quoted-printable`, `url`, `base32`, `Q`, `B`,
919
+ * `url_rc1738`, `url_rfc2396`, `url_rfc3986`, `url_oauth`, `uu`, `modBase64`, or `html` (for HTML
920
+ * entity encoding).
921
+ *
922
+ * The `byteData` points to the bytes to be encoded. The `encoding` specifies the number of bytes
923
+ * to encode.
924
+ *
925
+ * @throws Error if the call fails (the message names the reason); the full log is in
926
+ * {@link Crypt2.lastErrorText}.
927
+ */
928
+ encodeBytes(byteData: ArrayBuffer, encoding: string): string
929
+
930
+ /**
931
+ * Binary encodes a string. The `toEncodingName` can be set to **any of the binary encodings
932
+ * supported by Chilkat**, such as `base64`, `hex`, etc. (see the link below for the full list of
933
+ * encodings). The `charsetName`, such as `"utf-8"`, determines the bytes that are encoded.
934
+ *
935
+ * The `toEncodingName` can also be set to the value `html` for HTML entity encoding.
936
+ *
937
+ * @throws Error if the call fails (the message names the reason); the full log is in
938
+ * {@link Crypt2.lastErrorText}.
939
+ */
940
+ encodeString(strToEncode: string, charsetName: string, toEncodingName: string): string
941
+
942
+ /**
943
+ * Encrypts binary-encoded data and returns it as a binary-encoded string. For example:
944
+ *
945
+ * **Input** → **Decode** `EncodingMode` → **Encrypt** → **Encode** `EncodingMode` → **Output**
946
+ *
947
+ * The encoding (e.g. `base64`, `hex`, etc.) is determined by the {@link Crypt2.encodingMode}
948
+ * property.
949
+ *
950
+ * This method supports `symmetric key` and `public key` decryption. For more information on
951
+ * **properties that affect decryption**, such as {@link Crypt2.cryptAlgorithm}, {@link
952
+ * Crypt2.cipherMode}, etc., refer to the method documentation.
953
+ *
954
+ * @throws Error if the call fails (the message names the reason); the full log is in
955
+ * {@link Crypt2.lastErrorText}.
956
+ */
957
+ encryptEncoded(str: string): string
958
+
959
+ /**
960
+ * Encrypts the `str` and returns the encrypted bytes as a binary encoded string. The {@link
961
+ * Crypt2.charset} property determines the actual bytes that are encrypted.
962
+ *
963
+ * **Input** → **Get bytes according to** `Charset` → **Encrypt** → **Encode using**
964
+ * `EncodingMode` → **Output**
965
+ *
966
+ * The encoding (e.g. `base64`, `hex`, etc.) is determined by the {@link Crypt2.encodingMode}
967
+ * property.
968
+ *
969
+ * This method supports `symmetric key` and `public key` encryption. For more information on
970
+ * **properties that affect encryption**, such as {@link Crypt2.cryptAlgorithm}, {@link
971
+ * Crypt2.cipherMode}, etc., refer to the {@link Crypt2.encryptBd} method documentation.
972
+ *
973
+ * @throws Error if the call fails (the message names the reason); the full log is in
974
+ * {@link Crypt2.lastErrorText}.
975
+ */
976
+ encryptStringENC(str: string): string
977
+
978
+ /**
979
+ * Generates `numBytes` random bytes and returns them as an encoded string. The encoding format
980
+ * (e.g., base64, hex) is determined by the {@link Crypt2.encodingMode} property. It utilizes the
981
+ * `Fortuna` cryptographically secure random number generator, auto-seeded by an OS-dependent
982
+ * secure entropy source.
983
+ *
984
+ * @throws Error if the call fails (the message names the reason); the full log is in
985
+ * {@link Crypt2.lastErrorText}.
986
+ */
987
+ genRandomBytesENC(numBytes: number): string
988
+
989
+ /**
990
+ * Generates a random UUID string having standard UUID format, such as
991
+ * `de305d54-75b4-431b-adb2-eb6b9e546014`.
992
+ *
993
+ * Note: This generates a `version 4 UUID` using random byte values. See RFC 4122.
994
+ *
995
+ * @throws Error if the call fails (the message names the reason); the full log is in
996
+ * {@link Crypt2.lastErrorText}.
997
+ */
998
+ generateUuid(): string
999
+
1000
+ /**
1001
+ * When encrypting in `GCM` mode, Chilkat generates the `GCM authentication tag`. The application
1002
+ * can then use this method to retrieve the tag, which should be sent to the decrypting party
1003
+ * along with the encrypted data. For further details on GCM authenticated encryption, please
1004
+ * refer to the web pages linked below.
1005
+ *
1006
+ * @throws Error if the call fails (the message names the reason); the full log is in
1007
+ * {@link Crypt2.lastErrorText}.
1008
+ */
1009
+ getEncodedAuthTag(encoding: string): string
1010
+
1011
+ /**
1012
+ * This method retrieves the IV set by the application during the last call to {@link
1013
+ * Crypt2.setEncodedIV} or {@link Crypt2.randomizeIV}.
1014
+ *
1015
+ * @throws Error if the call fails (the message names the reason); the full log is in
1016
+ * {@link Crypt2.lastErrorText}.
1017
+ */
1018
+ getEncodedIV(encoding: string): string
1019
+
1020
+ /**
1021
+ * This method retrieves the signing time of the Nth certificate in a digital signature after
1022
+ * verification. The signing time for the first certificate is at index 0. The {@link
1023
+ * Crypt2.numSignerCerts} property indicates the total number of signing certificates, although
1024
+ * typically only one is used.
1025
+ *
1026
+ * Note: Before accessing the signing time, use the {@link Crypt2.hasSignatureSigningTime} method
1027
+ * to verify its availability, and skip indices lacking a signing time. The signing time is
1028
+ * returned in `RFC822 string format`.
1029
+ *
1030
+ * @throws Error if the call fails (the message names the reason); the full log is in
1031
+ * {@link Crypt2.lastErrorText}.
1032
+ */
1033
+ getSignatureSigningTimeStr(index: number): string
1034
+
1035
+ /**
1036
+ * After verifying a digital signature with a signature verification method, you can call this
1037
+ * method. It returns `true` if the signing time for the Nth certificate is available and can be
1038
+ * accessed using the {@link Crypt2.getSignatureSigningTimeStr} method.
1039
+ */
1040
+ hasSignatureSigningTime(index: number): boolean
1041
+
1042
+ /**
1043
+ * To hash a large amount of text, start by processing the first chunk using this method. For
1044
+ * subsequent chunks, use the {@link Crypt2.hashMoreString} method as needed. Conclude by calling
1045
+ * {@link Crypt2.hashFinalENC} to obtain the final result. The hash algorithm is determined by the
1046
+ * {@link Crypt2.hashAlgorithm} property setting.
1047
+ *
1048
+ * @throws Error if the call fails (the message names the reason); the full log is in
1049
+ * {@link Crypt2.lastErrorText}.
1050
+ */
1051
+ hashBeginString(strData: string): void
1052
+
1053
+ /**
1054
+ * Hashes a file and returns the hash as an encoded string.
1055
+ *
1056
+ * The hash algorithm is specified by the `HashAlgorithm` property, The encoding is controlled by
1057
+ * the `EncodingMode` property, which can be set to `base64`, `hex`, `base64url`, or any of the
1058
+ * encodings listed at the link below.
1059
+ *
1060
+ * Any size file is supported because the file is hashed internally in streaming mode (keeping
1061
+ * memory usage low and constant).
1062
+ *
1063
+ * This call blocks the JavaScript thread until Chilkat returns; from UI code prefer
1064
+ * {@link Crypt2.hashFileENCAsync}.
1065
+ *
1066
+ * @throws Error if the call fails (the message names the reason); the full log is in
1067
+ * {@link Crypt2.lastErrorText}.
1068
+ */
1069
+ hashFileENC(path: string): string
1070
+
1071
+ /**
1072
+ * Asynchronous form of {@link Crypt2.hashFileENC}: the same call on a native worker thread,
1073
+ * settling on the JavaScript thread. While it is pending, other calls on this object throw,
1074
+ * except {@link Crypt2.abort} (which cancels it) and the {@link Crypt2.onPercentDone} /
1075
+ * {@link Crypt2.onProgressInfo} callbacks, which report progress while it runs.
1076
+ *
1077
+ * The promise rejects with an Error if the call fails; the full log is in
1078
+ * {@link Crypt2.lastErrorText}.
1079
+ */
1080
+ hashFileENCAsync(path: string): Promise<string>
1081
+
1082
+ /**
1083
+ * Finalizes a multi-step hash computation and returns the hash bytes encoded according to the
1084
+ * {@link Crypt2.encodingMode} property setting.
1085
+ *
1086
+ * @throws Error if the call fails (the message names the reason); the full log is in
1087
+ * {@link Crypt2.lastErrorText}.
1088
+ */
1089
+ hashFinalENC(): string
1090
+
1091
+ /**
1092
+ * Adds more text to the hash currently under computation. (See {@link Crypt2.hashBeginString})
1093
+ *
1094
+ * @throws Error if the call fails (the message names the reason); the full log is in
1095
+ * {@link Crypt2.lastErrorText}.
1096
+ */
1097
+ hashMoreString(strData: string): void
1098
+
1099
+ /**
1100
+ * Hashes the `str` and returns the hash as a binary encoded string. The {@link Crypt2.charset}
1101
+ * property determines the actual bytes that are hashed.
1102
+ *
1103
+ * **Input** → **Get bytes according to** `Charset` → **Hash** → **Encode using** `EncodingMode` →
1104
+ * **Output**
1105
+ *
1106
+ * The encoding (e.g. `base64`, `hex`, etc.) is determined by the {@link Crypt2.encodingMode}
1107
+ * property.
1108
+ *
1109
+ * The hash algorithm is determined by the {@link Crypt2.hashAlgorithm} property.
1110
+ *
1111
+ * @throws Error if the call fails (the message names the reason); the full log is in
1112
+ * {@link Crypt2.lastErrorText}.
1113
+ */
1114
+ hashStringENC(str: string): string
1115
+
1116
+ /**
1117
+ * Computes a Message Authentication Code (MAC) and returns it as a binary encoded string. The MAC
1118
+ * algorithm is defined by the {@link Crypt2.macAlgorithm} property. The {@link Crypt2.charset}
1119
+ * property determines the actual bytes that are hashed.
1120
+ *
1121
+ * **Input** → **Get bytes according to** `Charset` → **MAC** → **Encode using** `EncodingMode` →
1122
+ * **Output**
1123
+ *
1124
+ * The encoding (e.g. `base64`, `hex`, etc.) is determined by the {@link Crypt2.encodingMode}
1125
+ * property.
1126
+ *
1127
+ * The hash algorithm is determined by the {@link Crypt2.hashAlgorithm} property. The secret key
1128
+ * must be set beforehand by calling {@link Crypt2.setMacKeyEncoded}.
1129
+ *
1130
+ * @throws Error if the call fails (the message names the reason); the full log is in
1131
+ * {@link Crypt2.lastErrorText}.
1132
+ */
1133
+ macStringENC(inText: string): string
1134
+
1135
+ /**
1136
+ * Matches `MySQL`'s `AES_DECRYPT` function. `strEncryptedHex` is a hex-encoded AES-encrypted
1137
+ * string, and the return value is the original unencrypted string.
1138
+ *
1139
+ * @throws Error if the call fails (the message names the reason); the full log is in
1140
+ * {@link Crypt2.lastErrorText}.
1141
+ */
1142
+ mySqlAesDecrypt(strEncryptedHex: string, strPassword: string): string
1143
+
1144
+ /**
1145
+ * This function replicates `MySQL`'s `AES_ENCRYPT`, returning the encrypted data as a hex-encoded
1146
+ * string. In MySQL, this is done using: `HEX(AES_ENCRYPT('The quick brown fox jumps over the lazy
1147
+ * dog', 'password'))`.
1148
+ *
1149
+ * @throws Error if the call fails (the message names the reason); the full log is in
1150
+ * {@link Crypt2.lastErrorText}.
1151
+ */
1152
+ mySqlAesEncrypt(strData: string, strPassword: string): string
1153
+
1154
+ /**
1155
+ * Digitally signs a string and returns `PKCS#7 signed-data` as a `binary encoded string`. The
1156
+ * {@link Crypt2.encodingMode} property determines the binary encoding, such as `base64`, `hex`,
1157
+ * `hex_lower`, `base64_mime`, etc. The {@link Crypt2.charset} property determines the actual
1158
+ * bytes that are hashed and signed. The {@link Crypt2.hashAlgorithm} property specifies the hash
1159
+ * algorithm for creating the data's hash during signing.
1160
+ *
1161
+ * This call blocks the JavaScript thread until Chilkat returns; from UI code prefer
1162
+ * {@link Crypt2.opaqueSignStringENCAsync}.
1163
+ *
1164
+ * @throws Error if the call fails (the message names the reason); the full log is in
1165
+ * {@link Crypt2.lastErrorText}.
1166
+ */
1167
+ opaqueSignStringENC(str: string): string
1168
+
1169
+ /**
1170
+ * Asynchronous form of {@link Crypt2.opaqueSignStringENC}: the same call on a native worker
1171
+ * thread,
1172
+ * settling on the JavaScript thread. While it is pending, other calls on this object throw,
1173
+ * except {@link Crypt2.abort} (which cancels it) and the {@link Crypt2.onPercentDone} /
1174
+ * {@link Crypt2.onProgressInfo} callbacks, which report progress while it runs.
1175
+ *
1176
+ * The promise rejects with an Error if the call fails; the full log is in
1177
+ * {@link Crypt2.lastErrorText}.
1178
+ */
1179
+ opaqueSignStringENCAsync(str: string): Promise<string>
1180
+
1181
+ /**
1182
+ * This function verifies a `PKCS#7 signed-data` binary-encoded signature and returns the original
1183
+ * text data. The {@link Crypt2.encodingMode} property determines how `p7m` is decoded to bytes.
1184
+ * If the signature does not verify successfully, it returns an empty string. The {@link
1185
+ * Crypt2.charset} property specifies how the original data bytes are converted to characters. You
1186
+ * can obtain signer certificates using the {@link Crypt2.numSignerCerts} property and the {@link
1187
+ * Crypt2.lastSignerCert} method.
1188
+ *
1189
+ * @throws Error if the call fails (the message names the reason); the full log is in
1190
+ * {@link Crypt2.lastErrorText}.
1191
+ */
1192
+ opaqueVerifyStringENC(p7m: string): string
1193
+
1194
+ /**
1195
+ * This function implements the `PBKDF1` (Password-Based Key Derivation Function #1) algorithm.
1196
+ * Follow these guidelines to use it:
1197
+ *
1198
+ * -
1199
+ * **`password`** (the password) is first converted using the character encoding specified by
1200
+ * **`charset`** before being processed by the key derivation function.
1201
+ *
1202
+ * -
1203
+ * **`hashAlg`** specifies the hash function to use, such as `md5`, `sha1`, or `md2`.
1204
+ *
1205
+ * -
1206
+ * **`salt`** represents the salt, which should be random data of at least 8 bytes (64 bits). You
1207
+ * can use the {@link Crypt2.genRandomBytesENC} method to generate this.
1208
+ *
1209
+ * -
1210
+ * **`iterationCount`** sets the iteration count, which must be a minimum of 1000.
1211
+ *
1212
+ * -
1213
+ * **`outputKeyBitLen`** determines the length (in bits) of the derived key.
1214
+ *
1215
+ * -
1216
+ * **`encoding`** defines the output encoding format, such as `base64` or `hex`, and also the
1217
+ * expected encoding of **`salt`** (the salt).
1218
+ *
1219
+ * The function returns the derived key.
1220
+ *
1221
+ * Note: If `charset` is specified as hex or base64, the password (`password`) will be treated as
1222
+ * binary data encoded in that format. It will be decoded into binary form and used directly as
1223
+ * such.
1224
+ *
1225
+ * @throws Error if the call fails (the message names the reason); the full log is in
1226
+ * {@link Crypt2.lastErrorText}.
1227
+ */
1228
+ pbkdf1(password: string, charset: string, hashAlg: string, salt: string, iterationCount: number, outputKeyBitLen: number, encoding: string): string
1229
+
1230
+ /**
1231
+ * Implements the `PBKDF2` algorithm as follows:
1232
+ *
1233
+ * - Convert `password` to the character encoding specified by `charset` before using it in the
1234
+ * key derivation function.
1235
+ *
1236
+ * - `hashAlg` specifies the hash algorithm. Options include `sha256`, `sha384`, `sha512`, `md5`,
1237
+ * `sha1`, `md2`, or any algorithm listed in the HashAlgorithm property.
1238
+ *
1239
+ * - Provide a random `salt` value that is at least 8 bytes (64 bits) long. Use methods like
1240
+ * {@link Crypt2.genRandomBytesENC} to generate this salt value.
1241
+ *
1242
+ * - Ensure `iterationCount` is 1000 or greater.
1243
+ *
1244
+ * - Control the length of the derived key output using `outputKeyBitLen`.
1245
+ *
1246
+ * - Set `encoding` to specify the encoding format for the output and the expected encoding for
1247
+ * `salt`. Options include `base64` and `hex`.
1248
+ *
1249
+ * The derived key is the output of this process. Internally, PBKDF2 uses a pseudorandom function
1250
+ * (PRF), specifically a keyed HMAC. The hash algorithm chosen with `hashAlg` dictates this PRF;
1251
+ * for example, `SHA256` uses HMAC-SHA256, while `SHA1` uses HMAC-SHA1.
1252
+ *
1253
+ * Note: If `charset` is `hex` or `base64`, `password` is treated as binary data. It will be
1254
+ * decoded and used directly as a binary password.
1255
+ * `SHA256` uses HMAC-SHA256, while `SHA1` uses HMAC-SHA1.
1256
+ *
1257
+ * PBKDF1 and PBKDF2 are both key derivation functions used to strengthen passwords for
1258
+ * cryptographic purposes, but PBKDF2 is the improved version.
1259
+ *
1260
+ * - **PBKDF1**: Older and limited - it can only generate small keys (up to the hash function’s
1261
+ * output size), making it less flexible and secure.
1262
+ *
1263
+ * - **PBKDF2**: More advanced - it can generate longer keys, is more resistant to attacks, and is
1264
+ * widely recommended for modern security needs.
1265
+ *
1266
+ * In short, `PBKDF2` is stronger and more versatile than `PBKDF1`.
1267
+ *
1268
+ * @throws Error if the call fails (the message names the reason); the full log is in
1269
+ * {@link Crypt2.lastErrorText}.
1270
+ */
1271
+ pbkdf2(password: string, charset: string, hashAlg: string, salt: string, iterationCount: number, outputKeyBitLen: number, encoding: string): string
1272
+
1273
+ /**
1274
+ * Sets the initialization vector (IV) to a random value. The {@link Crypt2.cryptAlgorithm}
1275
+ * property should be set prior to calling this method.
1276
+ *
1277
+ * A **random IV** is used in symmetric encryption (like AES-CBC or AES-GCM) to ensure that
1278
+ * encrypting the same plaintext with the same key produces **different ciphertext each time**.
1279
+ * This prevents attackers from recognizing patterns in encrypted data and strengthens security.
1280
+ *
1281
+ * **Why use a random IV?**
1282
+ *
1283
+ * - It ensures **semantic security** (i.e. same plaintext never results in same ciphertext).
1284
+ *
1285
+ * - Prevents replay and pattern attacks.
1286
+ *
1287
+ * - Especially important in modes like **CBC** and **GCM**.
1288
+ *
1289
+ * **How is the IV sent to the decrypting party?**
1290
+ *
1291
+ * The IV is **not secret**, but it must be **available** for decryption. Common methods:
1292
+ *
1293
+ * - **Prepended** to the ciphertext (e.g., `IV || ciphertext`)
1294
+ *
1295
+ * - **Sent in a separate field** (e.g., JSON field, HTTP header)
1296
+ *
1297
+ * - **Concatenated and encoded** (e.g., base64 of IV + ciphertext)
1298
+ *
1299
+ * At the receiving side, the decryptor **extracts the IV** and uses it with the shared key to
1300
+ * decrypt the ciphertext correctly.
1301
+ */
1302
+ randomizeIV(): void
1303
+
1304
+ /**
1305
+ * This method converts between different encodings, such as from `base64` to `hex`. Each argument
1306
+ * can be **any binary encoding supported by Chilkat**.
1307
+ *
1308
+ * @throws Error if the call fails (the message names the reason); the full log is in
1309
+ * {@link Crypt2.lastErrorText}.
1310
+ */
1311
+ reEncode(encodedData: string, fromEncoding: string, toEncoding: string): string
1312
+
1313
+ /**
1314
+ * Sets the digital certificate for decryption when the {@link Crypt2.cryptAlgorithm} property is
1315
+ * set to `"pki"`. This method requires that the certificate has a private key.
1316
+ *
1317
+ * @throws Error if the call fails (the message names the reason); the full log is in
1318
+ * {@link Crypt2.lastErrorText}.
1319
+ */
1320
+ setDecryptCert(cert: Cert): void
1321
+
1322
+ /**
1323
+ * Sets the digital certificate and associated private key for decryption when the {@link
1324
+ * Crypt2.cryptAlgorithm} property is set to `"pki"`. The private key must be the one that matches
1325
+ * the certificate's public key.
1326
+ *
1327
+ * @throws Error if the call fails (the message names the reason); the full log is in
1328
+ * {@link Crypt2.lastErrorText}.
1329
+ */
1330
+ setDecryptCert2(cert: Cert, key: PrivateKey): void
1331
+
1332
+ /**
1333
+ * Sets the optional authenticated additional data (`AAD`) for AES encryption in `GCM` mode. The
1334
+ * data is provided as a binary-encoded string using the specified `encoding`, and any binary
1335
+ * encoding supported by Chilkat can be used.
1336
+ *
1337
+ * In GCM (Galois/Counter Mode) encryption, AAD (Additional Authenticated Data) is optional input
1338
+ * that is not encrypted but is authenticated along with the ciphertext. It's used to verify
1339
+ * integrity of associated data like headers or metadata. If AAD is modified, decryption will fail
1340
+ * due to authentication tag mismatch.
1341
+ *
1342
+ * @throws Error if the call fails (the message names the reason); the full log is in
1343
+ * {@link Crypt2.lastErrorText}.
1344
+ */
1345
+ setEncodedAad(aadStr: string, encoding: string): void
1346
+
1347
+ /**
1348
+ * In GCM mode, the authentication tag is a short value (e.g. 16 bytes) **generated during
1349
+ * encryption** that ensures the integrity and authenticity of both the ciphertext and any AAD. It
1350
+ * must be verified during decryption to confirm the data hasn't been altered.
1351
+ *
1352
+ * When decrypting AES-GCM, applications must call this method to provide the expected
1353
+ * authentication tag.
1354
+ *
1355
+ * To prevent Chilkat from checking the authentication tag after decryption, you can set the
1356
+ * authentication tag to the special `hex` value `FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF` (16 bytes of
1357
+ * 0xFF).
1358
+ *
1359
+ * @throws Error if the call fails (the message names the reason); the full log is in
1360
+ * {@link Crypt2.lastErrorText}.
1361
+ */
1362
+ setEncodedAuthTag(authTagStr: string, encoding: string): void
1363
+
1364
+ /**
1365
+ * Sets the initialization vector used in **symmetric encrpytion** (`AES`, `Blowfish`, etc.) from
1366
+ * a binary-encoded string using any Chilkat-supported encoding method (e.g., `base64`, `hex`).
1367
+ *
1368
+ * An **Initialization Vector (IV)** is a random or unique value used in symmetric encryption to
1369
+ * ensure that encrypting the same plaintext multiple times produces different ciphertexts. It
1370
+ * prevents pattern leakage.
1371
+ *
1372
+ * **Cipher Modes That Require an IV:**
1373
+ *
1374
+ * - `CBC` (Cipher Block Chaining)
1375
+ *
1376
+ * - `CFB` (Cipher Feedback)
1377
+ *
1378
+ * - `OFB` (Output Feedback)
1379
+ *
1380
+ * - `CTR` (Counter Mode)
1381
+ *
1382
+ * - `GCM` (Galois/Counter Mode)
1383
+ *
1384
+ * **ECB (Electronic Codebook)** does \*not\* use an IV, which makes it less secure.
1385
+ */
1386
+ setEncodedIV(ivStr: string, encoding: string): void
1387
+
1388
+ /**
1389
+ * Sets the encryption key used in **symmetric encryption** (`AES`, `Blowfish`, etc.) from a
1390
+ * binary-encoded string using any Chilkat-supported encoding method (e.g., `base64`, `hex`).
1391
+ *
1392
+ * The key must have a byte size equal to the {@link Crypt2.keyLength} property. For instance, a
1393
+ * KeyLength of `128 bits` requires a `16-byte` key, and a KeyLength of `256 bits` requires a
1394
+ * `32-byte` key.
1395
+ */
1396
+ setEncodedKey(keyStr: string, encoding: string): void
1397
+
1398
+ /**
1399
+ * Sets the `pbes2` or `pbes1` salt bytes from a binary-encoded string using any Chilkat-supported
1400
+ * encoding method (e.g., `base64`, `hex`).
1401
+ *
1402
+ * This salt is used for encryption and decryption when the {@link Crypt2.cryptAlgorithm} property
1403
+ * is set to `pbes1` or `pbes2`. Note: This does not apply to the {@link Crypt2.pbkdf1} or {@link
1404
+ * Crypt2.pbkdf2} methods, where the salt is provided as a function argument.
1405
+ */
1406
+ setEncodedSalt(saltStr: string, encoding: string): void
1407
+
1408
+ /**
1409
+ * Instructs the encryption library to use a specified digital certificate for public-key
1410
+ * encryption. To encrypt using multiple certificates, call {@link Crypt2.addEncryptCert} for each
1411
+ * one. This action is equivalent to calling {@link Crypt2.clearEncryptCerts} before {@link
1412
+ * Crypt2.addEncryptCert}.
1413
+ *
1414
+ * @throws Error if the call fails (the message names the reason); the full log is in
1415
+ * {@link Crypt2.lastErrorText}.
1416
+ */
1417
+ setEncryptCert(cert: Cert): void
1418
+
1419
+ /**
1420
+ * Sets the initialization vector (IV) for a symmetric encryption algorithm like AES.
1421
+ */
1422
+ setIV(byteData: ArrayBuffer): void
1423
+
1424
+ /**
1425
+ * Sets the MAC key from a binary-encoded string using any Chilkat-supported encoding method
1426
+ * (e.g., `base64`, `hex`).
1427
+ *
1428
+ * @throws Error if the call fails (the message names the reason); the full log is in
1429
+ * {@link Crypt2.lastErrorText}.
1430
+ */
1431
+ setMacKeyEncoded(key: string, encoding: string): void
1432
+
1433
+ /**
1434
+ * Sets the MAC key from a string. The {@link Crypt2.charset} property determines the actual bytes
1435
+ * used for the MAC key.
1436
+ *
1437
+ * @throws Error if the call fails (the message names the reason); the full log is in
1438
+ * {@link Crypt2.lastErrorText}.
1439
+ */
1440
+ setMacKeyString(key: string): void
1441
+
1442
+ /**
1443
+ * Sets the encryption key used in **symmetric encrpytion** (`AES`, `Blowfish`, etc.).
1444
+ *
1445
+ * The key must have a byte size equal to the {@link Crypt2.keyLength} property. For instance, a
1446
+ * KeyLength of `128 bits` requires a `16-byte` key, and a KeyLength of `256 bits` requires a
1447
+ * `32-byte` key.
1448
+ */
1449
+ setSecretKey(byteData: ArrayBuffer): void
1450
+
1451
+ /**
1452
+ * Sets the digital certificate to be used for signing. Signing requires that the certificate has
1453
+ * a private key.
1454
+ *
1455
+ * @throws Error if the call fails (the message names the reason); the full log is in
1456
+ * {@link Crypt2.lastErrorText}.
1457
+ */
1458
+ setSigningCert(cert: Cert): void
1459
+
1460
+ /**
1461
+ * Sets the digital certificate and associated private key for signing. The private key must be
1462
+ * the one that matches the certificate's public key.
1463
+ *
1464
+ * @throws Error if the call fails (the message names the reason); the full log is in
1465
+ * {@link Crypt2.lastErrorText}.
1466
+ */
1467
+ setSigningCert2(cert: Cert, privateKey: PrivateKey): void
1468
+
1469
+ /**
1470
+ * Assigns the digital certificate for signature verification. Typically, a PKCS7 (CMS) signature
1471
+ * includes the signing certificate information, making it **unnecessary to call this method
1472
+ * explicitly**. This is only required in rare instances.
1473
+ *
1474
+ * @throws Error if the call fails (the message names the reason); the full log is in
1475
+ * {@link Crypt2.lastErrorText}.
1476
+ */
1477
+ setVerifyCert(cert: Cert): void
1478
+
1479
+ /**
1480
+ * Digitally signs a string and returns a `detached` signature (`PKCS#7 signed-data`) as a
1481
+ * binary-encoded string. The {@link Crypt2.encodingMode} property determines the binary-encoding.
1482
+ * Possible encodings include `base64`, `base64_mime`, `hex`, and `hex_lower`. The {@link
1483
+ * Crypt2.hashAlgorithm} property specifies the hash algorithm for creating the data's hash during
1484
+ * signing. The {@link Crypt2.charset} property determines the actual bytes that are hashed and
1485
+ * signed.
1486
+ *
1487
+ * This call blocks the JavaScript thread until Chilkat returns; from UI code prefer
1488
+ * {@link Crypt2.signStringENCAsync}.
1489
+ *
1490
+ * @throws Error if the call fails (the message names the reason); the full log is in
1491
+ * {@link Crypt2.lastErrorText}.
1492
+ */
1493
+ signStringENC(str: string): string
1494
+
1495
+ /**
1496
+ * Asynchronous form of {@link Crypt2.signStringENC}: the same call on a native worker thread,
1497
+ * settling on the JavaScript thread. While it is pending, other calls on this object throw,
1498
+ * except {@link Crypt2.abort} (which cancels it) and the {@link Crypt2.onPercentDone} /
1499
+ * {@link Crypt2.onProgressInfo} callbacks, which report progress while it runs.
1500
+ *
1501
+ * The promise rejects with an Error if the call fails; the full log is in
1502
+ * {@link Crypt2.lastErrorText}.
1503
+ */
1504
+ signStringENCAsync(str: string): Promise<string>
1505
+
1506
+ /**
1507
+ * Adds an XML certificate vault to the object's internal list of sources to be searched for
1508
+ * certificates and private keys when encrypting/decrypting or signing/verifying. Unlike the
1509
+ * AddPfxSourceData and AddPfxSourceFile methods, only a single XML certificate vault can be used.
1510
+ * If UseCertVault is called multiple times, only the last certificate vault will be used, as each
1511
+ * call to UseCertVault will replace the certificate vault provided in previous calls.
1512
+ *
1513
+ * @throws Error if the call fails (the message names the reason); the full log is in
1514
+ * {@link Crypt2.lastErrorText}.
1515
+ */
1516
+ useCertVault(vault: XmlCertVault): void
1517
+
1518
+ /**
1519
+ * Verifies an `opaque digital signature` contained in a `.p7m` file and extracts the original
1520
+ * data to `destPath`. Returns `true` if the .p7m is validated and the original data was
1521
+ * extracted. Otherwise returns `false`.
1522
+ *
1523
+ * Afterwards, you can retrieve signer certificates by using the {@link Crypt2.numSignerCerts}
1524
+ * property and the {@link Crypt2.lastSignerCert} method.
1525
+ *
1526
+ * @throws Error if the call fails (the message names the reason); the full log is in
1527
+ * {@link Crypt2.lastErrorText}.
1528
+ */
1529
+ verifyP7M(p7mPath: string, destPath: string): void
1530
+
1531
+ /**
1532
+ * Verifies a `detached digital signature` contained in a `.p7s` file against the original data
1533
+ * contained in `originalDataPath`. Returns `true` if the signature is verified.
1534
+ *
1535
+ * Afterwards, you can retrieve signer certificates by using the {@link Crypt2.numSignerCerts}
1536
+ * property and the {@link Crypt2.lastSignerCert} method.
1537
+ *
1538
+ * @throws Error if the call fails (the message names the reason); the full log is in
1539
+ * {@link Crypt2.lastErrorText}.
1540
+ */
1541
+ verifyP7S(originalDataPath: string, p7sPath: string): void
1542
+
1543
+ /**
1544
+ * Verifies a `detached digital signature` against the original text in `str`. Returns `true` if
1545
+ * the signature is verified. The `encodedSig` holds a binary-encoded `PKCS#7 signed-data`
1546
+ * detached signature. The type of binary encoding, such as `base64,` `hex,` or `base64_mime,` is
1547
+ * determined by the {@link Crypt2.encodingMode} property. The {@link Crypt2.charset} property
1548
+ * determines how the text in `str` is converted to bytes for signature validation.
1549
+ *
1550
+ * Afterwards, you can retrieve signer certificates by using the {@link Crypt2.numSignerCerts}
1551
+ * property and the {@link Crypt2.lastSignerCert} method.
1552
+ *
1553
+ * @throws Error if the call fails (the message names the reason); the full log is in
1554
+ * {@link Crypt2.lastErrorText}.
1555
+ */
1556
+ verifyStringENC(str: string, encodedSig: string): void
1557
+
1558
+ /**
1559
+ * Computes and returns a bcrypt hash of the `password`. The number of rounds of hashing is
1560
+ * determined by the `BCryptWorkFactor` property.
1561
+ *
1562
+ * Starting in v9.5.0.76, if the `password` is prefixed with `$2b$` then the output will use the
1563
+ * $2b version of bcrypt. For example, to create a `$2b$` bcrypt has for the password `secret`,
1564
+ * pass in the string `$2b$secret` for `password`.
1565
+ *
1566
+ * @throws Error if the call fails (the message names the reason); the full log is in
1567
+ * {@link Crypt2.lastErrorText}.
1568
+ */
1569
+ bCryptHash(password: string): string
1570
+
1571
+ /**
1572
+ * Verifies the `password` against a previously computed BCrypt hash. Returns `true` if the
1573
+ * password matches the `bcryptHash`. Returns `false` if the password does not match.
1574
+ *
1575
+ * @throws Error if the call fails (the message names the reason); the full log is in
1576
+ * {@link Crypt2.lastErrorText}.
1577
+ */
1578
+ bCryptVerify(password: string, bcryptHash: string): void
1579
+
1580
+ /**
1581
+ * Implements the `AES Key Wrap Algorithm` (RFC 3394). The `kek` is the `Key Encryption Key` (the
1582
+ * AES key used to encrypt the `keyData`). The arguments and return value are binary encoded
1583
+ * strings using the encoding specified by `encoding` (which can be `base64`, `hex`, `base64url`,
1584
+ * etc.) The full list of supported encodings is available at the link below.
1585
+ *
1586
+ * The `kek` should be an `AES key` of `16 bytes`, `24 bytes`, or `32 bytes` (i.e. 128-bits, 192-
1587
+ * bits, or 256-bits). For example, if passed as a hex string, then the `kek` should be 32 chars
1588
+ * in length, 48 chars, or 64 chars (because each byte is represented as 2 chars in hex).
1589
+ *
1590
+ * The `keyData` contains the data to be key wrapped. It must be a multiple of 64-bits in length.
1591
+ * In other words, if the `keyData` is decoded to binary, it should be a number of bytes that is a
1592
+ * multiple of 8.
1593
+ *
1594
+ * The return string, if decoded to binary bytes, is equal to the size of the key data + 8
1595
+ * additional bytes.
1596
+ *
1597
+ * @throws Error if the call fails (the message names the reason); the full log is in
1598
+ * {@link Crypt2.lastErrorText}.
1599
+ */
1600
+ aesKeyWrap(kek: string, keyData: string, encoding: string): string
1601
+
1602
+ /**
1603
+ * Implements the `AES Key Wrap Algorithm` (RFC 3394) for unwrapping. The `kek` is the `Key
1604
+ * Encryption Key` (the AES key used to unwrap the `wrappedKeyData`). The arguments and return
1605
+ * value are binary encoded strings using the encoding specified by `encoding` (which can be
1606
+ * `base64`, `hex`, `base64url`, etc.) The full list of supported encodings is available at the
1607
+ * link below.
1608
+ *
1609
+ * The `kek` should be an `AES key` of `16 bytes`, `24 bytes`, or `32 bytes` (i.e. 128-bits, 192-
1610
+ * bits, or 256-bits). For example, if passed as a hex string, then the `kek` should be 32 chars
1611
+ * in length, 48 chars, or 64 chars (because each byte is represented as 2 chars in hex).
1612
+ *
1613
+ * The `wrappedKeyData` contains the data to be unwrapped. The result, if decoded, is 8 bytes less
1614
+ * than the wrapped key data. For example, if a 256-bit AES key (32 bytes) is wrapped, the size of
1615
+ * the wrapped key data is 40 bytes. Unwrapping restores it to the original 32 bytes.
1616
+ *
1617
+ * @throws Error if the call fails (the message names the reason); the full log is in
1618
+ * {@link Crypt2.lastErrorText}.
1619
+ */
1620
+ aesKeyUnwrap(kek: string, wrappedKeyData: string, encoding: string): string
1621
+
1622
+ /**
1623
+ * Hashes the bytes in `bd` and returns the hash as a binary-encoded string. The hash algorithm is
1624
+ * determined by the {@link Crypt2.hashAlgorithm} property, while the encoding is specified by the
1625
+ * {@link Crypt2.encodingMode} property. Encoding options include `base64`, `hex`, `base64url`, or
1626
+ * others listed at the link below.
1627
+ *
1628
+ * @throws Error if the call fails (the message names the reason); the full log is in
1629
+ * {@link Crypt2.lastErrorText}.
1630
+ */
1631
+ hashBdENC(bd: BinData): string
1632
+
1633
+ /**
1634
+ * Generates a **Message Authentication Code** (MAC) for the bytes in `bd` using the algorithm
1635
+ * defined by the {@link Crypt2.macAlgorithm} property. The resulting MAC is encoded into a string
1636
+ * based on the {@link Crypt2.encodingMode} property (e.g., `base64` or `hex`). The {@link
1637
+ * Crypt2.hashAlgorithm} property determines the internal hash function. Before generating the
1638
+ * MAC, specify the secret key using {@link Crypt2.setMacKeyEncoded}.
1639
+ *
1640
+ * @throws Error if the call fails (the message names the reason); the full log is in
1641
+ * {@link Crypt2.lastErrorText}.
1642
+ */
1643
+ macBdENC(bd: BinData): string
1644
+
1645
+ /**
1646
+ * Encrypts the contents of `bd`. This method can do either `symmetric key encryption` or `CMS
1647
+ * public key encryption` (e.g., `PKCS#7 EnvelopedData`).
1648
+ *
1649
+ * Before calling this method for `symmetric key encryption` (e.g., `AES`, `ChaCha20`, `Blowfish`,
1650
+ * etc.), ensure the following setup:
1651
+ *
1652
+ * - Define the encryption algorithm using the {@link Crypt2.cryptAlgorithm} property.
1653
+ *
1654
+ * - Specify the encryption key length with the {@link Crypt2.keyLength} property.
1655
+ *
1656
+ * - Establish the cipher mode through the {@link Crypt2.cipherMode} property.
1657
+ *
1658
+ * - Use the {@link Crypt2.setEncodedIV} method to set the IV, if needed by the cipher mode.
1659
+ *
1660
+ * - Set the encryption key with the {@link Crypt2.setEncodedKey} method.
1661
+ *
1662
+ * - Set the {@link Crypt2.paddingScheme} property if needing something different than the
1663
+ * default.
1664
+ *
1665
+ * When calling this method for `public key encryption` (i.e. creating a `PKCS7 CMS message`), the
1666
+ * following setup is required:
1667
+ *
1668
+ * - The {@link Crypt2.cryptAlgorithm} property should be set to the string `"pki"`.
1669
+ *
1670
+ * - To specify the encryption certificate, use {@link Crypt2.setEncryptCert}. For multiple
1671
+ * certificates, call {@link Crypt2.addEncryptCert} for each one.
1672
+ *
1673
+ * @throws Error if the call fails (the message names the reason); the full log is in
1674
+ * {@link Crypt2.lastErrorText}.
1675
+ */
1676
+ encryptBd(bd: BinData): void
1677
+
1678
+ /**
1679
+ * Decrypts the contents of `bd`. This method can do either `symmetric key decryption` or `CMS
1680
+ * public key decryption` (e.g., `PKCS#7 EnvelopedData`).
1681
+ *
1682
+ * Before calling this method for `symmetric key decryption` (e.g., `AES`, `ChaCha20`, `Blowfish`,
1683
+ * etc.), ensure the following setup:
1684
+ *
1685
+ * - Define the encryption algorithm using the `CryptAlgorithm` property.
1686
+ *
1687
+ * - Specify the encryption key length with the `KeyLength` property.
1688
+ *
1689
+ * - Establish the cipher mode through the `CipherMode` property.
1690
+ *
1691
+ * - Use the `SetEncodedIV` method to set the IV, if needed by the cipher mode.
1692
+ *
1693
+ * - Set the encryption key with the `SetEncodedKey` method.
1694
+ *
1695
+ * - Ensure the `PaddingScheme` property matches the encryptor's value.
1696
+ *
1697
+ * When calling this method for `public key decryption` (i.e. decrypting a `PKCS7 CMS message`),
1698
+ * the following setup is required:
1699
+ *
1700
+ * - The `CryptAlgorithm` property should be set to the string `"pki"`.
1701
+ *
1702
+ * - Optionally specify the certificate to be used for decryption by calling `SetDecryptCert`. If
1703
+ * SetDecryptCert is not called, then Chilkat will automatically search certificate sources
1704
+ * (`Windows certificate stores`, `Apple keychain`, etc.) for the required certificate.
1705
+ *
1706
+ * @throws Error if the call fails (the message names the reason); the full log is in
1707
+ * {@link Crypt2.lastErrorText}.
1708
+ */
1709
+ decryptBd(bd: BinData): void
1710
+
1711
+ /**
1712
+ * Encrypts text and appends the encrypted bytes in `bdOut`.
1713
+ * The {@link Crypt2.charset} property, such as `utf-8`, determines the actual bytes that are
1714
+ * encrypted.
1715
+ *
1716
+ * `StringBuilder` → **Get bytes according to** `Charset` → **Encrypt** → **Append to ** `BinData`
1717
+ *
1718
+ * This method supports `symmetric key` and `public key` encryption. For more information on
1719
+ * **properties that affect encryption**, such as {@link Crypt2.cryptAlgorithm}, {@link
1720
+ * Crypt2.cipherMode}, etc., refer to the {@link Crypt2.encryptBd} method documentation.
1721
+ *
1722
+ * @throws Error if the call fails (the message names the reason); the full log is in
1723
+ * {@link Crypt2.lastErrorText}.
1724
+ */
1725
+ encryptSb(sbIn: StringBuilder, bdOut: BinData): void
1726
+
1727
+ /**
1728
+ * This function is intended for use when the **expected decrypted output is text**. It decrypts
1729
+ * the contents of `bdIn` and appends the resulting string to `sbOut`. Ensure that the {@link
1730
+ * Crypt2.charset} property, such as `utf-8,` matches the one used during encryption to interpret
1731
+ * the decrypted bytes correctly as characters.
1732
+ *
1733
+ * **Input** → **Decrypt** → **Interpret Bytes according to** `Charset` → **Append to
1734
+ * StringBuilder**
1735
+ *
1736
+ * This method supports `symmetric key` and `public key` decryption. For more information on
1737
+ * **properties that affect decryption**, such as {@link Crypt2.cryptAlgorithm}, {@link
1738
+ * Crypt2.cipherMode}, etc., refer to the {@link Crypt2.decryptBd} method documentation.
1739
+ *
1740
+ * @throws Error if the call fails (the message names the reason); the full log is in
1741
+ * {@link Crypt2.lastErrorText}.
1742
+ */
1743
+ decryptSb(bdIn: BinData, sbOut: StringBuilder): void
1744
+
1745
+ /**
1746
+ * Digitally signs the content in `dataToSign` and returns a `detached` signature (`PKCS#7
1747
+ * signed-data`) as a binary-encoded string. The {@link Crypt2.encodingMode} property determines
1748
+ * the binary-encoding. Possible encodings include `base64`, `base64_mime`, `hex`, and
1749
+ * `hex_lower`. The {@link Crypt2.hashAlgorithm} property specifies the hash algorithm for
1750
+ * creating the data's hash during signing.
1751
+ *
1752
+ * This call blocks the JavaScript thread until Chilkat returns; from UI code prefer
1753
+ * {@link Crypt2.signBdENCAsync}.
1754
+ *
1755
+ * @throws Error if the call fails (the message names the reason); the full log is in
1756
+ * {@link Crypt2.lastErrorText}.
1757
+ */
1758
+ signBdENC(dataToSign: BinData): string
1759
+
1760
+ /**
1761
+ * Asynchronous form of {@link Crypt2.signBdENC}: the same call on a native worker thread,
1762
+ * settling on the JavaScript thread. While it is pending, other calls on this object throw,
1763
+ * except {@link Crypt2.abort} (which cancels it) and the {@link Crypt2.onPercentDone} /
1764
+ * {@link Crypt2.onProgressInfo} callbacks, which report progress while it runs.
1765
+ *
1766
+ * The promise rejects with an Error if the call fails; the full log is in
1767
+ * {@link Crypt2.lastErrorText}.
1768
+ */
1769
+ signBdENCAsync(dataToSign: BinData): Promise<string>
1770
+
1771
+ /**
1772
+ * Digitally signs the text contained in `sb` and returns a `detached` signature (`PKCS#7
1773
+ * signed-data`) as a binary-encoded string. The {@link Crypt2.encodingMode} property determines
1774
+ * the binary-encoding. Possible encodings include `base64`, `base64_mime`, `hex`, and
1775
+ * `hex_lower`. The {@link Crypt2.hashAlgorithm} property specifies the hash algorithm for
1776
+ * creating the data's hash during signing. The {@link Crypt2.charset} property determines the
1777
+ * actual bytes that are hashed and signed.
1778
+ *
1779
+ * This call blocks the JavaScript thread until Chilkat returns; from UI code prefer
1780
+ * {@link Crypt2.signSbENCAsync}.
1781
+ *
1782
+ * @throws Error if the call fails (the message names the reason); the full log is in
1783
+ * {@link Crypt2.lastErrorText}.
1784
+ */
1785
+ signSbENC(sb: StringBuilder): string
1786
+
1787
+ /**
1788
+ * Asynchronous form of {@link Crypt2.signSbENC}: the same call on a native worker thread,
1789
+ * settling on the JavaScript thread. While it is pending, other calls on this object throw,
1790
+ * except {@link Crypt2.abort} (which cancels it) and the {@link Crypt2.onPercentDone} /
1791
+ * {@link Crypt2.onProgressInfo} callbacks, which report progress while it runs.
1792
+ *
1793
+ * The promise rejects with an Error if the call fails; the full log is in
1794
+ * {@link Crypt2.lastErrorText}.
1795
+ */
1796
+ signSbENCAsync(sb: StringBuilder): Promise<string>
1797
+
1798
+ /**
1799
+ * Digitally signs the contents of `bd`. If successful, the contents of `bd` are replaced with the
1800
+ * `PKCS#7 signed-data`, which embeds the original data within the signature. Ensure a certificate
1801
+ * is set using {@link Crypt2.setSigningCert} before invoking this method. The {@link
1802
+ * Crypt2.hashAlgorithm} property specifies the hash algorithm for creating the data's hash during
1803
+ * signing.
1804
+ *
1805
+ * This call blocks the JavaScript thread until Chilkat returns; from UI code prefer
1806
+ * {@link Crypt2.opaqueSignBdAsync}.
1807
+ *
1808
+ * @throws Error if the call fails (the message names the reason); the full log is in
1809
+ * {@link Crypt2.lastErrorText}.
1810
+ */
1811
+ opaqueSignBd(bd: BinData): void
1812
+
1813
+ /**
1814
+ * Asynchronous form of {@link Crypt2.opaqueSignBd}: the same call on a native worker thread,
1815
+ * settling on the JavaScript thread. While it is pending, other calls on this object throw,
1816
+ * except {@link Crypt2.abort} (which cancels it) and the {@link Crypt2.onPercentDone} /
1817
+ * {@link Crypt2.onProgressInfo} callbacks, which report progress while it runs.
1818
+ *
1819
+ * The promise rejects with an Error if the call fails; the full log is in
1820
+ * {@link Crypt2.lastErrorText}.
1821
+ */
1822
+ opaqueSignBdAsync(bd: BinData): Promise<void>
1823
+
1824
+ /**
1825
+ * The method performs in-place verification of the `PKCS#7 signed-data` content of `bd`. If the
1826
+ * signature is successfully verified, the content of `bd` is replaced with the original data, and
1827
+ * the method returns `true`. If verification fails, `bd` remains unchanged, and the method
1828
+ * returns `false`. Afterwards, you can retrieve signer certificates by using the {@link
1829
+ * Crypt2.numSignerCerts} property and the {@link Crypt2.lastSignerCert} method.
1830
+ *
1831
+ * @throws Error if the call fails (the message names the reason); the full log is in
1832
+ * {@link Crypt2.lastErrorText}.
1833
+ */
1834
+ opaqueVerifyBd(bd: BinData): void
1835
+
1836
+ /**
1837
+ * Verifies a `detached digital signature` against the original data contained in `data`. Returns
1838
+ * `true` if the signature is verified. The `encodedSig` holds a binary-encoded `PKCS#7
1839
+ * signed-data` detached signature. The type of binary encoding, such as `base64,` `hex,` or
1840
+ * `base64_mime,` is determined by the {@link Crypt2.encodingMode} property.
1841
+ *
1842
+ * Afterwards, you can retrieve signer certificates by using the {@link Crypt2.numSignerCerts}
1843
+ * property and the {@link Crypt2.lastSignerCert} method.
1844
+ *
1845
+ * @throws Error if the call fails (the message names the reason); the full log is in
1846
+ * {@link Crypt2.lastErrorText}.
1847
+ */
1848
+ verifyBdENC(data: BinData, encodedSig: string): void
1849
+
1850
+ /**
1851
+ * Verifies a `detached digital signature` against the original text contained in `sb`. Returns
1852
+ * `true` if the signature is verified. The `encodedSig` holds a binary-encoded `PKCS#7
1853
+ * signed-data` detached signature. The type of binary encoding, such as `base64,` `hex,` or
1854
+ * `base64_mime,` is determined by the {@link Crypt2.encodingMode} property. The {@link
1855
+ * Crypt2.charset} property determines how the text in `sb` is converted to bytes for signature
1856
+ * validation.
1857
+ *
1858
+ * Afterwards, you can retrieve signer certificates by using the {@link Crypt2.numSignerCerts}
1859
+ * property and the {@link Crypt2.lastSignerCert} method.
1860
+ *
1861
+ * @throws Error if the call fails (the message names the reason); the full log is in
1862
+ * {@link Crypt2.lastErrorText}.
1863
+ */
1864
+ verifySbENC(sb: StringBuilder, encodedSig: string): void
1865
+
1866
+ /**
1867
+ * Encrypts the secure string and returns the encrypted bytes as a binary encoded string. The
1868
+ * {@link Crypt2.charset} property determines the actual bytes that are encrypted.
1869
+ *
1870
+ * `SecureString` → **Get bytes according to** `Charset` → **Encrypt** → **Encode using**
1871
+ * `EncodingMode` → **Output**
1872
+ *
1873
+ * The encoding (e.g. `base64`, `hex`, etc.) is determined by the {@link Crypt2.encodingMode}
1874
+ * property.
1875
+ *
1876
+ * This method supports `symmetric key` and `public key` encryption. For more information on
1877
+ * **properties that affect encryption**, such as {@link Crypt2.cryptAlgorithm}, {@link
1878
+ * Crypt2.cipherMode}, etc., refer to the {@link Crypt2.encryptBd} method documentation.
1879
+ *
1880
+ * @throws Error if the call fails (the message names the reason); the full log is in
1881
+ * {@link Crypt2.lastErrorText}.
1882
+ */
1883
+ encryptSecureENC(secureStr: SecureString): string
1884
+
1885
+ /**
1886
+ * This function is intended for use when the **expected decrypted output is text**. It decrypts
1887
+ * binary encoded encrypted bytes passed in `cipherText` and appends the resulting string to
1888
+ * `secureStr`. Ensure that the {@link Crypt2.charset} property, such as `utf-8,` matches the one
1889
+ * used during encryption to interpret the decrypted bytes correctly as characters.
1890
+ *
1891
+ * **Input** → **Decode using** `EncodingMode` → **Decrypt** → **Interpret Bytes according to**
1892
+ * `Charset` → **Append to Secure String**
1893
+ *
1894
+ * The encoding (e.g. `base64`, `hex`, etc.) is determined by the {@link Crypt2.encodingMode}
1895
+ * property.
1896
+ *
1897
+ * This method supports `symmetric key` and `public key` decryption. For more information on
1898
+ * **properties that affect decryption**, such as {@link Crypt2.cryptAlgorithm}, {@link
1899
+ * Crypt2.cipherMode}, etc., refer to the {@link Crypt2.decryptBd} method documentation.
1900
+ *
1901
+ * @throws Error if the call fails (the message names the reason); the full log is in
1902
+ * {@link Crypt2.lastErrorText}.
1903
+ */
1904
+ decryptSecureENC(cipherText: string, secureStr: SecureString): void
1905
+
1906
+ /**
1907
+ * Extracts the signed (authenticated) attributes for the Nth signer, where `signerIndex` is
1908
+ * typically 0, as most signatures have only one signer.
1909
+ *
1910
+ * Provide the binary PKCS7 in `pkcs7Der`. If successful, `sbJson` will hold the signed attributes
1911
+ * in JSON format.
1912
+ *
1913
+ * Sample JSON output:
1914
+ *
1915
+ * ```
1916
+ * {
1917
+ * "signedAttributes": [
1918
+ * {
1919
+ * "oid": "1.2.840.113549.1.9.3",
1920
+ * "name": "Content Type"
1921
+ * },
1922
+ * {
1923
+ * "oid": "1.2.840.113549.1.9.5",
1924
+ * "name": "Signing Time"
1925
+ * },
1926
+ * {
1927
+ * "oid": "1.2.840.113549.1.9.4"
1928
+ * "name": "Message Digest"
1929
+ * },
1930
+ * {
1931
+ * "oid": "1.2.840.113549.1.9.16.2.47",
1932
+ * "name": "Signing Certificate V2"
1933
+ * }
1934
+ * ]
1935
+ * }
1936
+ * ```
1937
+ */
1938
+ getSignedAttributes(signerIndex: number, pkcs7Der: BinData, sbJson: StringBuilder): boolean
1939
+
1940
+ /**
1941
+ * Implements RFC 4226: HOTP: An HMAC-Based One-Time Password Algorithm. The arguments to this
1942
+ * method are:
1943
+ *
1944
+ * - `secret`: The shared secret in an enocded representation such as base64, hex, ascii, etc.
1945
+ *
1946
+ * - `secretEnc`: The encoding of the shared secret, such as `base64`
1947
+ *
1948
+ * - `counterHex`: The 8-byte counter in hexidecimal format.
1949
+ *
1950
+ * - `numDigits`: The number of decimal digits to return.
1951
+ *
1952
+ * - `truncOffset`: Normally set this to -1 for dynamic truncation. Otherwise can be set in the
1953
+ * range 0..15.
1954
+ *
1955
+ * - `hashAlg`: Normally set to `sha1`. Can be set to other hash algorithms such as `sha256`,
1956
+ * `sha512`, etc.
1957
+ *
1958
+ * @throws Error if the call fails (the message names the reason); the full log is in
1959
+ * {@link Crypt2.lastErrorText}.
1960
+ */
1961
+ hotp(secret: string, secretEnc: string, counterHex: string, numDigits: number, truncOffset: number, hashAlg: string): string
1962
+
1963
+ /**
1964
+ * Encodes an integer to N bytes and returns in the specified encoding. If `littleEndian` is
1965
+ * `true`, then `little-endian` byte ordering is used. Otherwise `big-endian` byte order is used.
1966
+ *
1967
+ * @throws Error if the call fails (the message names the reason); the full log is in
1968
+ * {@link Crypt2.lastErrorText}.
1969
+ */
1970
+ encodeInt(value: number, numBytes: number, littleEndian: boolean, encoding: string): string
1971
+
1972
+ /**
1973
+ * Implements RFC 6238: TOTP: Time-Based One-Time Password Algorithm. The arguments to this method
1974
+ * are:
1975
+ *
1976
+ * - `secret`: The shared secret in an enocded representation such as base64, hex, ascii, etc.
1977
+ *
1978
+ * - `secretEnc`: The encoding of the shared secret, such as `base64`
1979
+ *
1980
+ * - `t0`: The Unix time to start counting time steps. It is a number in decimal string form. A
1981
+ * Unix time is the number of seconds elapsed since midnight UTC of January 1, 1970. `0` is a
1982
+ * typical value used for this argument.
1983
+ *
1984
+ * - `tNow`: The current Unix time in decimal string form. To use the current system date/time,
1985
+ * pass an empty string for this argument.
1986
+ *
1987
+ * - `tStep`: The time step in seconds. A typical value is 30. Note: Both client and server must
1988
+ * pre-agree on the secret, the t0, and the tStep.
1989
+ *
1990
+ * - `numDigits`: The number of decimal digits to return.
1991
+ *
1992
+ * - `truncOffset`: Normally set this to -1 for dynamic truncation. Otherwise can be set in the
1993
+ * range 0..15.
1994
+ *
1995
+ * - `hashAlg`: Normally set to `sha1`. Can be set to other hash algorithms such as `sha256`,
1996
+ * `sha512`, etc.
1997
+ *
1998
+ * @throws Error if the call fails (the message names the reason); the full log is in
1999
+ * {@link Crypt2.lastErrorText}.
2000
+ */
2001
+ totp(secret: string, secretEnc: string, t0: string, tNow: string, tStep: number, numDigits: number, truncOffset: number, hashAlg: string): string
2002
+
2003
+ /**
2004
+ * If timestamp server communications are needed for signing and special Internet settings like a
2005
+ * proxy server are necessary, this method can provide an Http object configured with these
2006
+ * settings.
2007
+ */
2008
+ setTsaHttpObj(http: Http): void
2009
+
2010
+ /**
2011
+ * To hash binary data in chunks, start by hashing the first chunk using this method. For
2012
+ * additional chunks, use the `HashMoreBytes` method as needed. Complete the process with
2013
+ * `HashFinal` or {@link Crypt2.hashFinalENC} to obtain the hash result. The hash algorithm used
2014
+ * is determined by the {@link Crypt2.hashAlgorithm} property setting.
2015
+ *
2016
+ * @throws Error if the call fails (the message names the reason); the full log is in
2017
+ * {@link Crypt2.lastErrorText}.
2018
+ */
2019
+ hashBeginBytes2(byteData: ArrayBuffer): void
2020
+
2021
+ /**
2022
+ * The same as HashMoreBytes except the binary data is passed via a pointer and length.
2023
+ *
2024
+ * @throws Error if the call fails (the message names the reason); the full log is in
2025
+ * {@link Crypt2.lastErrorText}.
2026
+ */
2027
+ hashMoreBytes2(byteData: ArrayBuffer): void
2028
+
2029
+ /**
2030
+ * Call this method once per certificate to add `multiple certificates for signing`. If signing
2031
+ * with a single certificate, then the `SetSigningCert` or `SetSigningCert2` methods can be used
2032
+ * instead.
2033
+ *
2034
+ * @throws Error if the call fails (the message names the reason); the full log is in
2035
+ * {@link Crypt2.lastErrorText}.
2036
+ */
2037
+ addSigningCert(cert: Cert): void
2038
+
2039
+ /**
2040
+ * Clears the set of certificates to be used in signing.
2041
+ */
2042
+ clearSigningCerts(): void
2043
+
2044
+ /**
2045
+ * Co-sign's an existing CMS signature. `bdIn` contains the existing CMS signature. If successful,
2046
+ * `cert` is the output co-signed CMS signature.
2047
+ *
2048
+ * @throws Error if the call fails (the message names the reason); the full log is in
2049
+ * {@link Crypt2.lastErrorText}.
2050
+ */
2051
+ coSign(bdIn: BinData, cert: Cert, bdOut: BinData): void
2052
+
2053
+ /**
2054
+ * Digitally signs a pre-computed hash and returns a `detached` signature (`PKCS#7 signed-data`)
2055
+ * as a binary-encoded string. The {@link Crypt2.encodingMode} property determines the
2056
+ * binary-encoding. Possible encodings include `base64`, `base64_mime`, `hex`, and `hex_lower`
2057
+ *
2058
+ * `encodedHash` is a binary-encoded hash to be signed, with its encoding format specified by
2059
+ * `hashEncoding` (e.g., `base64`, `hex`). `hashAlg` specifies the hash algorithm (e.g., `sha256`,
2060
+ * `sha1`, `sha512`) used for `encodedHash`.
2061
+ *
2062
+ * This call blocks the JavaScript thread until Chilkat returns; from UI code prefer
2063
+ * {@link Crypt2.signHashENCAsync}.
2064
+ *
2065
+ * @throws Error if the call fails (the message names the reason); the full log is in
2066
+ * {@link Crypt2.lastErrorText}.
2067
+ */
2068
+ signHashENC(encodedHash: string, hashAlg: string, hashEncoding: string): string
2069
+
2070
+ /**
2071
+ * Asynchronous form of {@link Crypt2.signHashENC}: the same call on a native worker thread,
2072
+ * settling on the JavaScript thread. While it is pending, other calls on this object throw,
2073
+ * except {@link Crypt2.abort} (which cancels it) and the {@link Crypt2.onPercentDone} /
2074
+ * {@link Crypt2.onProgressInfo} callbacks, which report progress while it runs.
2075
+ *
2076
+ * The promise rejects with an Error if the call fails; the full log is in
2077
+ * {@link Crypt2.lastErrorText}.
2078
+ */
2079
+ signHashENCAsync(encodedHash: string, hashAlg: string, hashEncoding: string): Promise<string>
2080
+
2081
+ /**
2082
+ * Sets the XTS-AES mode tweak value from an encoded string. The encoding argument can be set to
2083
+ * any of the following strings: `base64`, `hex`, `quoted-printable`, `ascii`, or `url`.
2084
+ *
2085
+ * The tweak value must be 16 bytes in length. An application can set the initial tweak value by
2086
+ * calling this method, or by calling XtsSetDataUnitNumber (but not both).
2087
+ */
2088
+ xtsSetEncodedTweakValue(tweak: string, encoding: string): void
2089
+
2090
+ /**
2091
+ * Sets the XTS-AES mode data unit number. The data unit number is a 64-bit unsigned integer. It
2092
+ * is passed in as two 32-bit unsigned integers representing the high and low 32-bits.
2093
+ *
2094
+ * Setting the data unit number is one way of setting the tweak value. The tweak value is 16 bytes
2095
+ * in length and can alternatively be set by calling XtsSetEncodedTweakValue.
2096
+ *
2097
+ * This method sets the tweak value such that the first 8 bytes are composed of the little-endian
2098
+ * 64-bit data unit number, followed by 8 zero bytes.
2099
+ *
2100
+ * (Unfortunately, Chilkat cannot use 64-bit integers in method arguments because many older
2101
+ * programming environments, such as ActiveX, do not support it. Chilkat must present an identical
2102
+ * and uniform API across all programming languages.)
2103
+ */
2104
+ xtsSetDataUnitNumber(loUint32: number, hiUint32: number): void
2105
+
2106
+ /**
2107
+ * Sets the XTS-AES mode tweak key from an encoded string. The encoding argument can be set to any
2108
+ * of the following strings: `base64`, `hex`, `quoted-printable`, `ascii`, or `url`. The tweak key
2109
+ * should be equal in size to the encryption key. For example, to do 256-bit AES-XTS, the
2110
+ * encryption key is 256-bits, and the tweak key is also 256-bits.
2111
+ */
2112
+ xtsSetEncodedTweakKey(key: string, encoding: string): void
2113
+
2114
+ /**
2115
+ * Implements the `AES Key Wrap with Padding Algorithm` (RFC 5649). The `kek` is the `Key
2116
+ * Encryption Key` (the AES key used to encrypt the `keyData`). The arguments and return value are
2117
+ * binary encoded strings using the encoding specified by `encoding` (which can be `base64`,
2118
+ * `hex`, `base64url`, etc.)
2119
+ *
2120
+ * The `kek` should be an `AES key` of `16 bytes`, `24 bytes`, or `32 bytes` (i.e. 128-bits, 192-
2121
+ * bits, or 256-bits). For example, if passed as a hex string, then the `kek` should be 32 chars
2122
+ * in length, 48 chars, or 64 chars (because each byte is represented as 2 chars in hex).
2123
+ *
2124
+ * The `keyData` contains the data to be key wrapped.
2125
+ *
2126
+ * Returns the wrapped key using the encoding specified in `encoding`.
2127
+ *
2128
+ * @throws Error if the call fails (the message names the reason); the full log is in
2129
+ * {@link Crypt2.lastErrorText}.
2130
+ */
2131
+ aesKeyWrapWithPadding(kek: string, keyData: string, encoding: string): string
2132
+
2133
+ /**
2134
+ * Implements the `AES Key Wrap with Padding Algorithm` (RFC 5649) for unwrapping. The `kek` is
2135
+ * the `Key Encryption Key` (the AES key used to unwrap the `wrappedKeyData`). The arguments and
2136
+ * return value are binary encoded strings using the encoding specified by `encoding` (which can
2137
+ * be `base64`, `hex`, `base64url`, etc.)
2138
+ *
2139
+ * The `kek` should be an `AES key` of `16 bytes`, `24 bytes`, or `32 bytes` (i.e. 128-bits, 192-
2140
+ * bits, or 256-bits). For example, if passed as a hex string, then the `kek` should be 32 chars
2141
+ * in length, 48 chars, or 64 chars (because each byte is represented as 2 chars in hex).
2142
+ *
2143
+ * The `wrappedKeyData` contains the data to be unwrapped.
2144
+ *
2145
+ * The unwrapped key is returned as an encoded string (using the encoding specified in
2146
+ * `encoding`).
2147
+ *
2148
+ * @throws Error if the call fails (the message names the reason); the full log is in
2149
+ * {@link Crypt2.lastErrorText}.
2150
+ */
2151
+ aesKeyUnwrapWithPadding(kek: string, wrappedKeyData: string, encoding: string): string
2152
+
2153
+ /**
2154
+ * Offers details on the last method executed. While many methods provide no information, some do
2155
+ * through GetLastJsonData. For instance, after invoking a signature verification method,
2156
+ * GetLastJsonData will return JSON detailing the algorithms used.
2157
+ */
2158
+ getLastJsonData(json: JsonObject): void
2159
+
2160
+ /**
2161
+ * Returns in `cert` the last certificate used for public-key decryption.
2162
+ *
2163
+ * @throws Error if the call fails (the message names the reason); the full log is in
2164
+ * {@link Crypt2.lastErrorText}.
2165
+ */
2166
+ lastDecryptCert(cert: Cert): void
2167
+
2168
+ /**
2169
+ * Retrieves the Nth certificate used for signing in `cert`, where the first certificate is at
2170
+ * index 0. Use this method **after verifying a digital signature** to access the signer
2171
+ * certificates. The {@link Crypt2.numSignerCerts} property indicates the total number of signing
2172
+ * certificates. Usually, only one certificate is used when creating a digital signature.
2173
+ *
2174
+ * @throws Error if the call fails (the message names the reason); the full log is in
2175
+ * {@link Crypt2.lastErrorText}.
2176
+ */
2177
+ lastSignerCert(index: number, cert: Cert): void
2178
+
2179
+ /**
2180
+ * Adds a `PFX` file to the object's list of sources for locating certificates and private keys
2181
+ * during public-key decryption or signing. To add multiple PFX sources, call this method multiple
2182
+ * times. `bd` should contain the bytes of a PFX file (also known as `PKCS12` or `.p12`).
2183
+ *
2184
+ * **Note:** Information about the certificate(s) needed for `public-key decryption` are included
2185
+ * in the `PKCS#7 enveloped-data`. Chilkat will automatically find a usable certificate and
2186
+ * private key from sources like Windows certificate stores, the Apple keychain, or other sources
2187
+ * provided by the application.
2188
+ *
2189
+ * @throws Error if the call fails (the message names the reason); the full log is in
2190
+ * {@link Crypt2.lastErrorText}.
2191
+ */
2192
+ addPfxSourceBd(bd: BinData, password: string): void
2193
+
2194
+ /**
2195
+ * Computes a CRC for data contained in `crcAlg`, which can be either `crc-32` used in the Zip
2196
+ * file format, or `crc8` for the CRC8 algorithm.
2197
+ */
2198
+ crcBd(crcAlg: string, bd: BinData): number
2199
+
2200
+ /**
2201
+ * Start or continue hashing data in chunks. Set `firstChunk` to `true` for the first chunk, and
2202
+ * `false` for subsequent chunks. Finish by calling `HashFinalENC` to obtain the result. The hash
2203
+ * algorithm used is determined by the `HashAlgorithm` property.
2204
+ *
2205
+ * @throws Error if the call fails (the message names the reason); the full log is in
2206
+ * {@link Crypt2.lastErrorText}.
2207
+ */
2208
+ hashChunkBd(firstChunk: boolean, bd: BinData): void
2209
+
2210
+ /**
2211
+ * Derives a key from a password using **Argon2**, the memory-hard key derivation function
2212
+ * specified in RFC 9106. Argon2 is deliberately expensive in both CPU time and memory, which is
2213
+ * what makes a brute-force search of the password space costly.
2214
+ *
2215
+ * `password` is the password. `json` is a JSON string containing the Argon2 options (described
2216
+ * below). The derived key is returned in `bdKey`, which is cleared before the derived key is
2217
+ * stored in it.
2218
+ *
2219
+ * A `salt` member is **required** in `json`. There is no default, because a key derivation salt
2220
+ * is chosen and stored by the application. Use {@link Crypt2.genRandomBytesENC} to generate one.
2221
+ *
2222
+ * Every other member is optional. Passing an empty string for `json` is the same as passing `{}`
2223
+ * and would fail only because no salt was given.
2224
+ *
2225
+ * The JSON is validated strictly before it is used, so malformed JSON is rejected rather than
2226
+ * partially applied. It must be a single JSON object, and every member value must be a simple
2227
+ * value (string, number, `true`, `false` or `null`) -- no Argon2 member takes an object or an
2228
+ * array. Member names are matched exactly, and any member not listed below is an **error** rather
2229
+ * than something ignored. A member given twice, or a member given together with its short alias,
2230
+ * is also an error, because which one would win is ambiguous. All of this is deliberate. A
2231
+ * misspelled name such as `iteration`, a miscapitalized one such as `memoryCostKB`, or a single
2232
+ * missing comma would otherwise be discarded in silence and the default used in its place. For a
2233
+ * cost parameter that is a silent downgrade, and it produces a hash that looks perfectly valid,
2234
+ * so nothing downstream would catch it. The specific problem is reported in the `LastErrorText`.
2235
+ *
2236
+ * - `variant` - `argon2id` (the default), `argon2i`, or `argon2d`. Use `argon2id` unless there is
2237
+ * a specific reason not to: it combines Argon2i's resistance to side-channel attacks with
2238
+ * Argon2d's resistance to time-memory tradeoff attacks.
2239
+ *
2240
+ * - `version` - `19` (the default, 0x13) or `16` (0x10). Only set `16` to reproduce a hash made
2241
+ * by an old implementation.
2242
+ *
2243
+ * - `iterations` - the number of passes over memory, called `t` in RFC 9106. Must be at least 1.
2244
+ * Defaults to `3`.
2245
+ *
2246
+ * - `memoryCostKb` - the amount of memory used, in KB, called `m` in RFC 9106. Must be at least 8
2247
+ * times `parallelism`. Defaults to `65536` (64 MB). This is the parameter that does the most to
2248
+ * make an attack expensive.
2249
+ *
2250
+ * - `parallelism` - the number of lanes, called `p` in RFC 9106. Defaults to `1`. Changing it
2251
+ * changes the derived key. Chilkat computes all lanes on the calling thread, so raising it does
2252
+ * not make the computation faster.
2253
+ *
2254
+ * - `keyLen` - the length of the derived key in bytes. Must be between 4 and 1048576. Defaults to
2255
+ * `32`.
2256
+ *
2257
+ * - `salt` - the salt, which must be at least 8 bytes. 16 random bytes is the usual choice.
2258
+ *
2259
+ * - `secret` - the optional secret value `K` of RFC 9106, often called a `pepper`: a key held by
2260
+ * the application and **not** stored alongside the hash, so that a stolen database of hashes
2261
+ * cannot be attacked without it.
2262
+ *
2263
+ * - `ad` - the optional associated data `X` of RFC 9106: additional non-secret data bound into
2264
+ * the derivation.
2265
+ *
2266
+ * - `encoding` - how the `salt`, `secret` and `ad` members are encoded. Defaults to `base64`. May
2267
+ * be any encoding Chilkat supports, such as `hex`, or `utf-8` to use the characters of the
2268
+ * member itself as the bytes.
2269
+ *
2270
+ * - `saltEncoding`, `secretEncoding`, `adEncoding` - override `encoding` for one member.
2271
+ *
2272
+ * - `passwordCharset` - the character encoding the password is converted to before use. Defaults
2273
+ * to `utf-8`. If set to `hex` or `base64`, `password` is instead treated as encoded binary and
2274
+ * decoded, exactly as for the charset argument of {@link Crypt2.pbkdf2}.
2275
+ *
2276
+ * - `maxMemoryKb` - refuses to allocate more than this many KB. This is not an Argon2 parameter;
2277
+ * it is a guard so that an unreasonable `memoryCostKb` cannot exhaust memory. Defaults to
2278
+ * `2097152` (2 GB).
2279
+ *
2280
+ * The short names used in RFC 9106 and in PHC hash strings are accepted as aliases: `t` for
2281
+ * `iterations`, `m` for `memoryCostKb`, `p` for `parallelism`, and `v` for `version`. This means
2282
+ * the parameters of an existing hash string such as `$argon2id$v=19$m=65536,t=3,p=1$...` can be
2283
+ * transcribed directly.
2284
+ *
2285
+ * For example, to derive a 32-byte key:
2286
+ *
2287
+ * `{ "iterations": 3, "memoryCostKb": 65536, "parallelism": 1, "keyLen": 32, "salt":
2288
+ * "cmFuZG9tc2FsdDEyMzQ=" }`
2289
+ *
2290
+ * To hash a password for storage, use {@link Crypt2.argon2HashPassword} instead, which generates
2291
+ * a random salt and returns a self-describing string.
2292
+ *
2293
+ * @throws Error if the call fails (the message names the reason); the full log is in
2294
+ * {@link Crypt2.lastErrorText}.
2295
+ */
2296
+ argon2DeriveKey(password: string, json: string, bdKey: BinData): void
2297
+
2298
+ /**
2299
+ * Hashes a password using **Argon2** (RFC 9106) and returns the result as a PHC format string,
2300
+ * such as
2301
+ *
2302
+ * `$argon2id$v=19$m=65536,t=3,p=1$c29tZXJhbmRvbXNhbHQ$3fJ7v1qKcVJ0lHqXjBQZ8mYm3sNTfSPRt0bqDl9kEyM`
2303
+ *
2304
+ * The string records the variant, version, memory cost, iterations, parallelism, salt and hash,
2305
+ * so it is everything needed to verify the password later with {@link
2306
+ * Crypt2.argon2VerifyPassword}. Store the whole string.
2307
+ *
2308
+ * `password` is the password. `json` is a JSON string containing the Argon2 options, which are
2309
+ * the same members documented for {@link Crypt2.argon2DeriveKey}, with one difference: **the salt
2310
+ * is optional here**. As with all of the Argon2 methods, an unrecognized member name is an error.
2311
+ * When no `salt` member is present, a cryptographically random salt is generated for this hash,
2312
+ * which is what should normally happen. A `saltLen` member (default `16`, allowed range 8 to
2313
+ * 1024) sets how many random bytes to generate.
2314
+ *
2315
+ * Passing an empty string for `json` uses all defaults: Argon2id, version 19, 3 iterations, 64 MB
2316
+ * of memory, 1 lane, a 32-byte hash and a 16-byte random salt.
2317
+ *
2318
+ * Note that if a `secret` (pepper) or `ad` is used, it is **not** stored in the returned string.
2319
+ * The same value must be supplied to {@link Crypt2.argon2VerifyPassword} for the password to
2320
+ * verify.
2321
+ *
2322
+ * @throws Error if the call fails (the message names the reason); the full log is in
2323
+ * {@link Crypt2.lastErrorText}.
2324
+ */
2325
+ argon2HashPassword(password: string, json: string): string
2326
+
2327
+ /**
2328
+ * Verifies `password` against a PHC format Argon2 hash string previously produced by {@link
2329
+ * Crypt2.argon2HashPassword} (or by any other RFC 9106 implementation).
2330
+ *
2331
+ * Returns one of three values:
2332
+ *
2333
+ * - `1` - the password matched.
2334
+ *
2335
+ * - `0` - the password did not match.
2336
+ *
2337
+ * - `-1` - the verification could not be performed at all: `phcHash` was not a valid Argon2 hash
2338
+ * string, its parameters were out of range, or an internal failure occurred. The reason is
2339
+ * written to the `LastErrorText`.
2340
+ *
2341
+ * Test for a match with `== 1`, never for `!= 0`, so that an unusable hash string is not mistaken
2342
+ * for a successful login.
2343
+ *
2344
+ * The variant, version, memory cost, iterations, parallelism, salt and hash length are all read
2345
+ * from `phcHash`, so none of the Argon2 cost options need to be supplied. Pass an empty string
2346
+ * for `json` unless the hash was created with a `secret` (pepper) or `ad`, in which case `json`
2347
+ * must contain the same values that were used to create it. Only the `secret`, `ad`, `encoding`,
2348
+ * `passwordCharset` and `maxMemoryKb` members of `json` are used; everything else is ignored. The
2349
+ * other documented members are still accepted here, so that one JSON string can be shared between
2350
+ * hashing and verifying, but an unrecognized member name is an error.
2351
+ *
2352
+ * A return of `0` and a return of `-1` call for different handling. `0` is a normal failed login
2353
+ * attempt. `-1` means the stored hash itself is unusable, which is a data or configuration
2354
+ * problem rather than a bad password, and is worth logging or alerting on separately.
2355
+ *
2356
+ * The `maxMemoryKb` member is worth setting when the hash strings come from an untrusted source.
2357
+ * The memory cost is taken from `phcHash`, so a hash claiming an enormous `m` would otherwise
2358
+ * cause a very large allocation. It defaults to 2 GB and is checked before any memory is
2359
+ * allocated.
2360
+ */
2361
+ argon2VerifyPassword(password: string, json: string, phcHash: string): number
2362
+
2363
+ // ---- Events (ReactNativeGen_DESIGN.md §6) ----
2364
+
2365
+ /**
2366
+ * Called with the percent completed (0..100) while a long-running method runs, when Chilkat
2367
+ * can measure progress. Runs on the JavaScript thread, so it is only useful with the
2368
+ * `...Async` methods (during a synchronous call the thread is busy and the events arrive
2369
+ * after it returns). Assign `undefined` to remove.
2370
+ */
2371
+ onPercentDone?: (pctDone: number) => void
2372
+
2373
+ /**
2374
+ * Called with a name/value pair of progress information while a long-running method runs
2375
+ * (what is reported depends on the class and method). Runs on the JavaScript thread; see
2376
+ * {@link Crypt2.onPercentDone}. Assign `undefined` to remove.
2377
+ */
2378
+ onProgressInfo?: (name: string, value: string) => void
2379
+
2380
+ /**
2381
+ * Requests that the pending `...Async` call on this object stop at its next progress check.
2382
+ * The promise then rejects with Chilkat's abort error. Chilkat checks at least every
2383
+ * `heartbeatMs` milliseconds on the classes that have that property, so set it (e.g. 250)
2384
+ * for a responsive cancel. Harmless when nothing is pending.
2385
+ */
2386
+ abort(): void
2387
+ }