@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.
- package/CHANGELOG.md +6 -0
- package/ChilkatRN.podspec +44 -0
- package/LICENSE +254 -0
- package/README.md +67 -0
- package/android/CMakeLists.txt +60 -0
- package/android/build.gradle +148 -0
- package/android/gradle.properties +5 -0
- package/android/src/main/AndroidManifest.xml +2 -0
- package/android/src/main/cpp/cpp-adapter.cpp +12 -0
- package/android/src/main/java/com/margelo/nitro/chilkat/ChilkatRNPackage.java +33 -0
- package/chilkat-checksums.json +9 -0
- package/cpp/HybridAi.cpp +660 -0
- package/cpp/HybridAi.hpp +159 -0
- package/cpp/HybridAsn.cpp +403 -0
- package/cpp/HybridAsn.hpp +105 -0
- package/cpp/HybridAuthAws.cpp +188 -0
- package/cpp/HybridAuthAws.hpp +55 -0
- package/cpp/HybridAuthAzureSAS.cpp +142 -0
- package/cpp/HybridAuthAzureSAS.hpp +47 -0
- package/cpp/HybridAuthAzureStorage.cpp +144 -0
- package/cpp/HybridAuthAzureStorage.hpp +47 -0
- package/cpp/HybridAuthGoogle.cpp +215 -0
- package/cpp/HybridAuthGoogle.hpp +67 -0
- package/cpp/HybridBinData.cpp +439 -0
- package/cpp/HybridBinData.hpp +112 -0
- package/cpp/HybridBz2.cpp +177 -0
- package/cpp/HybridBz2.hpp +58 -0
- package/cpp/HybridCache.cpp +314 -0
- package/cpp/HybridCache.hpp +82 -0
- package/cpp/HybridCert.cpp +840 -0
- package/cpp/HybridCert.hpp +196 -0
- package/cpp/HybridCertChain.cpp +149 -0
- package/cpp/HybridCertChain.hpp +50 -0
- package/cpp/HybridCertStore.cpp +276 -0
- package/cpp/HybridCertStore.hpp +78 -0
- package/cpp/HybridCharset.cpp +333 -0
- package/cpp/HybridCharset.hpp +83 -0
- package/cpp/HybridCkDateTime.cpp +384 -0
- package/cpp/HybridCkDateTime.hpp +105 -0
- package/cpp/HybridCodeSign.cpp +156 -0
- package/cpp/HybridCodeSign.hpp +55 -0
- package/cpp/HybridCompression.cpp +422 -0
- package/cpp/HybridCompression.hpp +100 -0
- package/cpp/HybridCrypt2.cpp +1517 -0
- package/cpp/HybridCrypt2.hpp +320 -0
- package/cpp/HybridCsr.cpp +292 -0
- package/cpp/HybridCsr.hpp +77 -0
- package/cpp/HybridCsv.cpp +382 -0
- package/cpp/HybridCsv.hpp +101 -0
- package/cpp/HybridDh.cpp +137 -0
- package/cpp/HybridDh.hpp +47 -0
- package/cpp/HybridDirTree.cpp +167 -0
- package/cpp/HybridDirTree.hpp +53 -0
- package/cpp/HybridDkim.cpp +249 -0
- package/cpp/HybridDkim.hpp +74 -0
- package/cpp/HybridDns.cpp +193 -0
- package/cpp/HybridDns.hpp +64 -0
- package/cpp/HybridDsa.cpp +453 -0
- package/cpp/HybridDsa.hpp +112 -0
- package/cpp/HybridDtObj.cpp +172 -0
- package/cpp/HybridDtObj.hpp +57 -0
- package/cpp/HybridEcc.cpp +195 -0
- package/cpp/HybridEcc.hpp +55 -0
- package/cpp/HybridEdDSA.cpp +147 -0
- package/cpp/HybridEdDSA.hpp +47 -0
- package/cpp/HybridEmail.cpp +1911 -0
- package/cpp/HybridEmail.hpp +419 -0
- package/cpp/HybridEmailBundle.cpp +204 -0
- package/cpp/HybridEmailBundle.hpp +64 -0
- package/cpp/HybridFileAccess.cpp +631 -0
- package/cpp/HybridFileAccess.hpp +149 -0
- package/cpp/HybridFtp2.cpp +2308 -0
- package/cpp/HybridFtp2.hpp +462 -0
- package/cpp/HybridGlobal.cpp +221 -0
- package/cpp/HybridGlobal.hpp +68 -0
- package/cpp/HybridGzip.cpp +440 -0
- package/cpp/HybridGzip.hpp +105 -0
- package/cpp/HybridHashtable.cpp +211 -0
- package/cpp/HybridHashtable.hpp +64 -0
- package/cpp/HybridHtmlToText.cpp +136 -0
- package/cpp/HybridHtmlToText.hpp +47 -0
- package/cpp/HybridHtmlToXml.cpp +218 -0
- package/cpp/HybridHtmlToXml.hpp +65 -0
- package/cpp/HybridHttp.cpp +2067 -0
- package/cpp/HybridHttp.hpp +416 -0
- package/cpp/HybridHttpCurl.cpp +337 -0
- package/cpp/HybridHttpCurl.hpp +93 -0
- package/cpp/HybridHttpRequest.cpp +455 -0
- package/cpp/HybridHttpRequest.hpp +109 -0
- package/cpp/HybridHttpResponse.cpp +340 -0
- package/cpp/HybridHttpResponse.hpp +86 -0
- package/cpp/HybridImap.cpp +1818 -0
- package/cpp/HybridImap.hpp +363 -0
- package/cpp/HybridJavaKeyStore.cpp +387 -0
- package/cpp/HybridJavaKeyStore.hpp +98 -0
- package/cpp/HybridJs.cpp +154 -0
- package/cpp/HybridJs.hpp +54 -0
- package/cpp/HybridJsonArray.cpp +441 -0
- package/cpp/HybridJsonArray.hpp +120 -0
- package/cpp/HybridJsonObject.cpp +1125 -0
- package/cpp/HybridJsonObject.hpp +260 -0
- package/cpp/HybridJwe.cpp +294 -0
- package/cpp/HybridJwe.hpp +82 -0
- package/cpp/HybridJws.cpp +290 -0
- package/cpp/HybridJws.hpp +82 -0
- package/cpp/HybridJwt.cpp +198 -0
- package/cpp/HybridJwt.hpp +57 -0
- package/cpp/HybridLog.cpp +212 -0
- package/cpp/HybridLog.hpp +63 -0
- package/cpp/HybridMailMan.cpp +1853 -0
- package/cpp/HybridMailMan.hpp +386 -0
- package/cpp/HybridMailboxes.cpp +165 -0
- package/cpp/HybridMailboxes.hpp +54 -0
- package/cpp/HybridMcp.cpp +322 -0
- package/cpp/HybridMcp.hpp +85 -0
- package/cpp/HybridMessageSet.cpp +162 -0
- package/cpp/HybridMessageSet.hpp +54 -0
- package/cpp/HybridMht.cpp +700 -0
- package/cpp/HybridMht.hpp +165 -0
- package/cpp/HybridMime.cpp +1119 -0
- package/cpp/HybridMime.hpp +266 -0
- package/cpp/HybridNtlm.cpp +333 -0
- package/cpp/HybridNtlm.hpp +83 -0
- package/cpp/HybridOAuth1.cpp +307 -0
- package/cpp/HybridOAuth1.hpp +78 -0
- package/cpp/HybridOAuth2.cpp +515 -0
- package/cpp/HybridOAuth2.hpp +127 -0
- package/cpp/HybridPdf.cpp +370 -0
- package/cpp/HybridPdf.hpp +103 -0
- package/cpp/HybridPem.cpp +327 -0
- package/cpp/HybridPem.hpp +88 -0
- package/cpp/HybridPfx.cpp +343 -0
- package/cpp/HybridPfx.hpp +87 -0
- package/cpp/HybridPkcs11.cpp +318 -0
- package/cpp/HybridPkcs11.hpp +88 -0
- package/cpp/HybridPrivateKey.cpp +464 -0
- package/cpp/HybridPrivateKey.hpp +117 -0
- package/cpp/HybridPrng.cpp +192 -0
- package/cpp/HybridPrng.hpp +57 -0
- package/cpp/HybridPublicKey.cpp +238 -0
- package/cpp/HybridPublicKey.hpp +68 -0
- package/cpp/HybridRest.cpp +993 -0
- package/cpp/HybridRest.hpp +214 -0
- package/cpp/HybridRsa.cpp +348 -0
- package/cpp/HybridRsa.hpp +90 -0
- package/cpp/HybridSCard.cpp +328 -0
- package/cpp/HybridSCard.hpp +91 -0
- package/cpp/HybridSFtp.cpp +1889 -0
- package/cpp/HybridSFtp.hpp +366 -0
- package/cpp/HybridSFtpDir.cpp +119 -0
- package/cpp/HybridSFtpDir.hpp +43 -0
- package/cpp/HybridSFtpFile.cpp +203 -0
- package/cpp/HybridSFtpFile.hpp +60 -0
- package/cpp/HybridScMinidriver.cpp +341 -0
- package/cpp/HybridScMinidriver.hpp +88 -0
- package/cpp/HybridScp.cpp +398 -0
- package/cpp/HybridScp.hpp +96 -0
- package/cpp/HybridSecrets.cpp +328 -0
- package/cpp/HybridSecrets.hpp +84 -0
- package/cpp/HybridSecureString.cpp +175 -0
- package/cpp/HybridSecureString.hpp +55 -0
- package/cpp/HybridServerSentEvent.cpp +112 -0
- package/cpp/HybridServerSentEvent.hpp +41 -0
- package/cpp/HybridSocket.cpp +1567 -0
- package/cpp/HybridSocket.hpp +336 -0
- package/cpp/HybridSpider.cpp +543 -0
- package/cpp/HybridSpider.hpp +138 -0
- package/cpp/HybridSsh.cpp +1330 -0
- package/cpp/HybridSsh.hpp +282 -0
- package/cpp/HybridSshKey.cpp +310 -0
- package/cpp/HybridSshKey.hpp +83 -0
- package/cpp/HybridSshTunnel.cpp +687 -0
- package/cpp/HybridSshTunnel.hpp +159 -0
- package/cpp/HybridStream.cpp +496 -0
- package/cpp/HybridStream.hpp +123 -0
- package/cpp/HybridStringArray.cpp +368 -0
- package/cpp/HybridStringArray.hpp +99 -0
- package/cpp/HybridStringBuilder.cpp +739 -0
- package/cpp/HybridStringBuilder.hpp +178 -0
- package/cpp/HybridStringTable.cpp +218 -0
- package/cpp/HybridStringTable.hpp +66 -0
- package/cpp/HybridTar.cpp +547 -0
- package/cpp/HybridTar.hpp +134 -0
- package/cpp/HybridTrustedRoots.cpp +178 -0
- package/cpp/HybridTrustedRoots.hpp +61 -0
- package/cpp/HybridUnixCompress.cpp +191 -0
- package/cpp/HybridUnixCompress.hpp +60 -0
- package/cpp/HybridUpload.cpp +427 -0
- package/cpp/HybridUpload.hpp +114 -0
- package/cpp/HybridUrl.cpp +152 -0
- package/cpp/HybridUrl.hpp +48 -0
- package/cpp/HybridWebSocket.cpp +378 -0
- package/cpp/HybridWebSocket.hpp +103 -0
- package/cpp/HybridXml.cpp +1527 -0
- package/cpp/HybridXml.hpp +340 -0
- package/cpp/HybridXmlCertVault.cpp +215 -0
- package/cpp/HybridXmlCertVault.hpp +63 -0
- package/cpp/HybridXmlDSig.cpp +328 -0
- package/cpp/HybridXmlDSig.hpp +88 -0
- package/cpp/HybridXmlDSigGen.cpp +549 -0
- package/cpp/HybridXmlDSigGen.hpp +126 -0
- package/cpp/HybridXmp.cpp +329 -0
- package/cpp/HybridXmp.hpp +86 -0
- package/cpp/HybridZip.cpp +1000 -0
- package/cpp/HybridZip.hpp +226 -0
- package/cpp/HybridZipCrc.cpp +162 -0
- package/cpp/HybridZipCrc.hpp +57 -0
- package/cpp/HybridZipEntry.cpp +395 -0
- package/cpp/HybridZipEntry.hpp +102 -0
- package/cpp/runtime/AsyncCall.hpp +96 -0
- package/cpp/runtime/Bytes.hpp +49 -0
- package/cpp/runtime/ChilkatError.hpp +66 -0
- package/cpp/runtime/ChilkatObject.hpp +219 -0
- package/cpp/runtime/ProgLang.hpp +9 -0
- package/cpp/runtime/ProgressAdapter.hpp +43 -0
- package/nitro.json +113 -0
- package/nitrogen/generated/.gitattributes +1 -0
- package/nitrogen/generated/android/ChilkatRN+autolinking.cmake +179 -0
- package/nitrogen/generated/android/ChilkatRN+autolinking.gradle +27 -0
- package/nitrogen/generated/android/ChilkatRNOnLoad.cpp +1029 -0
- package/nitrogen/generated/android/ChilkatRNOnLoad.hpp +34 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/chilkat/ChilkatRNOnLoad.kt +35 -0
- package/nitrogen/generated/ios/ChilkatRN+autolinking.rb +62 -0
- package/nitrogen/generated/ios/ChilkatRN-Swift-Cxx-Bridge.cpp +17 -0
- package/nitrogen/generated/ios/ChilkatRN-Swift-Cxx-Bridge.hpp +27 -0
- package/nitrogen/generated/ios/ChilkatRN-Swift-Cxx-Umbrella.hpp +38 -0
- package/nitrogen/generated/ios/ChilkatRNAutolinking.mm +1015 -0
- package/nitrogen/generated/ios/ChilkatRNAutolinking.swift +16 -0
- package/nitrogen/generated/shared/c++/HybridAiSpec.cpp +114 -0
- package/nitrogen/generated/shared/c++/HybridAiSpec.hpp +175 -0
- package/nitrogen/generated/shared/c++/HybridAsnSpec.cpp +70 -0
- package/nitrogen/generated/shared/c++/HybridAsnSpec.hpp +116 -0
- package/nitrogen/generated/shared/c++/HybridAuthAwsSpec.cpp +49 -0
- package/nitrogen/generated/shared/c++/HybridAuthAwsSpec.hpp +89 -0
- package/nitrogen/generated/shared/c++/HybridAuthAzureSASSpec.cpp +38 -0
- package/nitrogen/generated/shared/c++/HybridAuthAzureSASSpec.hpp +78 -0
- package/nitrogen/generated/shared/c++/HybridAuthAzureStorageSpec.cpp +41 -0
- package/nitrogen/generated/shared/c++/HybridAuthAzureStorageSpec.hpp +81 -0
- package/nitrogen/generated/shared/c++/HybridAuthGoogleSpec.cpp +56 -0
- package/nitrogen/generated/shared/c++/HybridAuthGoogleSpec.hpp +108 -0
- package/nitrogen/generated/shared/c++/HybridBinDataSpec.cpp +69 -0
- package/nitrogen/generated/shared/c++/HybridBinDataSpec.hpp +116 -0
- package/nitrogen/generated/shared/c++/HybridBz2Spec.cpp +47 -0
- package/nitrogen/generated/shared/c++/HybridBz2Spec.hpp +93 -0
- package/nitrogen/generated/shared/c++/HybridCacheSpec.cpp +57 -0
- package/nitrogen/generated/shared/c++/HybridCacheSpec.hpp +106 -0
- package/nitrogen/generated/shared/c++/HybridCertChainSpec.cpp +40 -0
- package/nitrogen/generated/shared/c++/HybridCertChainSpec.hpp +89 -0
- package/nitrogen/generated/shared/c++/HybridCertSpec.cpp +138 -0
- package/nitrogen/generated/shared/c++/HybridCertSpec.hpp +205 -0
- package/nitrogen/generated/shared/c++/HybridCertStoreSpec.cpp +55 -0
- package/nitrogen/generated/shared/c++/HybridCertStoreSpec.hpp +104 -0
- package/nitrogen/generated/shared/c++/HybridCharsetSpec.cpp +61 -0
- package/nitrogen/generated/shared/c++/HybridCharsetSpec.hpp +101 -0
- package/nitrogen/generated/shared/c++/HybridCkDateTimeSpec.cpp +66 -0
- package/nitrogen/generated/shared/c++/HybridCkDateTimeSpec.hpp +115 -0
- package/nitrogen/generated/shared/c++/HybridCodeSignSpec.cpp +44 -0
- package/nitrogen/generated/shared/c++/HybridCodeSignSpec.hpp +93 -0
- package/nitrogen/generated/shared/c++/HybridCompressionSpec.cpp +79 -0
- package/nitrogen/generated/shared/c++/HybridCompressionSpec.hpp +134 -0
- package/nitrogen/generated/shared/c++/HybridCrypt2Spec.cpp +215 -0
- package/nitrogen/generated/shared/c++/HybridCrypt2Spec.hpp +283 -0
- package/nitrogen/generated/shared/c++/HybridCsrSpec.cpp +61 -0
- package/nitrogen/generated/shared/c++/HybridCsrSpec.hpp +116 -0
- package/nitrogen/generated/shared/c++/HybridCsvSpec.cpp +72 -0
- package/nitrogen/generated/shared/c++/HybridCsvSpec.hpp +121 -0
- package/nitrogen/generated/shared/c++/HybridDhSpec.cpp +37 -0
- package/nitrogen/generated/shared/c++/HybridDhSpec.hpp +77 -0
- package/nitrogen/generated/shared/c++/HybridDirTreeSpec.cpp +46 -0
- package/nitrogen/generated/shared/c++/HybridDirTreeSpec.hpp +86 -0
- package/nitrogen/generated/shared/c++/HybridDkimSpec.cpp +60 -0
- package/nitrogen/generated/shared/c++/HybridDkimSpec.hpp +109 -0
- package/nitrogen/generated/shared/c++/HybridDnsSpec.cpp +51 -0
- package/nitrogen/generated/shared/c++/HybridDnsSpec.hpp +97 -0
- package/nitrogen/generated/shared/c++/HybridDsaSpec.cpp +73 -0
- package/nitrogen/generated/shared/c++/HybridDsaSpec.hpp +116 -0
- package/nitrogen/generated/shared/c++/HybridDtObjSpec.cpp +50 -0
- package/nitrogen/generated/shared/c++/HybridDtObjSpec.hpp +90 -0
- package/nitrogen/generated/shared/c++/HybridEccSpec.cpp +41 -0
- package/nitrogen/generated/shared/c++/HybridEccSpec.hpp +96 -0
- package/nitrogen/generated/shared/c++/HybridEdDSASpec.cpp +38 -0
- package/nitrogen/generated/shared/c++/HybridEdDSASpec.hpp +90 -0
- package/nitrogen/generated/shared/c++/HybridEmailBundleSpec.cpp +45 -0
- package/nitrogen/generated/shared/c++/HybridEmailBundleSpec.hpp +91 -0
- package/nitrogen/generated/shared/c++/HybridEmailSpec.cpp +259 -0
- package/nitrogen/generated/shared/c++/HybridEmailSpec.hpp +326 -0
- package/nitrogen/generated/shared/c++/HybridFileAccessSpec.cpp +90 -0
- package/nitrogen/generated/shared/c++/HybridFileAccessSpec.hpp +140 -0
- package/nitrogen/generated/shared/c++/HybridFtp2Spec.cpp +367 -0
- package/nitrogen/generated/shared/c++/HybridFtp2Spec.hpp +434 -0
- package/nitrogen/generated/shared/c++/HybridGlobalSpec.cpp +59 -0
- package/nitrogen/generated/shared/c++/HybridGlobalSpec.hpp +99 -0
- package/nitrogen/generated/shared/c++/HybridGzipSpec.cpp +79 -0
- package/nitrogen/generated/shared/c++/HybridGzipSpec.hpp +134 -0
- package/nitrogen/generated/shared/c++/HybridHashtableSpec.cpp +45 -0
- package/nitrogen/generated/shared/c++/HybridHashtableSpec.hpp +91 -0
- package/nitrogen/generated/shared/c++/HybridHtmlToTextSpec.cpp +40 -0
- package/nitrogen/generated/shared/c++/HybridHtmlToTextSpec.hpp +83 -0
- package/nitrogen/generated/shared/c++/HybridHtmlToXmlSpec.cpp +49 -0
- package/nitrogen/generated/shared/c++/HybridHtmlToXmlSpec.hpp +95 -0
- package/nitrogen/generated/shared/c++/HybridHttpCurlSpec.cpp +67 -0
- package/nitrogen/generated/shared/c++/HybridHttpCurlSpec.hpp +125 -0
- package/nitrogen/generated/shared/c++/HybridHttpRequestSpec.cpp +76 -0
- package/nitrogen/generated/shared/c++/HybridHttpRequestSpec.hpp +122 -0
- package/nitrogen/generated/shared/c++/HybridHttpResponseSpec.cpp +64 -0
- package/nitrogen/generated/shared/c++/HybridHttpResponseSpec.hpp +119 -0
- package/nitrogen/generated/shared/c++/HybridHttpSpec.cpp +334 -0
- package/nitrogen/generated/shared/c++/HybridHttpSpec.hpp +407 -0
- package/nitrogen/generated/shared/c++/HybridImapSpec.cpp +275 -0
- package/nitrogen/generated/shared/c++/HybridImapSpec.hpp +360 -0
- package/nitrogen/generated/shared/c++/HybridJavaKeyStoreSpec.cpp +65 -0
- package/nitrogen/generated/shared/c++/HybridJavaKeyStoreSpec.hpp +132 -0
- package/nitrogen/generated/shared/c++/HybridJsSpec.cpp +43 -0
- package/nitrogen/generated/shared/c++/HybridJsSpec.hpp +92 -0
- package/nitrogen/generated/shared/c++/HybridJsonArraySpec.cpp +76 -0
- package/nitrogen/generated/shared/c++/HybridJsonArraySpec.hpp +131 -0
- package/nitrogen/generated/shared/c++/HybridJsonObjectSpec.cpp +154 -0
- package/nitrogen/generated/shared/c++/HybridJsonObjectSpec.hpp +218 -0
- package/nitrogen/generated/shared/c++/HybridJweSpec.cpp +57 -0
- package/nitrogen/generated/shared/c++/HybridJweSpec.hpp +112 -0
- package/nitrogen/generated/shared/c++/HybridJwsSpec.cpp +57 -0
- package/nitrogen/generated/shared/c++/HybridJwsSpec.hpp +115 -0
- package/nitrogen/generated/shared/c++/HybridJwtSpec.cpp +43 -0
- package/nitrogen/generated/shared/c++/HybridJwtSpec.hpp +92 -0
- package/nitrogen/generated/shared/c++/HybridLogSpec.cpp +44 -0
- package/nitrogen/generated/shared/c++/HybridLogSpec.hpp +85 -0
- package/nitrogen/generated/shared/c++/HybridMailManSpec.cpp +311 -0
- package/nitrogen/generated/shared/c++/HybridMailManSpec.hpp +396 -0
- package/nitrogen/generated/shared/c++/HybridMailboxesSpec.cpp +40 -0
- package/nitrogen/generated/shared/c++/HybridMailboxesSpec.hpp +80 -0
- package/nitrogen/generated/shared/c++/HybridMcpSpec.cpp +68 -0
- package/nitrogen/generated/shared/c++/HybridMcpSpec.hpp +117 -0
- package/nitrogen/generated/shared/c++/HybridMessageSetSpec.cpp +41 -0
- package/nitrogen/generated/shared/c++/HybridMessageSetSpec.hpp +84 -0
- package/nitrogen/generated/shared/c++/HybridMhtSpec.cpp +138 -0
- package/nitrogen/generated/shared/c++/HybridMhtSpec.hpp +181 -0
- package/nitrogen/generated/shared/c++/HybridMimeSpec.cpp +169 -0
- package/nitrogen/generated/shared/c++/HybridMimeSpec.hpp +233 -0
- package/nitrogen/generated/shared/c++/HybridNtlmSpec.cpp +69 -0
- package/nitrogen/generated/shared/c++/HybridNtlmSpec.hpp +109 -0
- package/nitrogen/generated/shared/c++/HybridOAuth1Spec.cpp +67 -0
- package/nitrogen/generated/shared/c++/HybridOAuth1Spec.hpp +110 -0
- package/nitrogen/generated/shared/c++/HybridOAuth2Spec.cpp +107 -0
- package/nitrogen/generated/shared/c++/HybridOAuth2Spec.hpp +156 -0
- package/nitrogen/generated/shared/c++/HybridPdfSpec.cpp +73 -0
- package/nitrogen/generated/shared/c++/HybridPdfSpec.hpp +134 -0
- package/nitrogen/generated/shared/c++/HybridPemSpec.cpp +63 -0
- package/nitrogen/generated/shared/c++/HybridPemSpec.hpp +124 -0
- package/nitrogen/generated/shared/c++/HybridPfxSpec.cpp +61 -0
- package/nitrogen/generated/shared/c++/HybridPfxSpec.hpp +122 -0
- package/nitrogen/generated/shared/c++/HybridPkcs11Spec.cpp +60 -0
- package/nitrogen/generated/shared/c++/HybridPkcs11Spec.hpp +115 -0
- package/nitrogen/generated/shared/c++/HybridPrivateKeySpec.cpp +76 -0
- package/nitrogen/generated/shared/c++/HybridPrivateKeySpec.hpp +131 -0
- package/nitrogen/generated/shared/c++/HybridPrngSpec.cpp +42 -0
- package/nitrogen/generated/shared/c++/HybridPrngSpec.hpp +85 -0
- package/nitrogen/generated/shared/c++/HybridPublicKeySpec.cpp +48 -0
- package/nitrogen/generated/shared/c++/HybridPublicKeySpec.hpp +91 -0
- package/nitrogen/generated/shared/c++/HybridRestSpec.cpp +150 -0
- package/nitrogen/generated/shared/c++/HybridRestSpec.hpp +229 -0
- package/nitrogen/generated/shared/c++/HybridRsaSpec.cpp +68 -0
- package/nitrogen/generated/shared/c++/HybridRsaSpec.hpp +120 -0
- package/nitrogen/generated/shared/c++/HybridSCardSpec.cpp +64 -0
- package/nitrogen/generated/shared/c++/HybridSCardSpec.hpp +116 -0
- package/nitrogen/generated/shared/c++/HybridSFtpDirSpec.cpp +35 -0
- package/nitrogen/generated/shared/c++/HybridSFtpDirSpec.hpp +78 -0
- package/nitrogen/generated/shared/c++/HybridSFtpFileSpec.cpp +57 -0
- package/nitrogen/generated/shared/c++/HybridSFtpFileSpec.hpp +98 -0
- package/nitrogen/generated/shared/c++/HybridSFtpSpec.cpp +284 -0
- package/nitrogen/generated/shared/c++/HybridSFtpSpec.hpp +354 -0
- package/nitrogen/generated/shared/c++/HybridScMinidriverSpec.cpp +61 -0
- package/nitrogen/generated/shared/c++/HybridScMinidriverSpec.hpp +119 -0
- package/nitrogen/generated/shared/c++/HybridScpSpec.cpp +78 -0
- package/nitrogen/generated/shared/c++/HybridScpSpec.hpp +127 -0
- package/nitrogen/generated/shared/c++/HybridSecretsSpec.cpp +65 -0
- package/nitrogen/generated/shared/c++/HybridSecretsSpec.hpp +120 -0
- package/nitrogen/generated/shared/c++/HybridSecureStringSpec.cpp +42 -0
- package/nitrogen/generated/shared/c++/HybridSecureStringSpec.hpp +88 -0
- package/nitrogen/generated/shared/c++/HybridServerSentEventSpec.cpp +35 -0
- package/nitrogen/generated/shared/c++/HybridServerSentEventSpec.hpp +75 -0
- package/nitrogen/generated/shared/c++/HybridSocketSpec.cpp +262 -0
- package/nitrogen/generated/shared/c++/HybridSocketSpec.hpp +327 -0
- package/nitrogen/generated/shared/c++/HybridSpiderSpec.cpp +110 -0
- package/nitrogen/generated/shared/c++/HybridSpiderSpec.hpp +153 -0
- package/nitrogen/generated/shared/c++/HybridSshKeySpec.cpp +59 -0
- package/nitrogen/generated/shared/c++/HybridSshKeySpec.hpp +102 -0
- package/nitrogen/generated/shared/c++/HybridSshSpec.cpp +215 -0
- package/nitrogen/generated/shared/c++/HybridSshSpec.hpp +276 -0
- package/nitrogen/generated/shared/c++/HybridSshTunnelSpec.cpp +136 -0
- package/nitrogen/generated/shared/c++/HybridSshTunnelSpec.hpp +191 -0
- package/nitrogen/generated/shared/c++/HybridStreamSpec.cpp +100 -0
- package/nitrogen/generated/shared/c++/HybridStreamSpec.hpp +150 -0
- package/nitrogen/generated/shared/c++/HybridStringArraySpec.cpp +66 -0
- package/nitrogen/generated/shared/c++/HybridStringArraySpec.hpp +109 -0
- package/nitrogen/generated/shared/c++/HybridStringBuilderSpec.cpp +104 -0
- package/nitrogen/generated/shared/c++/HybridStringBuilderSpec.hpp +156 -0
- package/nitrogen/generated/shared/c++/HybridStringTableSpec.cpp +46 -0
- package/nitrogen/generated/shared/c++/HybridStringTableSpec.hpp +89 -0
- package/nitrogen/generated/shared/c++/HybridTarSpec.cpp +110 -0
- package/nitrogen/generated/shared/c++/HybridTarSpec.hpp +156 -0
- package/nitrogen/generated/shared/c++/HybridTrustedRootsSpec.cpp +48 -0
- package/nitrogen/generated/shared/c++/HybridTrustedRootsSpec.hpp +97 -0
- package/nitrogen/generated/shared/c++/HybridUnixCompressSpec.cpp +48 -0
- package/nitrogen/generated/shared/c++/HybridUnixCompressSpec.hpp +91 -0
- package/nitrogen/generated/shared/c++/HybridUploadSpec.cpp +98 -0
- package/nitrogen/generated/shared/c++/HybridUploadSpec.hpp +141 -0
- package/nitrogen/generated/shared/c++/HybridUrlSpec.cpp +42 -0
- package/nitrogen/generated/shared/c++/HybridUrlSpec.hpp +82 -0
- package/nitrogen/generated/shared/c++/HybridWebSocketSpec.cpp +80 -0
- package/nitrogen/generated/shared/c++/HybridWebSocketSpec.hpp +135 -0
- package/nitrogen/generated/shared/c++/HybridXmlCertVaultSpec.cpp +45 -0
- package/nitrogen/generated/shared/c++/HybridXmlCertVaultSpec.hpp +94 -0
- package/nitrogen/generated/shared/c++/HybridXmlDSigGenSpec.cpp +99 -0
- package/nitrogen/generated/shared/c++/HybridXmlDSigGenSpec.hpp +163 -0
- package/nitrogen/generated/shared/c++/HybridXmlDSigSpec.cpp +62 -0
- package/nitrogen/generated/shared/c++/HybridXmlDSigSpec.hpp +126 -0
- package/nitrogen/generated/shared/c++/HybridXmlSpec.cpp +203 -0
- package/nitrogen/generated/shared/c++/HybridXmlSpec.hpp +253 -0
- package/nitrogen/generated/shared/c++/HybridXmpSpec.cpp +58 -0
- package/nitrogen/generated/shared/c++/HybridXmpSpec.hpp +104 -0
- package/nitrogen/generated/shared/c++/HybridZipCrcSpec.cpp +43 -0
- package/nitrogen/generated/shared/c++/HybridZipCrcSpec.hpp +92 -0
- package/nitrogen/generated/shared/c++/HybridZipEntrySpec.cpp +82 -0
- package/nitrogen/generated/shared/c++/HybridZipEntrySpec.hpp +137 -0
- package/nitrogen/generated/shared/c++/HybridZipSpec.cpp +176 -0
- package/nitrogen/generated/shared/c++/HybridZipSpec.hpp +231 -0
- package/package.json +46 -0
- package/react-native.config.js +9 -0
- package/scripts/fetch-chilkat.js +184 -0
- package/src/index.ts +306 -0
- package/src/runtime/chilkat.ts +25 -0
- package/src/specs/Ai.nitro.ts +1288 -0
- package/src/specs/Asn.nitro.ts +509 -0
- package/src/specs/AuthAws.nitro.ts +234 -0
- package/src/specs/AuthAzureSAS.nitro.ts +205 -0
- package/src/specs/AuthAzureStorage.nitro.ts +172 -0
- package/src/specs/AuthGoogle.nitro.ts +291 -0
- package/src/specs/BinData.nitro.ts +470 -0
- package/src/specs/Bz2.nitro.ts +269 -0
- package/src/specs/Cache.nitro.ts +483 -0
- package/src/specs/Cert.nitro.ts +1279 -0
- package/src/specs/CertChain.nitro.ts +312 -0
- package/src/specs/CertStore.nitro.ts +430 -0
- package/src/specs/Charset.nitro.ts +518 -0
- package/src/specs/CkDateTime.nitro.ts +492 -0
- package/src/specs/CodeSign.nitro.ts +307 -0
- package/src/specs/Compression.nitro.ts +654 -0
- package/src/specs/Crypt2.nitro.ts +2387 -0
- package/src/specs/Csr.nitro.ts +461 -0
- package/src/specs/Csv.nitro.ts +670 -0
- package/src/specs/Dh.nitro.ts +343 -0
- package/src/specs/DirTree.nitro.ts +332 -0
- package/src/specs/Dkim.nitro.ts +595 -0
- package/src/specs/Dns.nitro.ts +271 -0
- package/src/specs/Dsa.nitro.ts +653 -0
- package/src/specs/DtObj.nitro.ts +198 -0
- package/src/specs/Ecc.nitro.ts +375 -0
- package/src/specs/EdDSA.nitro.ts +273 -0
- package/src/specs/Email.nitro.ts +2921 -0
- package/src/specs/EmailBundle.nitro.ts +334 -0
- package/src/specs/FileAccess.nitro.ts +836 -0
- package/src/specs/Ftp2.nitro.ts +3943 -0
- package/src/specs/Global.nitro.ts +319 -0
- package/src/specs/Gzip.nitro.ts +646 -0
- package/src/specs/Hashtable.nitro.ts +356 -0
- package/src/specs/HtmlToText.nitro.ts +238 -0
- package/src/specs/HtmlToXml.nitro.ts +323 -0
- package/src/specs/Http.nitro.ts +3095 -0
- package/src/specs/HttpCurl.nitro.ts +550 -0
- package/src/specs/HttpRequest.nitro.ts +522 -0
- package/src/specs/HttpResponse.nitro.ts +424 -0
- package/src/specs/Imap.nitro.ts +2991 -0
- package/src/specs/JavaKeyStore.nitro.ts +619 -0
- package/src/specs/Js.nitro.ts +263 -0
- package/src/specs/JsonArray.nitro.ts +681 -0
- package/src/specs/JsonObject.nitro.ts +1454 -0
- package/src/specs/Jwe.nitro.ts +756 -0
- package/src/specs/Jws.nitro.ts +733 -0
- package/src/specs/Jwt.nitro.ts +380 -0
- package/src/specs/Log.nitro.ts +258 -0
- package/src/specs/MailMan.nitro.ts +3571 -0
- package/src/specs/Mailboxes.nitro.ts +251 -0
- package/src/specs/Mcp.nitro.ts +491 -0
- package/src/specs/MessageSet.nitro.ts +320 -0
- package/src/specs/Mht.nitro.ts +1684 -0
- package/src/specs/Mime.nitro.ts +1745 -0
- package/src/specs/Ntlm.nitro.ts +556 -0
- package/src/specs/OAuth1.nitro.ts +331 -0
- package/src/specs/OAuth2.nitro.ts +1023 -0
- package/src/specs/Pdf.nitro.ts +740 -0
- package/src/specs/Pem.nitro.ts +484 -0
- package/src/specs/Pfx.nitro.ts +1003 -0
- package/src/specs/Pkcs11.nitro.ts +559 -0
- package/src/specs/PrivateKey.nitro.ts +994 -0
- package/src/specs/Prng.nitro.ts +348 -0
- package/src/specs/PublicKey.nitro.ts +610 -0
- package/src/specs/Rest.nitro.ts +1972 -0
- package/src/specs/Rsa.nitro.ts +453 -0
- package/src/specs/SCard.nitro.ts +739 -0
- package/src/specs/SFtp.nitro.ts +3138 -0
- package/src/specs/SFtpDir.nitro.ts +213 -0
- package/src/specs/SFtpFile.nitro.ts +452 -0
- package/src/specs/ScMinidriver.nitro.ts +443 -0
- package/src/specs/Scp.nitro.ts +708 -0
- package/src/specs/Secrets.nitro.ts +470 -0
- package/src/specs/SecureString.nitro.ts +231 -0
- package/src/specs/ServerSentEvent.nitro.ts +183 -0
- package/src/specs/Socket.nitro.ts +3335 -0
- package/src/specs/Spider.nitro.ts +609 -0
- package/src/specs/Ssh.nitro.ts +2842 -0
- package/src/specs/SshKey.nitro.ts +740 -0
- package/src/specs/SshTunnel.nitro.ts +1243 -0
- package/src/specs/Stream.nitro.ts +737 -0
- package/src/specs/StringArray.nitro.ts +396 -0
- package/src/specs/StringBuilder.nitro.ts +920 -0
- package/src/specs/StringTable.nitro.ts +271 -0
- package/src/specs/Tar.nitro.ts +804 -0
- package/src/specs/TrustedRoots.nitro.ts +360 -0
- package/src/specs/UnixCompress.nitro.ts +293 -0
- package/src/specs/Upload.nitro.ts +623 -0
- package/src/specs/Url.nitro.ts +246 -0
- package/src/specs/WebSocket.nitro.ts +840 -0
- package/src/specs/Xml.nitro.ts +1988 -0
- package/src/specs/XmlCertVault.nitro.ts +259 -0
- package/src/specs/XmlDSig.nitro.ts +464 -0
- package/src/specs/XmlDSigGen.nitro.ts +978 -0
- package/src/specs/Xmp.nitro.ts +364 -0
- package/src/specs/Zip.nitro.ts +1611 -0
- package/src/specs/ZipCrc.nitro.ts +229 -0
- package/src/specs/ZipEntry.nitro.ts +782 -0
|
@@ -0,0 +1,1003 @@
|
|
|
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 { CertChain } from './CertChain.nitro'
|
|
6
|
+
import type { JavaKeyStore } from './JavaKeyStore.nitro'
|
|
7
|
+
import type { JsonObject } from './JsonObject.nitro'
|
|
8
|
+
import type { PrivateKey } from './PrivateKey.nitro'
|
|
9
|
+
import type { XmlCertVault } from './XmlCertVault.nitro'
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Load, inspect, build, export, convert, and import PFX / PKCS#12 containers.
|
|
13
|
+
*
|
|
14
|
+
* `Pfx` is the Chilkat class for working with
|
|
15
|
+
* PFX / PKCS#12 containers, which commonly hold certificates together with
|
|
16
|
+
* their associated private keys and certificate chains. It can load
|
|
17
|
+
* certificate/private-key bundles from files, memory, encoded data,
|
|
18
|
+
* `BinData`, or PEM; add certificates and private keys; inspect
|
|
19
|
+
* contained certificates and keys; manage safe-bag attributes; export to PFX,
|
|
20
|
+
* PEM, encoded strings, binary data, files, or Java KeyStore format; and import
|
|
21
|
+
* contents into Windows or macOS/iOS key stores.
|
|
22
|
+
*
|
|
23
|
+
* **Load PFX / PKCS#12 data**
|
|
24
|
+
*
|
|
25
|
+
* Load password-protected certificate and private-key bundles from files,
|
|
26
|
+
* memory, encoded strings, `BinData`, or PEM input.
|
|
27
|
+
*
|
|
28
|
+
* **Inspect certificates and keys**
|
|
29
|
+
*
|
|
30
|
+
* Enumerate contained certificates, private keys, and certificate chains to
|
|
31
|
+
* locate the identity or trust material needed by the application.
|
|
32
|
+
*
|
|
33
|
+
* **Build PFX containers**
|
|
34
|
+
*
|
|
35
|
+
* Add certificates and private keys to create a PKCS#12 bundle for TLS,
|
|
36
|
+
* S/MIME, signing, authentication, or platform import workflows.
|
|
37
|
+
*
|
|
38
|
+
* **Safe-bag attributes**
|
|
39
|
+
*
|
|
40
|
+
* Read and manage PKCS#12 safe-bag attributes such as friendly names or
|
|
41
|
+
* local key identifiers when interoperability requires them.
|
|
42
|
+
*
|
|
43
|
+
* **Export and convert**
|
|
44
|
+
*
|
|
45
|
+
* Export PFX content as binary data, encoded text, files, PEM, or Java
|
|
46
|
+
* KeyStore format depending on the target system.
|
|
47
|
+
*
|
|
48
|
+
* **Import to key stores**
|
|
49
|
+
*
|
|
50
|
+
* Import certificates and private keys into Windows certificate stores or
|
|
51
|
+
* macOS/iOS keychains when platform-backed access is required.
|
|
52
|
+
*
|
|
53
|
+
* **Common pattern:**
|
|
54
|
+
* Use `Pfx` when certificate material includes private keys packaged
|
|
55
|
+
* in a PKCS#12 container. Load the PFX with its password, inspect or retrieve
|
|
56
|
+
* the needed certificate and private key, then export, convert, or import the
|
|
57
|
+
* contents into the format or platform store required by the application. Use
|
|
58
|
+
* `Chilkat.Cert` and `PrivateKey` when working directly
|
|
59
|
+
* with individual certificate or key objects.
|
|
60
|
+
*
|
|
61
|
+
* For an extended overview, see
|
|
62
|
+
* [Pfx Class Overview](https://www.chilkatsoft.com/pfx_class_overview.asp).
|
|
63
|
+
*
|
|
64
|
+
* Each `Pfx` instance owns a native Chilkat object. It is released when the JavaScript object is
|
|
65
|
+
* garbage collected, or immediately by `dispose()`; any use after `dispose()` throws.
|
|
66
|
+
* Create one with `new Pfx()`.
|
|
67
|
+
*/
|
|
68
|
+
export interface Pfx extends HybridObject<{ ios: 'c++', android: 'c++' }> {
|
|
69
|
+
// ---- Properties ----
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Provides HTML-formatted information about the last called method or property. If a method call
|
|
73
|
+
* fails or behaves unexpectedly, check this property for details. Note that information is
|
|
74
|
+
* available regardless of the method call's success.
|
|
75
|
+
*
|
|
76
|
+
* This property is read-only.
|
|
77
|
+
*/
|
|
78
|
+
readonly lastErrorHtml: string
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Provides plain text information about the last called method or property. If a method call
|
|
82
|
+
* fails or behaves unexpectedly, check this property for details. Note that information is
|
|
83
|
+
* available regardless of the method call's success.
|
|
84
|
+
*
|
|
85
|
+
* This property is read-only.
|
|
86
|
+
*/
|
|
87
|
+
readonly lastErrorText: string
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* Provides XML-formatted information about the last called method or property. If a method call
|
|
91
|
+
* fails or behaves unexpectedly, check this property for details. Note that information is
|
|
92
|
+
* available regardless of the method call's success.
|
|
93
|
+
*
|
|
94
|
+
* This property is read-only.
|
|
95
|
+
*/
|
|
96
|
+
readonly lastErrorXml: string
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* Version of the component/library, such as "10.1.0"
|
|
100
|
+
*
|
|
101
|
+
* This property is read-only.
|
|
102
|
+
*/
|
|
103
|
+
readonly version: string
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* If set to a file path, this property logs the LastErrorText of each Chilkat method or property
|
|
107
|
+
* call to the specified file. This logging helps identify the context and history of Chilkat
|
|
108
|
+
* calls leading up to any crash or hang, aiding in debugging.
|
|
109
|
+
*
|
|
110
|
+
* Enabling the VerboseLogging property provides more detailed information.
|
|
111
|
+
*
|
|
112
|
+
* This property is mainly used for debugging rare instances where a Chilkat method call causes a
|
|
113
|
+
* hang or crash, which should generally not happen.
|
|
114
|
+
*
|
|
115
|
+
* Possible causes of hangs include:
|
|
116
|
+
*
|
|
117
|
+
* - A timeout property set to 0, indicating an infinite timeout.
|
|
118
|
+
*
|
|
119
|
+
* - A hang occurring within an event callback in the application code.
|
|
120
|
+
*
|
|
121
|
+
* - An internal bug in the Chilkat code causing the hang.
|
|
122
|
+
*/
|
|
123
|
+
debugLogFilePath: string
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* If set to `true`, then the contents of LastErrorText (or LastErrorXml, or LastErrorHtml) may
|
|
127
|
+
* contain more verbose information. The default value is `false`. Verbose logging should only be
|
|
128
|
+
* used for debugging. The potentially large quantity of logged information may adversely affect
|
|
129
|
+
* peformance.
|
|
130
|
+
*/
|
|
131
|
+
verboseLogging: boolean
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* Indicates the success or failure of the most recent method call: `true` means success, `false`
|
|
135
|
+
* means failure. This property remains unchanged by property setters or getters. This method is
|
|
136
|
+
* present to address challenges in checking for null or Nothing returns in certain programming
|
|
137
|
+
* languages. Note: This property does not apply to methods that return integer values or to
|
|
138
|
+
* boolean-returning methods where the boolean does not indicate success or failure.
|
|
139
|
+
*/
|
|
140
|
+
lastMethodSuccess: boolean
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
* Returns the number of certificates currently contained in this PFX object. This count includes
|
|
144
|
+
* end-entity certificates and any available intermediate or root CA certificates.
|
|
145
|
+
*
|
|
146
|
+
* Certificate indexes range from `0` through `NumCerts - 1` for use with {@link Pfx.certAt}.
|
|
147
|
+
*
|
|
148
|
+
* **Indexes are independent:** Certificates and private keys are stored in separate collections.
|
|
149
|
+
* Certificate index `i` has no positional relationship to private-key index `i`. In particular,
|
|
150
|
+
* `CertAt(i)` must not be assumed to return the certificate for {@link Pfx.privateKeyAt}.
|
|
151
|
+
*
|
|
152
|
+
* **Do not infer meaning from order:** No end-entity-first, CA-last, or load/export/reload
|
|
153
|
+
* ordering guarantee is documented. Use certificate properties to determine each certificate's
|
|
154
|
+
* role, and use `localKeyId` to associate a private key with its certificate when that attribute
|
|
155
|
+
* is present.
|
|
156
|
+
*
|
|
157
|
+
* This property is read-only.
|
|
158
|
+
*/
|
|
159
|
+
readonly numCerts: number
|
|
160
|
+
|
|
161
|
+
/**
|
|
162
|
+
* Returns the number of private keys currently contained in this PFX object.
|
|
163
|
+
*
|
|
164
|
+
* Private-key indexes range from `0` through `NumPrivateKeys - 1` for use with {@link
|
|
165
|
+
* Pfx.privateKeyAt}.
|
|
166
|
+
*
|
|
167
|
+
* **Indexes are independent:** Private keys and certificates are stored in separate collections.
|
|
168
|
+
* Private-key index `i` has no positional relationship to certificate index `i`. A PFX commonly
|
|
169
|
+
* has more certificates than private keys because intermediate and root CA certificates are also
|
|
170
|
+
* included.
|
|
171
|
+
*
|
|
172
|
+
* **Finding the matching certificate:** When the private key has a `localKeyId`, retrieve it with
|
|
173
|
+
* {@link Pfx.getSafeBagAttr} and pass the value to {@link Pfx.certByLocalKeyId}. Do not pair a
|
|
174
|
+
* key and certificate by using the same index.
|
|
175
|
+
*
|
|
176
|
+
* **Secret material:** A nonzero value means the object contains private keys in memory. Handle
|
|
177
|
+
* the object and any exported form accordingly.
|
|
178
|
+
*
|
|
179
|
+
* This property is read-only.
|
|
180
|
+
*/
|
|
181
|
+
readonly numPrivateKeys: number
|
|
182
|
+
|
|
183
|
+
/**
|
|
184
|
+
* Gets or sets the password-based encryption scheme used for PKCS#8 shrouded private-key bags
|
|
185
|
+
* when writing a PFX. After a PFX is loaded, this property reports the scheme found for the
|
|
186
|
+
* loaded shrouded key bag.
|
|
187
|
+
*
|
|
188
|
+
* The default is `pbeWithSHAAnd3_KeyTripleDES_CBC` for backward compatibility. Set this property
|
|
189
|
+
* to `pbes2` to use the cipher and PBKDF2 HMAC choices specified by {@link Pfx.pbes2CryptAlg} and
|
|
190
|
+
* {@link Pfx.pbes2HmacAlg}.
|
|
191
|
+
*
|
|
192
|
+
* **Scope:** This property selects protection for private-key bags. It does not select the
|
|
193
|
+
* certificate's public-key algorithm, the private key's algorithm, or the signature algorithm
|
|
194
|
+
* used by a certificate.
|
|
195
|
+
*
|
|
196
|
+
* **Compatibility versus modern encryption:** The Triple-DES default supports older consumers.
|
|
197
|
+
* For new PFX output, prefer `pbes2` with AES when every target platform supports it.
|
|
198
|
+
*/
|
|
199
|
+
algorithmId: string
|
|
200
|
+
|
|
201
|
+
/**
|
|
202
|
+
* Gets or sets the content-encryption cipher used when {@link Pfx.algorithmId} is `pbes2`. After
|
|
203
|
+
* loading a PBES2-protected PFX, this property reports the cipher used by the loaded shrouded key
|
|
204
|
+
* bag.
|
|
205
|
+
*
|
|
206
|
+
* ValueCipher
|
|
207
|
+
*
|
|
208
|
+
* | `aes256-cbc` | | AES-256 in CBC mode; the default for new PBES2 output. |
|
|
209
|
+
*
|
|
210
|
+
* | `aes192-cbc` | | AES-192 in CBC mode. |
|
|
211
|
+
*
|
|
212
|
+
* | `aes128-cbc` | | AES-128 in CBC mode. |
|
|
213
|
+
*
|
|
214
|
+
* | `3des-cbc` | | Triple DES in CBC mode for compatibility. |
|
|
215
|
+
*
|
|
216
|
+
* **PBES2 components:** This property chooses the cipher. {@link Pfx.pbes2HmacAlg} chooses the
|
|
217
|
+
* HMAC-based PBKDF2 pseudorandom function used to derive the encryption key from the password.
|
|
218
|
+
*/
|
|
219
|
+
pbes2CryptAlg: string
|
|
220
|
+
|
|
221
|
+
/**
|
|
222
|
+
* Gets or sets the HMAC algorithm used by PBKDF2 when {@link Pfx.algorithmId} is `pbes2`. After
|
|
223
|
+
* loading a PBES2-protected PFX, this property reports the HMAC choice found in the loaded
|
|
224
|
+
* shrouded key bag.
|
|
225
|
+
*
|
|
226
|
+
* - `hmacWithSha256` — default for new PBES2 output.
|
|
227
|
+
*
|
|
228
|
+
* - `hmacWithSha384`
|
|
229
|
+
*
|
|
230
|
+
* - `hmacWithSha512`
|
|
231
|
+
*
|
|
232
|
+
* - `hmacWithSha1` — primarily for compatibility with older consumers.
|
|
233
|
+
*
|
|
234
|
+
* **Not the container-integrity MAC:** This setting is part of PBES2 key derivation for
|
|
235
|
+
* private-key encryption. It should not be confused with the separate integrity protection that a
|
|
236
|
+
* PKCS#12 container may use.
|
|
237
|
+
*/
|
|
238
|
+
pbes2HmacAlg: string
|
|
239
|
+
|
|
240
|
+
/**
|
|
241
|
+
* Provides specialized compatibility options for unusual PFX interoperability requirements. The
|
|
242
|
+
* default is an empty string, which is appropriate for normal use. Multiple options are separated
|
|
243
|
+
* by commas.
|
|
244
|
+
*
|
|
245
|
+
* OptionEffect
|
|
246
|
+
*
|
|
247
|
+
* | `LegacyOrder` | | Writes internal PKCS#12 `ContentInfo` objects in the ordering traditionally
|
|
248
|
+
* used by older Chilkat versions. |
|
|
249
|
+
*
|
|
250
|
+
* | `NoTruncatePfxPassword64` | | Prevents Chilkat's default compatibility behavior of truncating
|
|
251
|
+
* an extremely long PFX password to 64 characters. |
|
|
252
|
+
*
|
|
253
|
+
* **Leave empty unless required:** These options can reduce interoperability with software that
|
|
254
|
+
* expects the default behavior. Enable one only for a documented compatibility case.
|
|
255
|
+
*/
|
|
256
|
+
uncommonOptions: string
|
|
257
|
+
|
|
258
|
+
// ---- Methods ----
|
|
259
|
+
|
|
260
|
+
/**
|
|
261
|
+
* Adds `cert` to this PFX as an identity. The certificate must have an associated private key
|
|
262
|
+
* that Chilkat can obtain and copy. This requirement applies whether `includeChain` is `true` or
|
|
263
|
+
* `false`; `AddCert` does not provide a certificate-only mode.
|
|
264
|
+
*
|
|
265
|
+
* `includeChain` controls only whether Chilkat also attempts to add the certificate chain:
|
|
266
|
+
*
|
|
267
|
+
* Certificate/private-key state
|
|
268
|
+
* `includeChain`
|
|
269
|
+
* Result
|
|
270
|
+
*
|
|
271
|
+
* | No private key |
|
|
272
|
+
* | `false` or `true` |
|
|
273
|
+
* | Fails. A certificate cannot be added by this method without its private key. |
|
|
274
|
+
*
|
|
275
|
+
* | Private key exists but cannot be obtained or exported |
|
|
276
|
+
* | `false` or `true` |
|
|
277
|
+
* | Fails. Chilkat does not fall back to adding the certificate without the key. |
|
|
278
|
+
*
|
|
279
|
+
* | Usable private key |
|
|
280
|
+
* | `false` |
|
|
281
|
+
* | Adds the private key and `cert` only. Intermediate and root certificates are not added. |
|
|
282
|
+
*
|
|
283
|
+
* | Usable private key; complete chain locatable |
|
|
284
|
+
* | `true` |
|
|
285
|
+
* | Adds the private key, `cert`, and the locatable intermediate and root certificates. |
|
|
286
|
+
*
|
|
287
|
+
* | Usable private key; chain incomplete |
|
|
288
|
+
* | `true` |
|
|
289
|
+
* | Succeeds with a partial chain. Missing intermediate or root certificates do not cause
|
|
290
|
+
* failure. |
|
|
291
|
+
*
|
|
292
|
+
* **Chain construction:** When `includeChain` is `true`, Chilkat searches the certificates
|
|
293
|
+
* already associated with `cert` and certificates made available for chain building, principally
|
|
294
|
+
* through {@link Pfx.useCertVault}. Each intermediate or root certificate is included when it can
|
|
295
|
+
* be located. The chain does not need to terminate at a root, and trust is not evaluated by this
|
|
296
|
+
* operation.
|
|
297
|
+
*
|
|
298
|
+
* **Snapshot semantics:** The certificate, associated private key, and any locatable chain
|
|
299
|
+
* certificates are copied at the time of the call. Chilkat does not retain a live reference to
|
|
300
|
+
* `cert`. After this method returns, modifying, reloading, or destroying the source `Cert` does
|
|
301
|
+
* not affect the material already stored in the PFX, and later changes to the PFX do not affect
|
|
302
|
+
* the source object.
|
|
303
|
+
*
|
|
304
|
+
* **Duplicate handling:** A private key already present in the object is not added again. The
|
|
305
|
+
* primary certificate and any certificate that has a private key are always inserted, even if an
|
|
306
|
+
* equivalent certificate is already present. Other intermediate or CA certificates are skipped
|
|
307
|
+
* when they are duplicates.
|
|
308
|
+
*
|
|
309
|
+
* **Not atomic:** After the certificate and key have passed the initial requirements,
|
|
310
|
+
* certificates are merged first and the private key is added afterward. If the key-add step
|
|
311
|
+
* fails, the method returns `false` but certificates already merged remain in the object. Treat
|
|
312
|
+
* failure as a possible partial modification. A missing or unobtainable private key is rejected
|
|
313
|
+
* before this merge begins.
|
|
314
|
+
*
|
|
315
|
+
* **Automatic association:** If the private key does not already have a `localKeyId`, Chilkat
|
|
316
|
+
* generates one and assigns the same value to the key's primary certificate. This identifier
|
|
317
|
+
* associates the key and leaf certificate without relying on collection indexes. Intermediate and
|
|
318
|
+
* root CA certificates may be shared across multiple identities and are not paired by position.
|
|
319
|
+
*
|
|
320
|
+
* @throws Error if the call fails (the message names the reason); the full log is in
|
|
321
|
+
* {@link Pfx.lastErrorText}.
|
|
322
|
+
*/
|
|
323
|
+
addCert(cert: Cert, includeChain: boolean): void
|
|
324
|
+
|
|
325
|
+
/**
|
|
326
|
+
* Adds `privKey` and the certificate chain in `certChain` to this PFX object. The chain must
|
|
327
|
+
* contain at least one certificate. The certificate at index `0` is treated as the end-entity
|
|
328
|
+
* certificate associated with `privKey`; the remaining entries are additional certificates to
|
|
329
|
+
* include with the identity. The chain does not need to contain a root certificate and may
|
|
330
|
+
* consist only of the end-entity certificate.
|
|
331
|
+
*
|
|
332
|
+
* **Caller responsibility:** Chilkat does not verify that `privKey` mathematically matches the
|
|
333
|
+
* public key in the certificate at index `0`. The association is positional. A mismatch is not
|
|
334
|
+
* rejected and can produce a PFX identity that later fails during signing, decryption, or client
|
|
335
|
+
* authentication.
|
|
336
|
+
*
|
|
337
|
+
* **Copy and lifetime behavior:** Chilkat immediately copies the private key and every
|
|
338
|
+
* certificate in the supplied chain. It retains neither source object. Modifying, reloading, or
|
|
339
|
+
* destroying the source `PrivateKey` or `CertChain` after this method returns does not affect the
|
|
340
|
+
* PFX.
|
|
341
|
+
*
|
|
342
|
+
* **Duplicates and automatic association:** A private key already present in the PFX is not added
|
|
343
|
+
* again, and duplicate certificates are skipped. If the private key does not already have a
|
|
344
|
+
* `localKeyId`, Chilkat generates one. The same identifier is assigned to the certificate at
|
|
345
|
+
* index `0`, linking that certificate to the key. Other safe-bag attributes are not generated
|
|
346
|
+
* automatically.
|
|
347
|
+
*
|
|
348
|
+
* **Failure and partial modification:** An empty certificate chain is rejected before anything is
|
|
349
|
+
* added. For later failures, the operation is not atomic: certificates are merged before the
|
|
350
|
+
* private key is added, so the method can return `false` after leaving some certificates in the
|
|
351
|
+
* PFX.
|
|
352
|
+
*
|
|
353
|
+
* @throws Error if the call fails (the message names the reason); the full log is in
|
|
354
|
+
* {@link Pfx.lastErrorText}.
|
|
355
|
+
*/
|
|
356
|
+
addPrivateKey(privKey: PrivateKey, certChain: CertChain): void
|
|
357
|
+
|
|
358
|
+
/**
|
|
359
|
+
* Loads one or more certificate/private-key identities from the PEM-formatted text in `pemStr`
|
|
360
|
+
* and builds the contents of this `Pfx` object. `password` supplies the password when the PEM
|
|
361
|
+
* contains encrypted private keys.
|
|
362
|
+
*
|
|
363
|
+
* The supported PEM block types are:
|
|
364
|
+
*
|
|
365
|
+
* PEM blockMeaning
|
|
366
|
+
*
|
|
367
|
+
* | `BEGIN CERTIFICATE` | | An X.509 certificate. |
|
|
368
|
+
*
|
|
369
|
+
* | `BEGIN PRIVATE KEY` | | An unencrypted PKCS #8 private key. |
|
|
370
|
+
*
|
|
371
|
+
* | `BEGIN ENCRYPTED PRIVATE KEY` | | A password-encrypted PKCS #8 private key. |
|
|
372
|
+
*
|
|
373
|
+
* | `BEGIN RSA PRIVATE KEY` | | A traditional RSA private key, either unencrypted or
|
|
374
|
+
* password-encrypted. |
|
|
375
|
+
*
|
|
376
|
+
* Multiple independent identities are supported. Each private key is paired with the certificate
|
|
377
|
+
* whose public key cryptographically matches it, and its chain is assembled from the other
|
|
378
|
+
* certificates in the PEM. Block order is therefore irrelevant; keys and certificates are not
|
|
379
|
+
* paired by position.
|
|
380
|
+
*
|
|
381
|
+
* **Required content:** The PEM must contain at least one private key, and every private key must
|
|
382
|
+
* have a matching certificate. The method fails if any key lacks its certificate or if the PEM
|
|
383
|
+
* contains certificates but no private key. Certificates that do not belong to any loaded key's
|
|
384
|
+
* certificate chain are not carried into the PFX.
|
|
385
|
+
*
|
|
386
|
+
* **Duplicates:** Repeated private-key or certificate blocks are accepted and de-duplicated. They
|
|
387
|
+
* do not cause an error and do not create duplicate entries in the resulting PFX.
|
|
388
|
+
*
|
|
389
|
+
* **Replacement and failure behavior:** A successful call replaces all existing contents. If the
|
|
390
|
+
* PEM cannot be parsed, the previous contents are preserved because replacement has not begun. If
|
|
391
|
+
* parsing succeeds but conversion fails while the parsed items are being added, the object has
|
|
392
|
+
* already been cleared and may contain only the items processed before the failure. Therefore, a
|
|
393
|
+
* failed call can mean either unchanged or partially replaced state, depending on where the
|
|
394
|
+
* failure occurred.
|
|
395
|
+
*
|
|
396
|
+
* @throws Error if the call fails (the message names the reason); the full log is in
|
|
397
|
+
* {@link Pfx.lastErrorText}.
|
|
398
|
+
*/
|
|
399
|
+
loadPem(pemStr: string, password: string): void
|
|
400
|
+
|
|
401
|
+
/**
|
|
402
|
+
* Decodes the text in `encodedData` using the binary encoding named by `encoding`, then loads the
|
|
403
|
+
* resulting bytes as a PFX / PKCS#12 container. Common encodings include `base64` and `hex`.
|
|
404
|
+
*
|
|
405
|
+
* `password` is the password argument.
|
|
406
|
+
*
|
|
407
|
+
* **Password and JSON options:** `password` accepts either a literal password, which is used for
|
|
408
|
+
* both integrity verification and all private-key bags, or a JSON object that can separately
|
|
409
|
+
* provide `integrity`, `privKeys`, and `skipPrivateKeys`. See {@link Pfx.loadPfxFile} for the
|
|
410
|
+
* exact JSON-detection rules, member types, defaults, and edge cases.
|
|
411
|
+
*
|
|
412
|
+
* **Binary encoding is not a charset:** `encoding` describes how binary PFX bytes were
|
|
413
|
+
* represented as text. It does not control certificate-name character encoding or password
|
|
414
|
+
* interpretation.
|
|
415
|
+
*
|
|
416
|
+
* **Destructive replacement:** This method always replaces the current contents. The object is
|
|
417
|
+
* cleared before the import is attempted, so a decoding error, bad password, or malformed PFX
|
|
418
|
+
* leaves the `Pfx` object empty; previously loaded certificates and keys are not preserved.
|
|
419
|
+
*
|
|
420
|
+
* @throws Error if the call fails (the message names the reason); the full log is in
|
|
421
|
+
* {@link Pfx.lastErrorText}.
|
|
422
|
+
*/
|
|
423
|
+
loadPfxEncoded(encodedData: string, encoding: string, password: string): void
|
|
424
|
+
|
|
425
|
+
/**
|
|
426
|
+
* Loads a PFX / PKCS#12 container from the file path in `path`. `password` follows the password
|
|
427
|
+
* contract below. The same contract is used by `LoadPfxBytes`, {@link Pfx.loadPfxBd}, and {@link
|
|
428
|
+
* Pfx.loadPfxEncoded}; it does not apply to {@link Pfx.loadPem}.
|
|
429
|
+
*
|
|
430
|
+
* The password argument has two modes:
|
|
431
|
+
*
|
|
432
|
+
* - **Plain password:** For any non-JSON value `P`, Chilkat uses `P` for both integrity
|
|
433
|
+
* verification and all private-key bags. `skipPrivateKeys` is `false`.
|
|
434
|
+
*
|
|
435
|
+
* - **JSON options:** After trimming leading and trailing whitespace, JSON mode is used only when
|
|
436
|
+
* the value begins with `{`, ends with `}`, and parses as valid JSON. All three recognized
|
|
437
|
+
* members are optional and case-sensitive.
|
|
438
|
+
*
|
|
439
|
+
* ```
|
|
440
|
+
* {
|
|
441
|
+
* "integrity": "integrity-password",
|
|
442
|
+
* "privKeys": "private-key-password",
|
|
443
|
+
* "skipPrivateKeys": false
|
|
444
|
+
* }
|
|
445
|
+
* ```
|
|
446
|
+
*
|
|
447
|
+
* MemberAccepted valueDefault when omitted
|
|
448
|
+
*
|
|
449
|
+
* | `integrity` | | String | | Integrity verification is skipped. |
|
|
450
|
+
*
|
|
451
|
+
* | `privKeys` | | String | | The empty string is used as the password for every private-key bag.
|
|
452
|
+
* |
|
|
453
|
+
*
|
|
454
|
+
* | `skipPrivateKeys` | | JSON Boolean `true`, or a string equal to `true` without regard to case
|
|
455
|
+
* | | `false` |
|
|
456
|
+
*
|
|
457
|
+
* Unknown JSON members are silently ignored. A misspelled member such as `privkeys` therefore
|
|
458
|
+
* does not produce a JSON error; the documented default is used instead. The single `privKeys`
|
|
459
|
+
* password applies to every private-key bag. Per-bag passwords are not supported.
|
|
460
|
+
*
|
|
461
|
+
* **Certificate-only loading:** When `skipPrivateKeys` is true, private-key bags are not
|
|
462
|
+
* processed and the `privKeys` password is irrelevant. Integrity verification is still performed
|
|
463
|
+
* when an `integrity` member is supplied.
|
|
464
|
+
*
|
|
465
|
+
* **Empty versus omitted integrity password:** A plain empty string requests integrity
|
|
466
|
+
* verification using an empty password. To intentionally skip integrity verification, use JSON
|
|
467
|
+
* and omit `integrity`, for example `{"skipPrivateKeys":true}` or `{}`.
|
|
468
|
+
*
|
|
469
|
+
* **Literal-password collision:** A real password that, after trimming, is a valid JSON object
|
|
470
|
+
* text is interpreted as options, and there is no force-literal escape. Text enclosed in braces
|
|
471
|
+
* that is not valid JSON falls back to literal-password handling.
|
|
472
|
+
*
|
|
473
|
+
* **Independent protection roles:** PKCS#12 can use one password for the container integrity MAC
|
|
474
|
+
* and another for encrypted private-key bags. A correct `integrity` password does not validate
|
|
475
|
+
* the `privKeys` password. If integrity verification succeeds but private-key decryption fails,
|
|
476
|
+
* the load still fails unless private keys were skipped.
|
|
477
|
+
*
|
|
478
|
+
* **Destructive replacement:** This method always replaces the current contents. The object is
|
|
479
|
+
* cleared before opening and importing the file, so any failure—including a missing file, invalid
|
|
480
|
+
* password, or malformed PFX—leaves the `Pfx` object empty. Load into a new object when the
|
|
481
|
+
* previously loaded contents must be preserved on failure.
|
|
482
|
+
*
|
|
483
|
+
* @throws Error if the call fails (the message names the reason); the full log is in
|
|
484
|
+
* {@link Pfx.lastErrorText}.
|
|
485
|
+
*/
|
|
486
|
+
loadPfxFile(path: string, password: string): void
|
|
487
|
+
|
|
488
|
+
/**
|
|
489
|
+
* Serializes the current PFX contents using `password` as the output password, then returns the
|
|
490
|
+
* PKCS#12 bytes encoded as text using `encoding`. Common choices for `encoding` are `base64` and
|
|
491
|
+
* `hex`.
|
|
492
|
+
*
|
|
493
|
+
* The PFX encryption settings are controlled by {@link Pfx.algorithmId} and the PBES2 properties.
|
|
494
|
+
*
|
|
495
|
+
* **Encoding does not add protection:** Base64, hexadecimal, and similar encodings only represent
|
|
496
|
+
* binary bytes as text. The confidentiality of private keys depends on the PFX password and
|
|
497
|
+
* encryption settings.
|
|
498
|
+
*
|
|
499
|
+
* @throws Error if the call fails (the message names the reason); the full log is in
|
|
500
|
+
* {@link Pfx.lastErrorText}.
|
|
501
|
+
*/
|
|
502
|
+
toEncodedString(password: string, encoding: string): string
|
|
503
|
+
|
|
504
|
+
/**
|
|
505
|
+
* Serializes the current PFX contents and writes the resulting PKCS#12 data to `path`, using
|
|
506
|
+
* `password` as the output password.
|
|
507
|
+
*
|
|
508
|
+
* `.pfx` and `.p12` are the conventional filename extensions for PKCS#12 containers. The
|
|
509
|
+
* private-key protection scheme is controlled by {@link Pfx.algorithmId} and the PBES2
|
|
510
|
+
* properties.
|
|
511
|
+
*
|
|
512
|
+
* **File security:** A PFX commonly contains private keys. In addition to choosing a strong
|
|
513
|
+
* password, protect the file with appropriate filesystem permissions and avoid leaving
|
|
514
|
+
* unnecessary backup copies.
|
|
515
|
+
*
|
|
516
|
+
* @throws Error if the call fails (the message names the reason); the full log is in
|
|
517
|
+
* {@link Pfx.lastErrorText}.
|
|
518
|
+
*/
|
|
519
|
+
toFile(password: string, path: string): void
|
|
520
|
+
|
|
521
|
+
/**
|
|
522
|
+
* Exports all private keys and certificates currently held by this object as PEM-formatted text.
|
|
523
|
+
* Certificates are written as standard `BEGIN CERTIFICATE` blocks.
|
|
524
|
+
*
|
|
525
|
+
* Every private key is exported as unencrypted PKCS #8 in a `BEGIN PRIVATE KEY` block. This
|
|
526
|
+
* method does not emit PKCS #1 RSA, SEC 1 EC, traditional DSA, or legacy OpenSSL
|
|
527
|
+
* encrypted-private-key blocks.
|
|
528
|
+
*
|
|
529
|
+
* **Private keys are unencrypted:** The returned text contains cleartext private-key material.
|
|
530
|
+
* Use {@link Pfx.toPemEx} to produce encrypted PKCS #8 private-key blocks or to omit selected
|
|
531
|
+
* categories of objects.
|
|
532
|
+
*
|
|
533
|
+
* @throws Error if the call fails (the message names the reason); the full log is in
|
|
534
|
+
* {@link Pfx.lastErrorText}.
|
|
535
|
+
*/
|
|
536
|
+
toPem(): string
|
|
537
|
+
|
|
538
|
+
/**
|
|
539
|
+
* Exports selected PFX contents as PEM-formatted text. Certificates are written as standard
|
|
540
|
+
* `BEGIN CERTIFICATE` blocks. Private keys are always written in PKCS #8 form: `BEGIN PRIVATE
|
|
541
|
+
* KEY` when unencrypted, or `BEGIN ENCRYPTED PRIVATE KEY` when encrypted. Traditional PKCS #1
|
|
542
|
+
* RSA, SEC 1 EC, DSA, and legacy OpenSSL encrypted-key PEM formats are not produced.
|
|
543
|
+
*
|
|
544
|
+
* The arguments control the output as follows:
|
|
545
|
+
*
|
|
546
|
+
* ArgumentEffect
|
|
547
|
+
*
|
|
548
|
+
* | `extendedAttrs` | | When `true`, emits OpenSSL-style bag and key attribute text in addition
|
|
549
|
+
* to the PEM blocks. |
|
|
550
|
+
*
|
|
551
|
+
* | `noKeys` | | When `true`, omits private-key blocks. |
|
|
552
|
+
*
|
|
553
|
+
* | `noCerts` | | When `true`, omits all certificate blocks. |
|
|
554
|
+
*
|
|
555
|
+
* | `noCaCerts` | | When `true`, omits intermediate and root CA certificates while retaining
|
|
556
|
+
* applicable end-entity certificates. |
|
|
557
|
+
*
|
|
558
|
+
* | `encryptAlg` | | Selects private-key encryption. Recognized keywords are `aes128`, `aes192`,
|
|
559
|
+
* `aes256`, `des3`, and `3des`. Leave empty for unencrypted private keys. An unrecognized
|
|
560
|
+
* nonempty value falls back to triple-DES rather than silently producing unencrypted output. |
|
|
561
|
+
*
|
|
562
|
+
* | `password` | | The password for encrypted private-key output. Encryption is applied only when
|
|
563
|
+
* both `encryptAlg` and `password` are nonempty. |
|
|
564
|
+
*
|
|
565
|
+
* **Encryption format:** AES choices use CBC mode with a 16-byte IV. `des3` and `3des` use
|
|
566
|
+
* triple-DES in CBC mode with an 8-byte IV. The result is an encrypted PKCS #8 `BEGIN ENCRYPTED
|
|
567
|
+
* PRIVATE KEY` block.
|
|
568
|
+
*
|
|
569
|
+
* **Security note:** If private keys are included and either `encryptAlg` or `password` is empty,
|
|
570
|
+
* the output contains unencrypted PKCS #8 private-key material. Prefer `aes256` for new encrypted
|
|
571
|
+
* output unless the receiving system requires another supported choice.
|
|
572
|
+
*
|
|
573
|
+
* @throws Error if the call fails (the message names the reason); the full log is in
|
|
574
|
+
* {@link Pfx.lastErrorText}.
|
|
575
|
+
*/
|
|
576
|
+
toPemEx(extendedAttrs: boolean, noKeys: boolean, noCerts: boolean, noCaCerts: boolean, encryptAlg: string, password: string): string
|
|
577
|
+
|
|
578
|
+
/**
|
|
579
|
+
* Adds the certificates currently contained in `vault` to the set of certificate sources
|
|
580
|
+
* available for later chain-building operations, such as {@link Pfx.addCert}.
|
|
581
|
+
*
|
|
582
|
+
* The call captures a point-in-time snapshot of the vault's certificates. Chilkat retains its own
|
|
583
|
+
* lifetime-safe references to those individual certificates and does not retain a reference to
|
|
584
|
+
* the `XmlCertVault` object itself. After this method returns, `vault` may be released,
|
|
585
|
+
* destroyed, or allowed to go out of scope; its contributed certificates remain available to this
|
|
586
|
+
* `Pfx` object.
|
|
587
|
+
*
|
|
588
|
+
* **Snapshot, not live synchronization:** Certificates added to or removed from `vault` after
|
|
589
|
+
* this call are not automatically reflected here. Call `UseCertVault` again to capture
|
|
590
|
+
* certificates added later.
|
|
591
|
+
*
|
|
592
|
+
* **Additive behavior:** Repeated calls accumulate certificate sources; a later call does not
|
|
593
|
+
* replace or clear certificates contributed by earlier vaults. The vault certificates are made
|
|
594
|
+
* available for chain construction and are not, merely by this call, added to the PFX's exported
|
|
595
|
+
* certificate collection.
|
|
596
|
+
*
|
|
597
|
+
* @throws Error if the call fails (the message names the reason); the full log is in
|
|
598
|
+
* {@link Pfx.lastErrorText}.
|
|
599
|
+
*/
|
|
600
|
+
useCertVault(vault: XmlCertVault): void
|
|
601
|
+
|
|
602
|
+
/**
|
|
603
|
+
* Sets a safe-bag attribute on a private key or certificate contained in this PFX. A safe-bag
|
|
604
|
+
* attribute is metadata attached to an item inside a PKCS#12/PFX container; it does not change
|
|
605
|
+
* the certificate or private-key material itself.
|
|
606
|
+
*
|
|
607
|
+
* - `forPrivateKey` is `true` to address a private key and `false` to address a certificate.
|
|
608
|
+
*
|
|
609
|
+
* - `index` is the zero-based index within the selected collection.
|
|
610
|
+
*
|
|
611
|
+
* - `name` is the attribute name. Attribute names are matched case-insensitively.
|
|
612
|
+
*
|
|
613
|
+
* - `value` is the value to set.
|
|
614
|
+
*
|
|
615
|
+
* - `encoding` specifies how `value` is decoded only when setting `localKeyId`. It is ignored for
|
|
616
|
+
* all text-valued attributes.
|
|
617
|
+
*
|
|
618
|
+
* Setting a recognized attribute replaces its existing value; it never creates a duplicate
|
|
619
|
+
* attribute. The method returns `false` and makes no change if `name` is not one of the
|
|
620
|
+
* recognized names listed below.
|
|
621
|
+
*
|
|
622
|
+
* Logical attributeAccepted `name` namesValue and behavior
|
|
623
|
+
*
|
|
624
|
+
* | Friendly name | | `friendlyName`, `keyContainerName`, or `keyName` | | These names refer to
|
|
625
|
+
* the same underlying text attribute. `value` is stored as text, and `encoding` is ignored.
|
|
626
|
+
* Setting through any alias replaces the value visible through every alias. |
|
|
627
|
+
*
|
|
628
|
+
* | Storage provider | | `storageProvider` or `msStorageProvider` | | The two names refer to the
|
|
629
|
+
* same underlying text attribute. `value` is stored as text, and `encoding` is ignored. |
|
|
630
|
+
*
|
|
631
|
+
* | Local key ID | | `localKeyId` | | A binary identifier commonly used to associate a
|
|
632
|
+
* private-key bag with its certificate bag. `encoding` specifies the encoding of `value`, such as
|
|
633
|
+
* `hex`, `base64`, or `decimal`. An empty `value` removes the attribute. |
|
|
634
|
+
*
|
|
635
|
+
* | Enhanced key usage | | `enhancedKeyUsage` | | `value` is a comma-separated text list. Each
|
|
636
|
+
* item may be a recognized usage name, such as `serverAuth`, `clientAuth`, `codeSigning`, or
|
|
637
|
+
* `emailProtection`, or a dotted OID such as `1.3.6.1.5.5.7.3.1`. Unrecognized items that are not
|
|
638
|
+
* valid OIDs are silently skipped. `encoding` is ignored. An empty `value` removes the attribute.
|
|
639
|
+
* This attribute is write-only through the safe-bag attribute API. |
|
|
640
|
+
*
|
|
641
|
+
* **Encoding applies only to localKeyId:** Friendly name, storage provider, and enhanced key
|
|
642
|
+
* usage are text values. Supplying `hex`, `base64`, or another encoding for those attributes has
|
|
643
|
+
* no effect.
|
|
644
|
+
*
|
|
645
|
+
* @throws Error if the call fails (the message names the reason); the full log is in
|
|
646
|
+
* {@link Pfx.lastErrorText}.
|
|
647
|
+
*/
|
|
648
|
+
setSafeBagAttr(forPrivateKey: boolean, index: number, name: string, value: string, encoding: string): void
|
|
649
|
+
|
|
650
|
+
/**
|
|
651
|
+
* Imports the certificates and private keys in this PFX into Windows certificate stores and
|
|
652
|
+
* Windows key storage. This method is available only on Microsoft Windows.
|
|
653
|
+
*
|
|
654
|
+
* ArgumentNameMeaning
|
|
655
|
+
*
|
|
656
|
+
* | `exportable` | | `exportable` | | Controls the legacy CryptoAPI exportability setting. This
|
|
657
|
+
* is the companion setting for the older certificate-import path; it is not the setting that
|
|
658
|
+
* determines exportability of the CNG-persisted key. |
|
|
659
|
+
*
|
|
660
|
+
* | `userProtected` | | `userProtected` | | When `true`, enables Windows strong key protection,
|
|
661
|
+
* which can display an interactive prompt when the key is imported or used. When `false`, key
|
|
662
|
+
* import and use are silent. |
|
|
663
|
+
*
|
|
664
|
+
* | `machineKeyset` | | `machineKeyset` | | Selects the scope for both private-key storage and
|
|
665
|
+
* certificate stores. `true` uses Local Machine; `false` uses Current User. Local Machine imports
|
|
666
|
+
* generally require elevation. |
|
|
667
|
+
*
|
|
668
|
+
* | `allowOverwriteKey` | | `allowOverwriteKey` | | When `true`, an existing private key having
|
|
669
|
+
* the same key-container name may be overwritten. When `false`, the import fails if that key
|
|
670
|
+
* already exists. |
|
|
671
|
+
*
|
|
672
|
+
* | `allowExport` | | `allowExport` | | Controls the private key as persisted by the CNG
|
|
673
|
+
* Microsoft Software Key Storage Provider. When `true`, the key is marked plaintext-exportable
|
|
674
|
+
* and can later be exported, including as raw private-key material. This is the effective
|
|
675
|
+
* exportability control for the key installed by this method. |
|
|
676
|
+
*
|
|
677
|
+
* | `leafStore` | | `leafStore` | | Destination store for end-entity (leaf) certificates. |
|
|
678
|
+
*
|
|
679
|
+
* | `intermediateStore` | | `intermediateStore` | | Destination store for intermediate CA
|
|
680
|
+
* certificates. |
|
|
681
|
+
*
|
|
682
|
+
* | `rootStore` | | `rootStore` | | Destination store for root or self-signed certificates. |
|
|
683
|
+
*
|
|
684
|
+
* | `extraOptions` | | `extraOptions` | | Currently unused. It has no effect for any value. Pass
|
|
685
|
+
* an empty string. |
|
|
686
|
+
*
|
|
687
|
+
* **Two different exportability settings:** `exportable` applies to the legacy CryptoAPI path.
|
|
688
|
+
* `allowExport` applies to the CNG Key Storage Provider used to persist the private key and
|
|
689
|
+
* determines whether that installed key can actually be exported later. Set `allowExport` to
|
|
690
|
+
* `true` only when later private-key export is required, because it permits plaintext export.
|
|
691
|
+
*
|
|
692
|
+
* Store names are case-insensitive. Standard names include `My` for leaf certificates, `CA` or
|
|
693
|
+
* `CertificationAuthority` for intermediate certificates, and `Root` for trusted roots. For any
|
|
694
|
+
* certificate class, pass `None`, `Nothing`, or an empty string to skip importing that class.
|
|
695
|
+
* Other Windows store names, such as `AddressBook`, `AuthRoot`, `TrustedPeople`, and
|
|
696
|
+
* `TrustedPublisher`, may also be used when appropriate.
|
|
697
|
+
*
|
|
698
|
+
* If a certificate already exists, it is updated or replaced rather than causing an error.
|
|
699
|
+
* Existing private keys are handled separately: when a key having the same key-container name
|
|
700
|
+
* exists, `allowOverwriteKey` determines whether it is overwritten or causes the import to fail.
|
|
701
|
+
* The key-container name comes from the private key's friendly name; if no friendly name exists,
|
|
702
|
+
* Chilkat generates a unique name.
|
|
703
|
+
*
|
|
704
|
+
* **Overwrite risk:** Enabling `allowOverwriteKey` can replace an unrelated existing key when its
|
|
705
|
+
* container name matches the imported key's friendly name. Enable overwrite only when that name
|
|
706
|
+
* is known to identify the key that should be replaced.
|
|
707
|
+
*
|
|
708
|
+
* **Not atomic:** Keys are imported one at a time, followed by certificates one at a time. Items
|
|
709
|
+
* imported before a later failure remain installed. A private-key failure stops key processing,
|
|
710
|
+
* while a certificate failure does not necessarily prevent later certificates from being
|
|
711
|
+
* attempted. A `false` return can therefore leave partial results in Windows; applications
|
|
712
|
+
* requiring all-or-nothing behavior must inspect and clean up the target stores themselves.
|
|
713
|
+
*
|
|
714
|
+
* **Interactive protection:** Do not set `userProtected` to `true` in a Windows service or
|
|
715
|
+
* another noninteractive process. The required protection prompt cannot be displayed and the
|
|
716
|
+
* operation may fail or hang. Use `false` for silent service and server operation.
|
|
717
|
+
*
|
|
718
|
+
* **Trust-store impact:** Importing a root certificate into the Windows `Root` store makes it a
|
|
719
|
+
* trust anchor for the selected Current User or Local Machine scope. Import only roots that the
|
|
720
|
+
* application or administrator intentionally trusts. Use `None` for `rootStore` when root
|
|
721
|
+
* installation is not required.
|
|
722
|
+
*
|
|
723
|
+
* **Common configurations:**
|
|
724
|
+
*
|
|
725
|
+
* ScenarioTypical settings
|
|
726
|
+
*
|
|
727
|
+
* | Per-user, silent import | | `exportable=false`, `userProtected=false`, `machineKeyset=false`,
|
|
728
|
+
* `allowOverwriteKey=false`, `allowExport=false`, leaf `My`, intermediate `CA`, root `None`. |
|
|
729
|
+
*
|
|
730
|
+
* | Machine-wide service/server | | Use the silent settings above with `machineKeyset=true` and
|
|
731
|
+
* run elevated. |
|
|
732
|
+
*
|
|
733
|
+
* | Key must be exportable later | | Set `allowExport=true`. Also set `exportable=true` when
|
|
734
|
+
* legacy CryptoAPI exportability is wanted. |
|
|
735
|
+
*
|
|
736
|
+
* | Leaf certificate only | | Use a real leaf store such as `My` and pass `None` for both
|
|
737
|
+
* intermediate and root stores. |
|
|
738
|
+
*
|
|
739
|
+
* | Replace an existing key | | Set `allowOverwriteKey=true` only after confirming that the
|
|
740
|
+
* key-container name cannot collide with an unrelated key. |
|
|
741
|
+
*
|
|
742
|
+
* @throws Error if the call fails (the message names the reason); the full log is in
|
|
743
|
+
* {@link Pfx.lastErrorText}.
|
|
744
|
+
*/
|
|
745
|
+
importToWindows(exportable: boolean, userProtected: boolean, machineKeyset: boolean, allowOverwriteKey: boolean, allowExport: boolean, leafStore: string, intermediateStore: string, rootStore: string, extraOptions: string): void
|
|
746
|
+
|
|
747
|
+
/**
|
|
748
|
+
* Reads a recognized safe-bag attribute from a private key or certificate contained in this PFX.
|
|
749
|
+
* `forPrivateKey` is `true` for a private key and `false` for a certificate. `index` is the
|
|
750
|
+
* zero-based index within the selected collection. `attrName` is the attribute name and is
|
|
751
|
+
* matched case-insensitively.
|
|
752
|
+
*
|
|
753
|
+
* **Empty values are treated as failure:** The method succeeds only when the requested attribute
|
|
754
|
+
* is recognized, readable, set, and nonempty. If the attribute is unset or its stored value is an
|
|
755
|
+
* empty string, the method reports failure. An empty string is therefore never a successful
|
|
756
|
+
* attribute result.
|
|
757
|
+
*
|
|
758
|
+
* Logical attributeAccepted `attrName` namesRead behavior
|
|
759
|
+
*
|
|
760
|
+
* | Friendly name | | `friendlyName`, `keyContainerName`, or `keyName` | | All three names read
|
|
761
|
+
* the same underlying text attribute. The read succeeds only when the attribute contains a
|
|
762
|
+
* nonempty value; an unset or empty value causes failure. |
|
|
763
|
+
*
|
|
764
|
+
* | Storage provider | | `storageProvider` or `msStorageProvider` | | Both names read the same
|
|
765
|
+
* underlying text attribute. The read succeeds only when the attribute contains a nonempty value;
|
|
766
|
+
* an unset or empty value causes failure. |
|
|
767
|
+
*
|
|
768
|
+
* | Local key ID | | `localKeyId` | | The read succeeds only when a nonempty local key ID is
|
|
769
|
+
* present. The value is always returned in decimal encoding as one big-endian integer, regardless
|
|
770
|
+
* of the encoding used when it was set. |
|
|
771
|
+
*
|
|
772
|
+
* | Enhanced key usage | | `enhancedKeyUsage` | | Not readable through this method. The operation
|
|
773
|
+
* reports failure even if the attribute was previously set with {@link Pfx.setSafeBagAttr}. |
|
|
774
|
+
*
|
|
775
|
+
* An unrecognized `attrName` name, an invalid index, an unreadable attribute, or any recognized
|
|
776
|
+
* attribute whose value is unset or empty causes the read to fail.
|
|
777
|
+
*
|
|
778
|
+
* **Decimal localKeyId representation:** The raw bytes are interpreted as one unsigned big-endian
|
|
779
|
+
* integer. For example, bytes `01 02 03 04 05 06 07 08` are returned as `72623859790382856`.
|
|
780
|
+
* Leading zero bytes are not preserved by a set-read-set round trip because `00 01 02 03` and `01
|
|
781
|
+
* 02 03` represent the same integer.
|
|
782
|
+
*
|
|
783
|
+
* **Pairing a key with its certificate:** For private-key index `i`, read `localKeyId` with
|
|
784
|
+
* `forPrivateKey` = `true` and `index` = `i`. If a nonempty value is returned successfully, pass
|
|
785
|
+
* it to {@link Pfx.certByLocalKeyId} using the encoding `decimal`. Never assume that certificate
|
|
786
|
+
* index `i` matches private-key index `i`.
|
|
787
|
+
*
|
|
788
|
+
* @throws Error if the call fails (the message names the reason); the full log is in
|
|
789
|
+
* {@link Pfx.lastErrorText}.
|
|
790
|
+
*/
|
|
791
|
+
getSafeBagAttr(forPrivateKey: boolean, index: number, attrName: string): string
|
|
792
|
+
|
|
793
|
+
/**
|
|
794
|
+
* Imports all certificates and private keys currently held by this `Pfx` object into the
|
|
795
|
+
* application's default keychain. This method is available only on macOS and iOS. On other
|
|
796
|
+
* platforms it returns `false` and reports that the method is macOS/iOS only.
|
|
797
|
+
*
|
|
798
|
+
* The method does not accept a password. Any required password must already have been supplied
|
|
799
|
+
* when loading the PFX or PEM data; the objects presently contained in the `Pfx` are what this
|
|
800
|
+
* method imports.
|
|
801
|
+
*
|
|
802
|
+
* **`opts` is reserved for future use:** The `JsonObject` currently has no defined members and
|
|
803
|
+
* does not affect the import. Pass an empty `JsonObject`. Any JSON members supplied today are
|
|
804
|
+
* ignored. The destination keychain, access group, key accessibility, iCloud synchronization, and
|
|
805
|
+
* replacement behavior are not configurable through this method.
|
|
806
|
+
*
|
|
807
|
+
* The certificates and private keys are imported into the application's platform-default keychain
|
|
808
|
+
* without assigning special access-group, accessibility, or synchronization attributes. Normal
|
|
809
|
+
* macOS or iOS keychain-access rules and application entitlements still apply.
|
|
810
|
+
*
|
|
811
|
+
* **Duplicates and atomicity:** An item already present in the keychain does not cause failure
|
|
812
|
+
* and is not added again or replaced, so re-importing the same identity is safe. The import is
|
|
813
|
+
* all-or-nothing: if the method fails, it does not leave only a subset of the PFX contents
|
|
814
|
+
* imported.
|
|
815
|
+
*
|
|
816
|
+
* The calling sequence is the same on macOS and iOS: load or build the `Pfx`, create an empty
|
|
817
|
+
* `JsonObject`, and pass it as `opts`.
|
|
818
|
+
*
|
|
819
|
+
* @throws Error if the call fails (the message names the reason); the full log is in
|
|
820
|
+
* {@link Pfx.lastErrorText}.
|
|
821
|
+
*/
|
|
822
|
+
importToKeychain(opts: JsonObject): void
|
|
823
|
+
|
|
824
|
+
/**
|
|
825
|
+
* Replaces the entire contents of `json` with structured JSON information from the most recent
|
|
826
|
+
* operation. The data is copied as a complete replacement; it is never merged with members
|
|
827
|
+
* already present in `json`.
|
|
828
|
+
*
|
|
829
|
+
* The exact members depend on the preceding method. After loading a PFX, the JSON may describe
|
|
830
|
+
* authenticated-safe content, safe bags, encryption information, and bag attributes. If no JSON
|
|
831
|
+
* data is available, `json` is cleared to an empty JSON object.
|
|
832
|
+
*
|
|
833
|
+
* **Destination behavior:** The previous contents of `json` are never preserved by this call.
|
|
834
|
+
* Reusing a `JsonObject` is safe without clearing it first, but do not expect older members to
|
|
835
|
+
* remain.
|
|
836
|
+
*
|
|
837
|
+
* **Diagnostics:** Call this method immediately after the operation being inspected. Not every
|
|
838
|
+
* method produces JSON detail, and this information supplements rather than replaces
|
|
839
|
+
* `LastErrorText`.
|
|
840
|
+
*/
|
|
841
|
+
getLastJsonData(json: JsonObject): void
|
|
842
|
+
|
|
843
|
+
/**
|
|
844
|
+
* Copies the certificate at the zero-based index `index` into `cert`. The first certificate is at
|
|
845
|
+
* index `0`; valid indexes are less than {@link Pfx.numCerts}.
|
|
846
|
+
*
|
|
847
|
+
* On success, `cert` is replaced with an independent, detached copy of the selected certificate.
|
|
848
|
+
* The method does not merge with or append to any certificate already held by `cert`. The
|
|
849
|
+
* returned copy does not remain linked to the PFX: changing either object later does not affect
|
|
850
|
+
* the other, and the copied certificate remains usable even if the PFX is subsequently modified
|
|
851
|
+
* or destroyed.
|
|
852
|
+
*
|
|
853
|
+
* **Failure leaves the destination unchanged:** If `index` is out of range or the certificate
|
|
854
|
+
* cannot be returned, the method returns `false` without modifying `cert`. When reusing a `Cert`
|
|
855
|
+
* object in a loop, always use its contents only after this method returns `true`; otherwise
|
|
856
|
+
* `cert` may still contain the certificate from an earlier successful call.
|
|
857
|
+
*
|
|
858
|
+
* **Do not pair by index:** Certificate indexes and private-key indexes are independent.
|
|
859
|
+
* `CertAt(i)` is not necessarily the certificate associated with {@link Pfx.privateKeyAt}. To
|
|
860
|
+
* associate a key with its certificate, obtain the key's `localKeyId` with {@link
|
|
861
|
+
* Pfx.getSafeBagAttr} and use {@link Pfx.certByLocalKeyId}.
|
|
862
|
+
*
|
|
863
|
+
* @throws Error if the call fails (the message names the reason); the full log is in
|
|
864
|
+
* {@link Pfx.lastErrorText}.
|
|
865
|
+
*/
|
|
866
|
+
certAt(index: number, cert: Cert): void
|
|
867
|
+
|
|
868
|
+
/**
|
|
869
|
+
* Searches for a certificate whose certificate-bag `localKeyId` attribute matches `localKeyId`
|
|
870
|
+
* and copies it into `cert`. `encoding` names the binary representation used for `localKeyId`,
|
|
871
|
+
* such as `decimal`, `base64`, or `hex`.
|
|
872
|
+
*
|
|
873
|
+
* On success, `cert` is replaced with the matching certificate. The method does not merge with
|
|
874
|
+
* any certificate already held by `cert`.
|
|
875
|
+
*
|
|
876
|
+
* **Failure leaves the destination unchanged:** If `encoding` is invalid, `localKeyId` cannot be
|
|
877
|
+
* decoded, or no matching certificate is found, the method returns `false` without modifying
|
|
878
|
+
* `cert`. Always use `cert` only after a `true` return, because a reused destination may still
|
|
879
|
+
* contain a certificate from an earlier call.
|
|
880
|
+
*
|
|
881
|
+
* **Recommended association workflow:** For a private key at index `i`, call {@link
|
|
882
|
+
* Pfx.getSafeBagAttr} with `localKeyId` = `true`, `encoding` = `i`, and `cert` = `localKeyId`.
|
|
883
|
+
* That method returns the identifier in decimal representation, so pass the returned value as
|
|
884
|
+
* `localKeyId` and `decimal` as `encoding` here.
|
|
885
|
+
*
|
|
886
|
+
* **Do not use matching indexes:** Certificates and private keys are stored in independent
|
|
887
|
+
* collections. `CertAt(i)` is not the certificate for `PrivateKeyAt(i)` unless that happens
|
|
888
|
+
* coincidentally.
|
|
889
|
+
*
|
|
890
|
+
* **Scope:** This method returns the matching primary certificate. It does not return an
|
|
891
|
+
* associated certificate chain as a separate object.
|
|
892
|
+
*
|
|
893
|
+
* @throws Error if the call fails (the message names the reason); the full log is in
|
|
894
|
+
* {@link Pfx.lastErrorText}.
|
|
895
|
+
*/
|
|
896
|
+
certByLocalKeyId(localKeyId: string, encoding: string, cert: Cert): void
|
|
897
|
+
|
|
898
|
+
/**
|
|
899
|
+
* Copies the private key at the zero-based index `index` into `privKey`. The first private key is
|
|
900
|
+
* at index `0`; valid indexes are less than {@link Pfx.numPrivateKeys}.
|
|
901
|
+
*
|
|
902
|
+
* On success, `privKey` is replaced with an independent, detached copy of the selected private
|
|
903
|
+
* key. The method does not merge with or append to any key already held by `privKey`. The
|
|
904
|
+
* returned copy does not remain linked to the PFX: changing either object later does not affect
|
|
905
|
+
* the other, and the copied key remains usable even if the PFX is subsequently modified or
|
|
906
|
+
* destroyed.
|
|
907
|
+
*
|
|
908
|
+
* **Failure leaves the destination unchanged:** If `index` is out of range or the private key
|
|
909
|
+
* cannot be returned, the method returns `false` without modifying `privKey`. When reusing a
|
|
910
|
+
* `PrivateKey` object, use its contents only after this method returns `true`; otherwise
|
|
911
|
+
* `privKey` may still contain a key from an earlier successful call.
|
|
912
|
+
*
|
|
913
|
+
* **Do not pair by index:** Private-key indexes and certificate indexes are independent.
|
|
914
|
+
* `PrivateKeyAt(i)` is not necessarily associated with {@link Pfx.certAt}.
|
|
915
|
+
*
|
|
916
|
+
* **Finding the matching certificate:** Call {@link Pfx.getSafeBagAttr} with `index` set to
|
|
917
|
+
* `true`, `privKey` set to this private-key index, and ARG3 set to `localKeyId`. If the attribute
|
|
918
|
+
* is present, pass the returned value to {@link Pfx.certByLocalKeyId} using `decimal` as the
|
|
919
|
+
* encoding.
|
|
920
|
+
*
|
|
921
|
+
* **Sensitive material:** Treat `privKey` as secret key material. Avoid unnecessary
|
|
922
|
+
* serialization, logging, or long-lived copies.
|
|
923
|
+
*
|
|
924
|
+
* @throws Error if the call fails (the message names the reason); the full log is in
|
|
925
|
+
* {@link Pfx.lastErrorText}.
|
|
926
|
+
*/
|
|
927
|
+
privateKeyAt(index: number, privKey: PrivateKey): void
|
|
928
|
+
|
|
929
|
+
/**
|
|
930
|
+
* Populates `jksObj` with a Java KeyStore (JKS) representation of this PFX. One private-key entry
|
|
931
|
+
* is created for each private key, and certificates in the PFX are used to construct the
|
|
932
|
+
* corresponding certificate chains. `password` protects the generated private-key entries.
|
|
933
|
+
*
|
|
934
|
+
* `jksObj` is cleared before conversion begins. On success, it contains only the newly converted
|
|
935
|
+
* key store; the method replaces the destination's previous entries rather than merging with
|
|
936
|
+
* them.
|
|
937
|
+
*
|
|
938
|
+
* **Clear-first failure behavior:** If conversion returns `false`, the key store that `jksObj`
|
|
939
|
+
* held before the call is not restored. `jksObj` may be empty or partially populated. Use the
|
|
940
|
+
* destination only after a `true` return when a complete conversion is required.
|
|
941
|
+
*
|
|
942
|
+
* If `aliasName` is nonempty, it becomes the alias for the first private key. Otherwise, the
|
|
943
|
+
* alias is selected in this order:
|
|
944
|
+
*
|
|
945
|
+
* - Certificate subject common name.
|
|
946
|
+
*
|
|
947
|
+
* - Certificate subject email address.
|
|
948
|
+
*
|
|
949
|
+
* - PKCS#9 friendly-name attribute.
|
|
950
|
+
*
|
|
951
|
+
* - Certificate serial number.
|
|
952
|
+
*
|
|
953
|
+
* Aliases for additional private keys are selected automatically using the same preference order.
|
|
954
|
+
*
|
|
955
|
+
* **Container conversion:** PKCS#12 and JKS are different keystore formats. Conversion preserves
|
|
956
|
+
* available key-and-certificate relationships, but provider-specific PKCS#12 attributes may not
|
|
957
|
+
* have an equivalent JKS representation.
|
|
958
|
+
*
|
|
959
|
+
* @throws Error if the call fails (the message names the reason); the full log is in
|
|
960
|
+
* {@link Pfx.lastErrorText}.
|
|
961
|
+
*/
|
|
962
|
+
toJksObj(aliasName: string, password: string, jksObj: JavaKeyStore): void
|
|
963
|
+
|
|
964
|
+
/**
|
|
965
|
+
* Loads a PFX / PKCS#12 container from the bytes currently held in `bd`. `password` is the
|
|
966
|
+
* password argument.
|
|
967
|
+
*
|
|
968
|
+
* **Password and JSON options:** `password` accepts either a literal password, which is used for
|
|
969
|
+
* both integrity verification and all private-key bags, or a JSON object that can separately
|
|
970
|
+
* provide `integrity`, `privKeys`, and `skipPrivateKeys`. See {@link Pfx.loadPfxFile} for the
|
|
971
|
+
* exact JSON-detection rules, member types, defaults, and edge cases.
|
|
972
|
+
*
|
|
973
|
+
* **Destructive replacement:** This method always replaces the current contents. The object is
|
|
974
|
+
* cleared before the import is attempted, so a failed load leaves the `Pfx` object empty;
|
|
975
|
+
* previously loaded certificates and keys are not preserved.
|
|
976
|
+
*
|
|
977
|
+
* @throws Error if the call fails (the message names the reason); the full log is in
|
|
978
|
+
* {@link Pfx.lastErrorText}.
|
|
979
|
+
*/
|
|
980
|
+
loadPfxBd(bd: BinData, password: string): void
|
|
981
|
+
|
|
982
|
+
/**
|
|
983
|
+
* Serializes the current PFX contents as PKCS#12 data and writes the bytes to `bd`, using
|
|
984
|
+
* `password` as the output password.
|
|
985
|
+
*
|
|
986
|
+
* `bd` is cleared before serialization begins. On success, it contains only the newly generated
|
|
987
|
+
* PFX data; the method replaces the previous `BinData` contents and never appends to them.
|
|
988
|
+
*
|
|
989
|
+
* **Clear-first failure behavior:** If the method returns `false`, the contents that `bd` held
|
|
990
|
+
* before the call are not restored. `bd` may be empty or may contain partially generated data.
|
|
991
|
+
* Use the destination only after a `true` return when complete output is required.
|
|
992
|
+
*
|
|
993
|
+
* The private-key encryption scheme is controlled by {@link Pfx.algorithmId} and, for PBES2, the
|
|
994
|
+
* related algorithm properties.
|
|
995
|
+
*
|
|
996
|
+
* **Sensitive output:** `bd` may contain encrypted private-key material. Keep the password and
|
|
997
|
+
* resulting bytes protected even though they are stored only in memory.
|
|
998
|
+
*
|
|
999
|
+
* @throws Error if the call fails (the message names the reason); the full log is in
|
|
1000
|
+
* {@link Pfx.lastErrorText}.
|
|
1001
|
+
*/
|
|
1002
|
+
toBd(password: string, bd: BinData): void
|
|
1003
|
+
}
|