pdf-lite 1.0.0 → 1.0.1-alpha.2

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 (339) hide show
  1. package/.github/workflows/docs.yaml +2 -0
  2. package/EXAMPLES.md +1 -4
  3. package/docs/README.md +127 -0
  4. package/docs/core/README.md +43 -0
  5. package/docs/core/decoder/README.md +11 -0
  6. package/docs/core/decoder/classes/PdfDecoder.md +362 -0
  7. package/docs/core/generators/README.md +14 -0
  8. package/docs/core/generators/functions/bytesToPdfObjects.md +26 -0
  9. package/docs/core/generators/functions/pdfDecoder.md +36 -0
  10. package/docs/core/generators/functions/pdfDecoderAsync.md +26 -0
  11. package/docs/core/generators/functions/stringToPdfObjects.md +25 -0
  12. package/docs/core/incremental-parser/README.md +13 -0
  13. package/docs/core/incremental-parser/classes/EofReachedError.md +55 -0
  14. package/docs/core/incremental-parser/classes/IncrementalParser.md +299 -0
  15. package/docs/core/incremental-parser/classes/NoMoreTokensError.md +55 -0
  16. package/docs/core/objects/pdf-array/README.md +11 -0
  17. package/docs/core/objects/pdf-array/classes/PdfArray.md +305 -0
  18. package/docs/core/objects/pdf-boolean/README.md +11 -0
  19. package/docs/core/objects/pdf-boolean/classes/PdfBoolean.md +265 -0
  20. package/docs/core/objects/pdf-comment/README.md +11 -0
  21. package/docs/core/objects/pdf-comment/classes/PdfComment.md +329 -0
  22. package/docs/core/objects/pdf-date/README.md +11 -0
  23. package/docs/core/objects/pdf-date/classes/PdfDate.md +317 -0
  24. package/docs/core/objects/pdf-dictionary/README.md +17 -0
  25. package/docs/core/objects/pdf-dictionary/classes/PdfDictionary.md +396 -0
  26. package/docs/core/objects/pdf-dictionary/type-aliases/PdfDictionaryEntries.md +9 -0
  27. package/docs/core/objects/pdf-dictionary/type-aliases/PdfDictionaryEntry.md +9 -0
  28. package/docs/core/objects/pdf-dictionary/type-aliases/PdfDictionaryMap.md +9 -0
  29. package/docs/core/objects/pdf-hexadecimal/README.md +11 -0
  30. package/docs/core/objects/pdf-hexadecimal/classes/PdfHexadecimal.md +320 -0
  31. package/docs/core/objects/pdf-indirect-object/README.md +11 -0
  32. package/docs/core/objects/pdf-indirect-object/classes/PdfIndirectObject.md +411 -0
  33. package/docs/core/objects/pdf-name/README.md +11 -0
  34. package/docs/core/objects/pdf-name/classes/PdfName.md +271 -0
  35. package/docs/core/objects/pdf-null/README.md +11 -0
  36. package/docs/core/objects/pdf-null/classes/PdfNull.md +259 -0
  37. package/docs/core/objects/pdf-number/README.md +12 -0
  38. package/docs/core/objects/pdf-number/classes/PdfByteOffsetNumber.md +369 -0
  39. package/docs/core/objects/pdf-number/classes/PdfNumber.md +345 -0
  40. package/docs/core/objects/pdf-object/README.md +11 -0
  41. package/docs/core/objects/pdf-object/classes/PdfObject.md +214 -0
  42. package/docs/core/objects/pdf-object-reference/README.md +11 -0
  43. package/docs/core/objects/pdf-object-reference/classes/PdfObjectReference.md +279 -0
  44. package/docs/core/objects/pdf-start-xref/README.md +11 -0
  45. package/docs/core/objects/pdf-start-xref/classes/PdfStartXRef.md +265 -0
  46. package/docs/core/objects/pdf-stream/README.md +23 -0
  47. package/docs/core/objects/pdf-stream/classes/PdfObjStream.md +699 -0
  48. package/docs/core/objects/pdf-stream/classes/PdfStream.md +570 -0
  49. package/docs/core/objects/pdf-stream/classes/PdfXRefStream.md +723 -0
  50. package/docs/core/objects/pdf-stream/classes/PdfXRefStreamCompressedEntry.md +51 -0
  51. package/docs/core/objects/pdf-stream/type-aliases/PdfXRefStreamEntry.md +9 -0
  52. package/docs/core/objects/pdf-stream/type-aliases/PdfXRefStreamStandardEntry.md +9 -0
  53. package/docs/core/objects/pdf-stream/variables/PdfXRefStreamStandardEntry.md +9 -0
  54. package/docs/core/objects/pdf-string/README.md +11 -0
  55. package/docs/core/objects/pdf-string/classes/PdfString.md +301 -0
  56. package/docs/core/objects/pdf-trailer/README.md +16 -0
  57. package/docs/core/objects/pdf-trailer/classes/PdfTrailer.md +271 -0
  58. package/docs/core/objects/pdf-trailer/type-aliases/PdfTrailerDictionary.md +9 -0
  59. package/docs/core/objects/pdf-trailer/type-aliases/PdfTrailerEntries.md +51 -0
  60. package/docs/core/objects/pdf-xref-table/README.md +13 -0
  61. package/docs/core/objects/pdf-xref-table/classes/PdfXRefTable.md +331 -0
  62. package/docs/core/objects/pdf-xref-table/classes/PdfXRefTableEntry.md +297 -0
  63. package/docs/core/objects/pdf-xref-table/classes/PdfXRefTableSectionHeader.md +277 -0
  64. package/docs/core/parser/README.md +11 -0
  65. package/docs/core/parser/classes/Parser.md +74 -0
  66. package/docs/core/ref/README.md +15 -0
  67. package/docs/core/ref/classes/Ref.md +149 -0
  68. package/docs/core/ref/type-aliases/RefUpdateCallback.md +33 -0
  69. package/docs/core/serializer/README.md +11 -0
  70. package/docs/core/serializer/classes/PdfTokenSerializer.md +106 -0
  71. package/docs/core/streams/object-stream/README.md +11 -0
  72. package/docs/core/streams/object-stream/classes/PdfObjectStream.md +69 -0
  73. package/docs/core/tokeniser/README.md +21 -0
  74. package/docs/core/tokeniser/classes/PdfByteStreamTokeniser.md +366 -0
  75. package/docs/core/tokeniser/classes/PdfObjectTokeniser.md +69 -0
  76. package/docs/core/tokeniser/functions/objectToTokens.md +25 -0
  77. package/docs/core/tokeniser/functions/pdfObjectStreamTokeniser.md +27 -0
  78. package/docs/core/tokeniser/type-aliases/PdfTokeniser.md +11 -0
  79. package/docs/core/tokens/boolean-token/README.md +11 -0
  80. package/docs/core/tokens/boolean-token/classes/PdfBooleanToken.md +139 -0
  81. package/docs/core/tokens/byte-offset-token/README.md +11 -0
  82. package/docs/core/tokens/byte-offset-token/classes/PdfByteOffsetToken.md +153 -0
  83. package/docs/core/tokens/comment-token/README.md +11 -0
  84. package/docs/core/tokens/comment-token/classes/PdfCommentToken.md +161 -0
  85. package/docs/core/tokens/end-array-token/README.md +11 -0
  86. package/docs/core/tokens/end-array-token/classes/PdfEndArrayToken.md +115 -0
  87. package/docs/core/tokens/end-dictionary-token/README.md +11 -0
  88. package/docs/core/tokens/end-dictionary-token/classes/PdfEndDictionaryToken.md +115 -0
  89. package/docs/core/tokens/end-object-token/README.md +11 -0
  90. package/docs/core/tokens/end-object-token/classes/PdfEndObjectToken.md +115 -0
  91. package/docs/core/tokens/end-stream-token/README.md +11 -0
  92. package/docs/core/tokens/end-stream-token/classes/PdfEndStreamToken.md +121 -0
  93. package/docs/core/tokens/hexadecimal-token/README.md +11 -0
  94. package/docs/core/tokens/hexadecimal-token/classes/PdfHexadecimalToken.md +127 -0
  95. package/docs/core/tokens/name-token/README.md +11 -0
  96. package/docs/core/tokens/name-token/classes/PdfNameToken.md +127 -0
  97. package/docs/core/tokens/null-token/README.md +11 -0
  98. package/docs/core/tokens/null-token/classes/PdfNullToken.md +115 -0
  99. package/docs/core/tokens/number-token/README.md +11 -0
  100. package/docs/core/tokens/number-token/classes/PdfNumberToken.md +271 -0
  101. package/docs/core/tokens/object-reference-token/README.md +11 -0
  102. package/docs/core/tokens/object-reference-token/classes/PdfObjectReferenceToken.md +137 -0
  103. package/docs/core/tokens/start-array-token/README.md +11 -0
  104. package/docs/core/tokens/start-array-token/classes/PdfStartArrayToken.md +115 -0
  105. package/docs/core/tokens/start-dictionary-token/README.md +11 -0
  106. package/docs/core/tokens/start-dictionary-token/classes/PdfStartDictionaryToken.md +115 -0
  107. package/docs/core/tokens/start-object-token/README.md +11 -0
  108. package/docs/core/tokens/start-object-token/classes/PdfStartObjectToken.md +147 -0
  109. package/docs/core/tokens/start-stream-token/README.md +11 -0
  110. package/docs/core/tokens/start-stream-token/classes/PdfStartStreamToken.md +147 -0
  111. package/docs/core/tokens/start-xref-token/README.md +11 -0
  112. package/docs/core/tokens/start-xref-token/classes/PdfStartXRefToken.md +115 -0
  113. package/docs/core/tokens/stream-chunk-token/README.md +11 -0
  114. package/docs/core/tokens/stream-chunk-token/classes/PdfStreamChunkToken.md +121 -0
  115. package/docs/core/tokens/string-token/README.md +11 -0
  116. package/docs/core/tokens/string-token/classes/PdfStringToken.md +127 -0
  117. package/docs/core/tokens/token/README.md +11 -0
  118. package/docs/core/tokens/token/classes/PdfToken.md +116 -0
  119. package/docs/core/tokens/trailer-token/README.md +11 -0
  120. package/docs/core/tokens/trailer-token/classes/PdfTrailerToken.md +127 -0
  121. package/docs/core/tokens/whitespace-token/README.md +11 -0
  122. package/docs/core/tokens/whitespace-token/classes/PdfWhitespaceToken.md +161 -0
  123. package/docs/core/tokens/xref-table-entry-token/README.md +11 -0
  124. package/docs/core/tokens/xref-table-entry-token/classes/PdfXRefTableEntryToken.md +157 -0
  125. package/docs/core/tokens/xref-table-section-start-token/README.md +11 -0
  126. package/docs/core/tokens/xref-table-section-start-token/classes/PdfXRefTableSectionStartToken.md +137 -0
  127. package/docs/core/tokens/xref-table-start-token/README.md +11 -0
  128. package/docs/core/tokens/xref-table-start-token/classes/PdfXRefTableStartToken.md +127 -0
  129. package/docs/crypto/ciphers/aes128/README.md +11 -0
  130. package/docs/crypto/ciphers/aes128/functions/aes128.md +39 -0
  131. package/docs/crypto/ciphers/aes256/README.md +11 -0
  132. package/docs/crypto/ciphers/aes256/functions/aes256.md +35 -0
  133. package/docs/crypto/ciphers/rc4/README.md +11 -0
  134. package/docs/crypto/ciphers/rc4/functions/rc4.md +35 -0
  135. package/docs/crypto/constants/README.md +11 -0
  136. package/docs/crypto/constants/variables/DEFAULT_PADDING.md +13 -0
  137. package/docs/crypto/key-derivation/key-derivation/README.md +13 -0
  138. package/docs/crypto/key-derivation/key-derivation/functions/computeMasterKey.md +57 -0
  139. package/docs/crypto/key-derivation/key-derivation/functions/deriveObjectKey.md +50 -0
  140. package/docs/crypto/key-derivation/key-derivation/functions/padPassword.md +33 -0
  141. package/docs/crypto/key-derivation/key-derivation-aes256/README.md +13 -0
  142. package/docs/crypto/key-derivation/key-derivation-aes256/functions/computeAlgorithm2bHash.md +45 -0
  143. package/docs/crypto/key-derivation/key-derivation-aes256/functions/getFileKey.md +66 -0
  144. package/docs/crypto/key-derivation/key-derivation-aes256/functions/validatePasswordHash.md +52 -0
  145. package/docs/crypto/key-gen/key-gen-aes256/README.md +12 -0
  146. package/docs/crypto/key-gen/key-gen-aes256/functions/generateOandOe.md +44 -0
  147. package/docs/crypto/key-gen/key-gen-aes256/functions/generateUandUe.md +38 -0
  148. package/docs/crypto/key-gen/key-gen-rc4-128/README.md +13 -0
  149. package/docs/crypto/key-gen/key-gen-rc4-128/functions/computeOValueRc4_128.md +38 -0
  150. package/docs/crypto/key-gen/key-gen-rc4-128/functions/computeUValueRc4_128.md +62 -0
  151. package/docs/crypto/key-gen/key-gen-rc4-128/functions/decryptUserPasswordRc4_128.md +38 -0
  152. package/docs/crypto/key-gen/key-gen-rc4-40/README.md +14 -0
  153. package/docs/crypto/key-gen/key-gen-rc4-40/functions/computeEncryptionKeyRc4_40.md +49 -0
  154. package/docs/crypto/key-gen/key-gen-rc4-40/functions/computeORc4_40.md +38 -0
  155. package/docs/crypto/key-gen/key-gen-rc4-40/functions/computeURc4_40.md +50 -0
  156. package/docs/crypto/key-gen/key-gen-rc4-40/functions/decryptUserPasswordRc4_40.md +38 -0
  157. package/docs/crypto/types/README.md +11 -0
  158. package/docs/crypto/types/interfaces/Cipher.md +39 -0
  159. package/docs/crypto/utils/README.md +13 -0
  160. package/docs/crypto/utils/functions/int32ToLittleEndianBytes.md +31 -0
  161. package/docs/crypto/utils/functions/padPassword.md +33 -0
  162. package/docs/crypto/utils/functions/removePdfPasswordPadding.md +32 -0
  163. package/docs/filters/ascii85/README.md +11 -0
  164. package/docs/filters/ascii85/functions/ascii85.md +27 -0
  165. package/docs/filters/asciihex/README.md +11 -0
  166. package/docs/filters/asciihex/functions/asciiHex.md +27 -0
  167. package/docs/filters/flate/README.md +11 -0
  168. package/docs/filters/flate/functions/flate.md +26 -0
  169. package/docs/filters/lzw/README.md +11 -0
  170. package/docs/filters/lzw/functions/lzw.md +27 -0
  171. package/docs/filters/pass-through/README.md +11 -0
  172. package/docs/filters/pass-through/functions/passthroughFilter.md +25 -0
  173. package/docs/filters/runlength/README.md +11 -0
  174. package/docs/filters/runlength/functions/runLength.md +27 -0
  175. package/docs/filters/types/README.md +19 -0
  176. package/docs/filters/types/interfaces/PdfFilter.md +39 -0
  177. package/docs/filters/types/type-aliases/PdfStreamFilterType.md +9 -0
  178. package/docs/filters/types/variables/PDF_FILTER_TYPES.md +51 -0
  179. package/docs/index/README.md +235 -0
  180. package/docs/pdf/README.md +31 -0
  181. package/docs/pdf/errors/README.md +11 -0
  182. package/docs/pdf/errors/classes/FoundCompressedObjectError.md +56 -0
  183. package/docs/pdf/pdf-document/README.md +11 -0
  184. package/docs/pdf/pdf-document/classes/PdfDocument.md +876 -0
  185. package/docs/pdf/pdf-reader/README.md +11 -0
  186. package/docs/pdf/pdf-reader/classes/PdfReader.md +82 -0
  187. package/docs/pdf/pdf-revision/README.md +11 -0
  188. package/docs/pdf/pdf-revision/classes/PdfRevision.md +508 -0
  189. package/docs/pdf/pdf-xref-lookup/README.md +11 -0
  190. package/docs/pdf/pdf-xref-lookup/classes/PdfXrefLookup.md +421 -0
  191. package/docs/security/crypt-filters/aesv2/README.md +11 -0
  192. package/docs/security/crypt-filters/aesv2/classes/AesV2CryptFilter.md +274 -0
  193. package/docs/security/crypt-filters/aesv3/README.md +11 -0
  194. package/docs/security/crypt-filters/aesv3/classes/AesV3CryptFilter.md +275 -0
  195. package/docs/security/crypt-filters/base/README.md +15 -0
  196. package/docs/security/crypt-filters/base/classes/PdfCryptFilter.md +221 -0
  197. package/docs/security/crypt-filters/base/type-aliases/CryptFilterOptions.md +43 -0
  198. package/docs/security/crypt-filters/identity/README.md +11 -0
  199. package/docs/security/crypt-filters/identity/classes/IdentityCryptFilter.md +249 -0
  200. package/docs/security/crypt-filters/v2/README.md +11 -0
  201. package/docs/security/crypt-filters/v2/classes/V2CryptFilter.md +279 -0
  202. package/docs/security/handlers/base/README.md +17 -0
  203. package/docs/security/handlers/base/classes/PdfSecurityHandler.md +384 -0
  204. package/docs/security/handlers/base/classes/PdfStandardSecurityHandler.md +694 -0
  205. package/docs/security/handlers/base/type-aliases/PdfSecurityHandlerOptions.md +27 -0
  206. package/docs/security/handlers/base/type-aliases/PdfStandardSecurityHandlerOptions.md +43 -0
  207. package/docs/security/handlers/pubSec/README.md +11 -0
  208. package/docs/security/handlers/pubSec/classes/PdfPublicKeySecurityHandler.md +503 -0
  209. package/docs/security/handlers/utils/README.md +14 -0
  210. package/docs/security/handlers/utils/functions/createFromDictionary.md +56 -0
  211. package/docs/security/handlers/utils/functions/createFromEncryptionOptions.md +40 -0
  212. package/docs/security/handlers/utils/functions/createStandardSecurityHandlerFromDictionary.md +55 -0
  213. package/docs/security/handlers/utils/functions/getCryptFilter.md +35 -0
  214. package/docs/security/handlers/v1/README.md +11 -0
  215. package/docs/security/handlers/v1/classes/PdfV1SecurityHandler.md +779 -0
  216. package/docs/security/handlers/v2/README.md +11 -0
  217. package/docs/security/handlers/v2/classes/PdfV2SecurityHandler.md +783 -0
  218. package/docs/security/handlers/v4/README.md +11 -0
  219. package/docs/security/handlers/v4/classes/PdfV4SecurityHandler.md +907 -0
  220. package/docs/security/handlers/v5/README.md +11 -0
  221. package/docs/security/handlers/v5/classes/PdfV5SecurityHandler.md +926 -0
  222. package/docs/security/types/README.md +19 -0
  223. package/docs/security/types/type-aliases/CryptFilterType.md +15 -0
  224. package/docs/security/types/type-aliases/PdfCryptFilterDictionary.md +12 -0
  225. package/docs/security/types/type-aliases/PdfEncryptionAlgorithmOptions.md +11 -0
  226. package/docs/security/types/type-aliases/PdfEncryptionAlgorithmType.md +17 -0
  227. package/docs/security/types/type-aliases/PdfEncryptionDictionary.md +13 -0
  228. package/docs/security/types/type-aliases/PdfEncryptionDictionaryObject.md +11 -0
  229. package/docs/security/types/type-aliases/PdfEncryptionOptions.md +90 -0
  230. package/docs/security/types/type-aliases/PdfEncryptionRecipient.md +24 -0
  231. package/docs/security/types/type-aliases/PdfId.md +13 -0
  232. package/docs/signing/README.md +127 -0
  233. package/docs/signing/document-security-store/README.md +19 -0
  234. package/docs/signing/document-security-store/classes/PdfCertObject.md +443 -0
  235. package/docs/signing/document-security-store/classes/PdfCrlObject.md +443 -0
  236. package/docs/signing/document-security-store/classes/PdfDocumentSecurityStoreDictionary.md +416 -0
  237. package/docs/signing/document-security-store/classes/PdfDocumentSecurityStoreObject.md +563 -0
  238. package/docs/signing/document-security-store/classes/PdfOcspObject.md +443 -0
  239. package/docs/signing/document-security-store/type-aliases/PdfVriObject.md +12 -0
  240. package/docs/signing/signatures/README.md +55 -0
  241. package/docs/signing/signatures/adbe-pkcs7-detached/README.md +11 -0
  242. package/docs/signing/signatures/adbe-pkcs7-detached/classes/PdfAdbePkcs7DetachedSignatureObject.md +669 -0
  243. package/docs/signing/signatures/adbe-pkcs7-sha1/README.md +11 -0
  244. package/docs/signing/signatures/adbe-pkcs7-sha1/classes/PdfAdbePkcs7Sha1SignatureObject.md +667 -0
  245. package/docs/signing/signatures/adbe-x509-rsa-sha1/README.md +11 -0
  246. package/docs/signing/signatures/adbe-x509-rsa-sha1/classes/PdfAdbePkcsX509RsaSha1SignatureObject.md +651 -0
  247. package/docs/signing/signatures/base/README.md +16 -0
  248. package/docs/signing/signatures/base/classes/PdfSignatureDictionary.md +420 -0
  249. package/docs/signing/signatures/base/classes/PdfSignatureObject.md +584 -0
  250. package/docs/signing/signatures/base/type-aliases/PdfSignatureSignOptions.md +51 -0
  251. package/docs/signing/signatures/etsi-cades-detached/README.md +11 -0
  252. package/docs/signing/signatures/etsi-cades-detached/classes/PdfEtsiCadesDetachedSignatureObject.md +693 -0
  253. package/docs/signing/signatures/etsi-rfc3161/README.md +11 -0
  254. package/docs/signing/signatures/etsi-rfc3161/classes/PdfEtsiRfc3161SignatureObject.md +614 -0
  255. package/docs/signing/signer/README.md +11 -0
  256. package/docs/signing/signer/classes/PdfSigner.md +58 -0
  257. package/docs/signing/types/README.md +16 -0
  258. package/docs/signing/types/type-aliases/PdfSignatureDictionaryEntries.md +95 -0
  259. package/docs/signing/types/type-aliases/PdfSignatureSubType.md +17 -0
  260. package/docs/signing/types/type-aliases/PdfSignatureType.md +14 -0
  261. package/docs/signing/types/type-aliases/RevocationInfo.md +43 -0
  262. package/docs/signing/types/type-aliases/SignaturePolicyDocument.md +35 -0
  263. package/docs/signing/types/type-aliases/TimeStampAuthority.md +35 -0
  264. package/docs/signing/utils/README.md +11 -0
  265. package/docs/signing/utils/functions/fetchRevocationInfo.md +70 -0
  266. package/docs/types/README.md +21 -0
  267. package/docs/types/type-aliases/ByteArray.md +9 -0
  268. package/docs/types/type-aliases/ChangeType.md +9 -0
  269. package/docs/types/type-aliases/DecodeParms.md +33 -0
  270. package/docs/types/type-aliases/HashAlgorithm.md +9 -0
  271. package/docs/types/type-aliases/PdfEncryptionAlgorithm.md +9 -0
  272. package/docs/types/type-aliases/PdfPermissions.md +63 -0
  273. package/docs/types/type-aliases/PdfVersion.md +9 -0
  274. package/docs/types/variables/PERMISSION_FLAGS.md +9 -0
  275. package/docs/utils/IterableReadableStream/README.md +11 -0
  276. package/docs/utils/IterableReadableStream/classes/IterableReadableStream.md +103 -0
  277. package/docs/utils/algos/README.md +28 -0
  278. package/docs/utils/algos/functions/aes128CbcNoPaddingEncrypt.md +43 -0
  279. package/docs/utils/algos/functions/aes128cbcDecrypt.md +47 -0
  280. package/docs/utils/algos/functions/aes128cbcEncrypt.md +47 -0
  281. package/docs/utils/algos/functions/aes256CbcNoPaddingDecrypt.md +43 -0
  282. package/docs/utils/algos/functions/aes256CbcNoPaddingEncrypt.md +43 -0
  283. package/docs/utils/algos/functions/aes256cbcDecrypt.md +43 -0
  284. package/docs/utils/algos/functions/aes256cbcEncrypt.md +43 -0
  285. package/docs/utils/algos/functions/aes256ecbDecrypt.md +41 -0
  286. package/docs/utils/algos/functions/aes256ecbEncrypt.md +41 -0
  287. package/docs/utils/algos/functions/deflateData.md +31 -0
  288. package/docs/utils/algos/functions/getRandomBytes.md +35 -0
  289. package/docs/utils/algos/functions/hash.md +41 -0
  290. package/docs/utils/algos/functions/inflateData.md +35 -0
  291. package/docs/utils/algos/functions/md5.md +31 -0
  292. package/docs/utils/algos/functions/sha1.md +31 -0
  293. package/docs/utils/algos/functions/sha256.md +31 -0
  294. package/docs/utils/algos/functions/sha384.md +31 -0
  295. package/docs/utils/algos/functions/sha512.md +31 -0
  296. package/docs/utils/assert/README.md +12 -0
  297. package/docs/utils/assert/functions/assert.md +39 -0
  298. package/docs/utils/assert/functions/assertIfDefined.md +46 -0
  299. package/docs/utils/bytesToHex/README.md +11 -0
  300. package/docs/utils/bytesToHex/functions/bytesToHex.md +31 -0
  301. package/docs/utils/bytesToHexBytes/README.md +11 -0
  302. package/docs/utils/bytesToHexBytes/functions/bytesToHexBytes.md +32 -0
  303. package/docs/utils/bytesToString/README.md +11 -0
  304. package/docs/utils/bytesToString/functions/bytesToString.md +31 -0
  305. package/docs/utils/concatUint8Arrays/README.md +11 -0
  306. package/docs/utils/concatUint8Arrays/functions/concatUint8Arrays.md +31 -0
  307. package/docs/utils/escapeString/README.md +11 -0
  308. package/docs/utils/escapeString/functions/escapeString.md +32 -0
  309. package/docs/utils/hexBytesToBytes/README.md +11 -0
  310. package/docs/utils/hexBytesToBytes/functions/hexBytesToBytes.md +33 -0
  311. package/docs/utils/hexBytesToString/README.md +11 -0
  312. package/docs/utils/hexBytesToString/functions/hexBytesToString.md +31 -0
  313. package/docs/utils/hexToBytes/README.md +11 -0
  314. package/docs/utils/hexToBytes/functions/hexToBytes.md +31 -0
  315. package/docs/utils/padBytes/README.md +11 -0
  316. package/docs/utils/padBytes/functions/padBytes.md +41 -0
  317. package/docs/utils/predictors/README.md +11 -0
  318. package/docs/utils/predictors/classes/Predictor.md +306 -0
  319. package/docs/utils/replaceInBuffer/README.md +11 -0
  320. package/docs/utils/replaceInBuffer/functions/replaceInBuffer.md +65 -0
  321. package/docs/utils/stringToBytes/README.md +11 -0
  322. package/docs/utils/stringToBytes/functions/stringToBytes.md +32 -0
  323. package/docs/utils/stringToHexBytes/README.md +11 -0
  324. package/docs/utils/stringToHexBytes/functions/stringToHexBytes.md +33 -0
  325. package/docs/utils/unescapeString/README.md +11 -0
  326. package/docs/utils/unescapeString/functions/unescapeString.md +34 -0
  327. package/package.json +63 -71
  328. package/packages/pdf-lite/node_modules/.bin/playwright +16 -0
  329. package/packages/pdf-lite/node_modules/.bin/tsc +16 -0
  330. package/packages/pdf-lite/node_modules/.bin/tsserver +16 -0
  331. package/packages/pdf-lite/node_modules/.bin/vitest +16 -0
  332. package/packages/pdf-lite/package.json +2 -2
  333. package/packages/pdf-lite/scripts/create-encryption-tests.sh +0 -0
  334. package/packages/pdf-lite/scripts/gen-signing-keys.sh +0 -0
  335. package/packages/pdf-lite/scripts/generate-all-signing-keys.sh +0 -0
  336. package/scripts/bump-version.sh +0 -0
  337. package/scripts/gen-html-docs.sh +0 -0
  338. package/scripts/gen-md-docs.sh +0 -0
  339. package/scripts/prepare-release.sh +0 -0
@@ -0,0 +1,926 @@
1
+ [**pdf-lite**](../../../../README.md)
2
+
3
+ ---
4
+
5
+ [pdf-lite](../../../../README.md) / [security/handlers/v5](../README.md) / PdfV5SecurityHandler
6
+
7
+ # Class: PdfV5SecurityHandler
8
+
9
+ V5 security handler implementing AES-256-CBC encryption.
10
+ This is the most secure encryption method (PDF 2.0).
11
+
12
+ ## Example
13
+
14
+ ```typescript
15
+ const handler = new PdfV5SecurityHandler({
16
+ password: 'strongPassword123',
17
+ ownerPassword: 'adminPassword456',
18
+ })
19
+ ```
20
+
21
+ ## Extends
22
+
23
+ - [`PdfV4SecurityHandler`](../../v4/classes/PdfV4SecurityHandler.md)
24
+
25
+ ## Constructors
26
+
27
+ ### Constructor
28
+
29
+ > **new PdfV5SecurityHandler**(`options`): `PdfV5SecurityHandler`
30
+
31
+ Creates a new V5 security handler with AES-256 encryption.
32
+
33
+ #### Parameters
34
+
35
+ ##### options
36
+
37
+ [`PdfSecurityHandlerOptions`](../../base/type-aliases/PdfSecurityHandlerOptions.md) & `object` & `object`
38
+
39
+ Configuration options including optional pre-computed keys.
40
+
41
+ #### Returns
42
+
43
+ `PdfV5SecurityHandler`
44
+
45
+ #### Overrides
46
+
47
+ [`PdfV4SecurityHandler`](../../v4/classes/PdfV4SecurityHandler.md).[`constructor`](../../v4/classes/PdfV4SecurityHandler.md#constructor)
48
+
49
+ ## Properties
50
+
51
+ ### cryptFilters
52
+
53
+ > `protected` **cryptFilters**: `Map`\<`string`, [`PdfCryptFilter`](../../../crypt-filters/base/classes/PdfCryptFilter.md)\>
54
+
55
+ Map of named crypt filters.
56
+
57
+ #### Inherited from
58
+
59
+ [`PdfV4SecurityHandler`](../../v4/classes/PdfV4SecurityHandler.md).[`cryptFilters`](../../v4/classes/PdfV4SecurityHandler.md#cryptfilters)
60
+
61
+ ---
62
+
63
+ ### cryptFiltersByType
64
+
65
+ > `protected` **cryptFiltersByType**: `object` = `{}`
66
+
67
+ Mapping of content types to crypt filter names.
68
+
69
+ #### file?
70
+
71
+ > `optional` **file**: `string`
72
+
73
+ #### stream?
74
+
75
+ > `optional` **stream**: `string`
76
+
77
+ #### string?
78
+
79
+ > `optional` **string**: `string`
80
+
81
+ #### Inherited from
82
+
83
+ [`PdfV4SecurityHandler`](../../v4/classes/PdfV4SecurityHandler.md).[`cryptFiltersByType`](../../v4/classes/PdfV4SecurityHandler.md#cryptfiltersbytype)
84
+
85
+ ---
86
+
87
+ ### dict
88
+
89
+ > **dict**: [`PdfEncryptionDictionary`](../../../types/type-aliases/PdfEncryptionDictionary.md)
90
+
91
+ The encryption dictionary containing all encryption parameters.
92
+
93
+ #### Inherited from
94
+
95
+ [`PdfV4SecurityHandler`](../../v4/classes/PdfV4SecurityHandler.md).[`dict`](../../v4/classes/PdfV4SecurityHandler.md#dict)
96
+
97
+ ---
98
+
99
+ ### documentId?
100
+
101
+ > `protected` `optional` **documentId**: [`PdfId`](../../../types/type-aliases/PdfId.md)
102
+
103
+ Document identifier for key derivation.
104
+
105
+ #### Inherited from
106
+
107
+ [`PdfV4SecurityHandler`](../../v4/classes/PdfV4SecurityHandler.md).[`documentId`](../../v4/classes/PdfV4SecurityHandler.md#documentid)
108
+
109
+ ---
110
+
111
+ ### encryptMetadata
112
+
113
+ > **encryptMetadata**: `boolean`
114
+
115
+ Whether to encrypt document metadata.
116
+
117
+ #### Inherited from
118
+
119
+ [`PdfV4SecurityHandler`](../../v4/classes/PdfV4SecurityHandler.md).[`encryptMetadata`](../../v4/classes/PdfV4SecurityHandler.md#encryptmetadata)
120
+
121
+ ---
122
+
123
+ ### fileKey?
124
+
125
+ > `protected` `optional` **fileKey**: `Promise`\<[`ByteArray`](../../../../types/type-aliases/ByteArray.md)\>
126
+
127
+ Promise resolving to the file encryption key.
128
+
129
+ ---
130
+
131
+ ### masterKey?
132
+
133
+ > `protected` `optional` **masterKey**: [`ByteArray`](../../../../types/type-aliases/ByteArray.md)
134
+
135
+ Derived master encryption key.
136
+
137
+ #### Inherited from
138
+
139
+ [`PdfV4SecurityHandler`](../../v4/classes/PdfV4SecurityHandler.md).[`masterKey`](../../v4/classes/PdfV4SecurityHandler.md#masterkey)
140
+
141
+ ---
142
+
143
+ ### ownerEncryptedFileKey?
144
+
145
+ > `protected` `optional` **ownerEncryptedFileKey**: [`ByteArray`](../../../../types/type-aliases/ByteArray.md)
146
+
147
+ Owner encrypted file key (OE value).
148
+
149
+ ---
150
+
151
+ ### ownerKey?
152
+
153
+ > `protected` `optional` **ownerKey**: [`ByteArray`](../../../../types/type-aliases/ByteArray.md)
154
+
155
+ Computed owner key (O value).
156
+
157
+ #### Inherited from
158
+
159
+ [`PdfV4SecurityHandler`](../../v4/classes/PdfV4SecurityHandler.md).[`ownerKey`](../../v4/classes/PdfV4SecurityHandler.md#ownerkey)
160
+
161
+ ---
162
+
163
+ ### ownerPassword?
164
+
165
+ > `protected` `optional` **ownerPassword**: [`ByteArray`](../../../../types/type-aliases/ByteArray.md)
166
+
167
+ Owner password for full access.
168
+
169
+ #### Inherited from
170
+
171
+ [`PdfV4SecurityHandler`](../../v4/classes/PdfV4SecurityHandler.md).[`ownerPassword`](../../v4/classes/PdfV4SecurityHandler.md#ownerpassword)
172
+
173
+ ---
174
+
175
+ ### password
176
+
177
+ > `protected` **password**: [`ByteArray`](../../../../types/type-aliases/ByteArray.md)
178
+
179
+ User password for authentication.
180
+
181
+ #### Inherited from
182
+
183
+ [`PdfV4SecurityHandler`](../../v4/classes/PdfV4SecurityHandler.md).[`password`](../../v4/classes/PdfV4SecurityHandler.md#password)
184
+
185
+ ---
186
+
187
+ ### permissions
188
+
189
+ > **permissions**: `number`
190
+
191
+ Numeric permission flags.
192
+
193
+ #### Inherited from
194
+
195
+ [`PdfV4SecurityHandler`](../../v4/classes/PdfV4SecurityHandler.md).[`permissions`](../../v4/classes/PdfV4SecurityHandler.md#permissions)
196
+
197
+ ---
198
+
199
+ ### perms?
200
+
201
+ > `protected` `optional` **perms**: [`ByteArray`](../../../../types/type-aliases/ByteArray.md)
202
+
203
+ Permissions entry (Perms value).
204
+
205
+ ---
206
+
207
+ ### userEncryptedFileKey?
208
+
209
+ > `protected` `optional` **userEncryptedFileKey**: [`ByteArray`](../../../../types/type-aliases/ByteArray.md)
210
+
211
+ User encrypted file key (UE value).
212
+
213
+ ---
214
+
215
+ ### userKey?
216
+
217
+ > `protected` `optional` **userKey**: [`ByteArray`](../../../../types/type-aliases/ByteArray.md)
218
+
219
+ Computed user key (U value).
220
+
221
+ #### Inherited from
222
+
223
+ [`PdfV4SecurityHandler`](../../v4/classes/PdfV4SecurityHandler.md).[`userKey`](../../v4/classes/PdfV4SecurityHandler.md#userkey)
224
+
225
+ ## Methods
226
+
227
+ ### buildPermissions()
228
+
229
+ > `protected` **buildPermissions**(`perm`): `number`
230
+
231
+ Builds the numeric permission flags from a PdfPermissions object.
232
+
233
+ #### Parameters
234
+
235
+ ##### perm
236
+
237
+ [`PdfPermissions`](../../../../types/type-aliases/PdfPermissions.md)
238
+
239
+ The permissions to encode.
240
+
241
+ #### Returns
242
+
243
+ `number`
244
+
245
+ The numeric permission flags.
246
+
247
+ #### Inherited from
248
+
249
+ [`PdfV4SecurityHandler`](../../v4/classes/PdfV4SecurityHandler.md).[`buildPermissions`](../../v4/classes/PdfV4SecurityHandler.md#buildpermissions)
250
+
251
+ ---
252
+
253
+ ### canEncryptMetadata()
254
+
255
+ > **canEncryptMetadata**(): `boolean`
256
+
257
+ Checks if metadata encryption is enabled.
258
+
259
+ #### Returns
260
+
261
+ `boolean`
262
+
263
+ True if metadata should be encrypted.
264
+
265
+ #### Inherited from
266
+
267
+ [`PdfV4SecurityHandler`](../../v4/classes/PdfV4SecurityHandler.md).[`canEncryptMetadata`](../../v4/classes/PdfV4SecurityHandler.md#canencryptmetadata)
268
+
269
+ ---
270
+
271
+ ### computeMasterKey()
272
+
273
+ > `protected` **computeMasterKey**(): `Promise`\<[`ByteArray`](../../../../types/type-aliases/ByteArray.md)\>
274
+
275
+ Computes the master encryption key.
276
+
277
+ #### Returns
278
+
279
+ `Promise`\<[`ByteArray`](../../../../types/type-aliases/ByteArray.md)\>
280
+
281
+ The file encryption key.
282
+
283
+ #### Throws
284
+
285
+ Error if file key is not initialized.
286
+
287
+ #### Overrides
288
+
289
+ [`PdfV4SecurityHandler`](../../v4/classes/PdfV4SecurityHandler.md).[`computeMasterKey`](../../v4/classes/PdfV4SecurityHandler.md#computemasterkey)
290
+
291
+ ---
292
+
293
+ ### computeObjectKey()
294
+
295
+ > **computeObjectKey**(): `Promise`\<[`ByteArray`](../../../../types/type-aliases/ByteArray.md)\>
296
+
297
+ Computes the object encryption key (same as master key for V5).
298
+
299
+ #### Returns
300
+
301
+ `Promise`\<[`ByteArray`](../../../../types/type-aliases/ByteArray.md)\>
302
+
303
+ The master encryption key.
304
+
305
+ #### Overrides
306
+
307
+ [`PdfV4SecurityHandler`](../../v4/classes/PdfV4SecurityHandler.md).[`computeObjectKey`](../../v4/classes/PdfV4SecurityHandler.md#computeobjectkey)
308
+
309
+ ---
310
+
311
+ ### computeOwnerKey()
312
+
313
+ > `protected` **computeOwnerKey**(): `Promise`\<[`ByteArray`](../../../../types/type-aliases/ByteArray.md)\>
314
+
315
+ Computes the owner key (O value) using RC4-128 algorithm.
316
+
317
+ #### Returns
318
+
319
+ `Promise`\<[`ByteArray`](../../../../types/type-aliases/ByteArray.md)\>
320
+
321
+ The computed owner key.
322
+
323
+ #### Inherited from
324
+
325
+ [`PdfV4SecurityHandler`](../../v4/classes/PdfV4SecurityHandler.md).[`computeOwnerKey`](../../v4/classes/PdfV4SecurityHandler.md#computeownerkey)
326
+
327
+ ---
328
+
329
+ ### computeUserKey()
330
+
331
+ > `protected` **computeUserKey**(): `Promise`\<[`ByteArray`](../../../../types/type-aliases/ByteArray.md)\>
332
+
333
+ Computes the user key (U value) using RC4-128 algorithm.
334
+
335
+ #### Returns
336
+
337
+ `Promise`\<[`ByteArray`](../../../../types/type-aliases/ByteArray.md)\>
338
+
339
+ The computed user key.
340
+
341
+ #### Throws
342
+
343
+ Error if document ID, owner key, or permissions are not set.
344
+
345
+ #### Inherited from
346
+
347
+ [`PdfV4SecurityHandler`](../../v4/classes/PdfV4SecurityHandler.md).[`computeUserKey`](../../v4/classes/PdfV4SecurityHandler.md#computeuserkey)
348
+
349
+ ---
350
+
351
+ ### decodePermissions()
352
+
353
+ > **decodePermissions**(): [`PdfPermissions`](../../../../types/type-aliases/PdfPermissions.md)
354
+
355
+ Decodes the numeric permission flags into a PdfPermissions object.
356
+
357
+ #### Returns
358
+
359
+ [`PdfPermissions`](../../../../types/type-aliases/PdfPermissions.md)
360
+
361
+ An object with boolean flags for each permission.
362
+
363
+ #### Inherited from
364
+
365
+ [`PdfV4SecurityHandler`](../../v4/classes/PdfV4SecurityHandler.md).[`decodePermissions`](../../v4/classes/PdfV4SecurityHandler.md#decodepermissions)
366
+
367
+ ---
368
+
369
+ ### decrypt()
370
+
371
+ > **decrypt**(`type`, `data`, `objectNumber?`, `generationNumber?`): `Promise`\<[`ByteArray`](../../../../types/type-aliases/ByteArray.md)\>
372
+
373
+ Decrypts data using the appropriate crypt filter for the content type.
374
+
375
+ #### Parameters
376
+
377
+ ##### type
378
+
379
+ The type of content being decrypted.
380
+
381
+ `"string"` | `"stream"` | `"file"`
382
+
383
+ ##### data
384
+
385
+ [`ByteArray`](../../../../types/type-aliases/ByteArray.md)
386
+
387
+ The encrypted data.
388
+
389
+ ##### objectNumber?
390
+
391
+ `number`
392
+
393
+ The PDF object number.
394
+
395
+ ##### generationNumber?
396
+
397
+ `number`
398
+
399
+ The PDF generation number.
400
+
401
+ #### Returns
402
+
403
+ `Promise`\<[`ByteArray`](../../../../types/type-aliases/ByteArray.md)\>
404
+
405
+ The decrypted data.
406
+
407
+ #### Inherited from
408
+
409
+ [`PdfV4SecurityHandler`](../../v4/classes/PdfV4SecurityHandler.md).[`decrypt`](../../v4/classes/PdfV4SecurityHandler.md#decrypt)
410
+
411
+ ---
412
+
413
+ ### decryptObject()
414
+
415
+ > **decryptObject**(`object`): `Promise`\<`void`\>
416
+
417
+ Recursively decrypts all strings and streams within an indirect object.
418
+
419
+ #### Parameters
420
+
421
+ ##### object
422
+
423
+ [`PdfIndirectObject`](../../../../core/objects/pdf-indirect-object/classes/PdfIndirectObject.md)
424
+
425
+ The indirect object to decrypt.
426
+
427
+ #### Returns
428
+
429
+ `Promise`\<`void`\>
430
+
431
+ #### Inherited from
432
+
433
+ [`PdfV4SecurityHandler`](../../v4/classes/PdfV4SecurityHandler.md).[`decryptObject`](../../v4/classes/PdfV4SecurityHandler.md#decryptobject)
434
+
435
+ ---
436
+
437
+ ### encrypt()
438
+
439
+ > **encrypt**(`type`, `data`, `objectNumber?`, `generationNumber?`): `Promise`\<[`ByteArray`](../../../../types/type-aliases/ByteArray.md)\>
440
+
441
+ Encrypts data using the appropriate crypt filter for the content type.
442
+
443
+ #### Parameters
444
+
445
+ ##### type
446
+
447
+ The type of content being encrypted.
448
+
449
+ `"string"` | `"stream"` | `"file"`
450
+
451
+ ##### data
452
+
453
+ [`ByteArray`](../../../../types/type-aliases/ByteArray.md)
454
+
455
+ The data to encrypt.
456
+
457
+ ##### objectNumber?
458
+
459
+ `number`
460
+
461
+ The PDF object number.
462
+
463
+ ##### generationNumber?
464
+
465
+ `number`
466
+
467
+ The PDF generation number.
468
+
469
+ #### Returns
470
+
471
+ `Promise`\<[`ByteArray`](../../../../types/type-aliases/ByteArray.md)\>
472
+
473
+ The encrypted data.
474
+
475
+ #### Inherited from
476
+
477
+ [`PdfV4SecurityHandler`](../../v4/classes/PdfV4SecurityHandler.md).[`encrypt`](../../v4/classes/PdfV4SecurityHandler.md#encrypt)
478
+
479
+ ---
480
+
481
+ ### encryptObject()
482
+
483
+ > **encryptObject**(`object`): `Promise`\<`void`\>
484
+
485
+ Recursively encrypts all strings and streams within an indirect object.
486
+
487
+ #### Parameters
488
+
489
+ ##### object
490
+
491
+ [`PdfIndirectObject`](../../../../core/objects/pdf-indirect-object/classes/PdfIndirectObject.md)
492
+
493
+ The indirect object to encrypt.
494
+
495
+ #### Returns
496
+
497
+ `Promise`\<`void`\>
498
+
499
+ #### Inherited from
500
+
501
+ [`PdfV4SecurityHandler`](../../v4/classes/PdfV4SecurityHandler.md).[`encryptObject`](../../v4/classes/PdfV4SecurityHandler.md#encryptobject)
502
+
503
+ ---
504
+
505
+ ### getCipher()
506
+
507
+ > `protected` **getCipher**(): `Promise`\<[`Cipher`](../../../../crypto/types/interfaces/Cipher.md)\>
508
+
509
+ Gets an AES-256 cipher.
510
+
511
+ #### Returns
512
+
513
+ `Promise`\<[`Cipher`](../../../../crypto/types/interfaces/Cipher.md)\>
514
+
515
+ An AES-256 cipher instance.
516
+
517
+ #### Overrides
518
+
519
+ [`PdfV4SecurityHandler`](../../v4/classes/PdfV4SecurityHandler.md).[`getCipher`](../../v4/classes/PdfV4SecurityHandler.md#getcipher)
520
+
521
+ ---
522
+
523
+ ### getCryptFilter()
524
+
525
+ > **getCryptFilter**(`name`): [`PdfCryptFilter`](../../../crypt-filters/base/classes/PdfCryptFilter.md) \| `undefined`
526
+
527
+ Gets a crypt filter by name.
528
+
529
+ #### Parameters
530
+
531
+ ##### name
532
+
533
+ `string`
534
+
535
+ The crypt filter name.
536
+
537
+ #### Returns
538
+
539
+ [`PdfCryptFilter`](../../../crypt-filters/base/classes/PdfCryptFilter.md) \| `undefined`
540
+
541
+ The crypt filter, or undefined if not found.
542
+
543
+ #### Inherited from
544
+
545
+ [`PdfV4SecurityHandler`](../../v4/classes/PdfV4SecurityHandler.md).[`getCryptFilter`](../../v4/classes/PdfV4SecurityHandler.md#getcryptfilter)
546
+
547
+ ---
548
+
549
+ ### getCryptFilterByType()
550
+
551
+ > **getCryptFilterByType**(`type`): [`PdfCryptFilter`](../../../crypt-filters/base/classes/PdfCryptFilter.md) \| `null`
552
+
553
+ Gets the crypt filter assigned to a content type.
554
+
555
+ #### Parameters
556
+
557
+ ##### type
558
+
559
+ [`CryptFilterType`](../../../types/type-aliases/CryptFilterType.md)
560
+
561
+ The content type ('string', 'stream', or 'file').
562
+
563
+ #### Returns
564
+
565
+ [`PdfCryptFilter`](../../../crypt-filters/base/classes/PdfCryptFilter.md) \| `null`
566
+
567
+ The assigned crypt filter, or null if none.
568
+
569
+ #### Inherited from
570
+
571
+ [`PdfV4SecurityHandler`](../../v4/classes/PdfV4SecurityHandler.md).[`getCryptFilterByType`](../../v4/classes/PdfV4SecurityHandler.md#getcryptfilterbytype)
572
+
573
+ ---
574
+
575
+ ### getDocumentId()
576
+
577
+ > **getDocumentId**(): [`PdfId`](../../../types/type-aliases/PdfId.md) \| `undefined`
578
+
579
+ Gets the document ID.
580
+
581
+ #### Returns
582
+
583
+ [`PdfId`](../../../types/type-aliases/PdfId.md) \| `undefined`
584
+
585
+ The document ID, or undefined if not set.
586
+
587
+ #### Inherited from
588
+
589
+ [`PdfV4SecurityHandler`](../../v4/classes/PdfV4SecurityHandler.md).[`getDocumentId`](../../v4/classes/PdfV4SecurityHandler.md#getdocumentid)
590
+
591
+ ---
592
+
593
+ ### getKeyBits()
594
+
595
+ > **getKeyBits**(): `number`
596
+
597
+ Gets the encryption key length in bits.
598
+
599
+ #### Returns
600
+
601
+ `number`
602
+
603
+ 256 for V5 encryption.
604
+
605
+ #### Overrides
606
+
607
+ [`PdfV4SecurityHandler`](../../v4/classes/PdfV4SecurityHandler.md).[`getKeyBits`](../../v4/classes/PdfV4SecurityHandler.md#getkeybits)
608
+
609
+ ---
610
+
611
+ ### getName()
612
+
613
+ > **getName**(): `string`
614
+
615
+ Gets the security handler filter name.
616
+
617
+ #### Returns
618
+
619
+ `string`
620
+
621
+ 'Standard' for password-based encryption.
622
+
623
+ #### Inherited from
624
+
625
+ [`PdfV4SecurityHandler`](../../v4/classes/PdfV4SecurityHandler.md).[`getName`](../../v4/classes/PdfV4SecurityHandler.md#getname)
626
+
627
+ ---
628
+
629
+ ### getRevision()
630
+
631
+ > **getRevision**(): `number`
632
+
633
+ Gets the encryption revision number.
634
+
635
+ #### Returns
636
+
637
+ `number`
638
+
639
+ 6 for V5 encryption.
640
+
641
+ #### Overrides
642
+
643
+ [`PdfV4SecurityHandler`](../../v4/classes/PdfV4SecurityHandler.md).[`getRevision`](../../v4/classes/PdfV4SecurityHandler.md#getrevision)
644
+
645
+ ---
646
+
647
+ ### getVersion()
648
+
649
+ > **getVersion**(): `number`
650
+
651
+ Gets the encryption version number.
652
+
653
+ #### Returns
654
+
655
+ `number`
656
+
657
+ 5 for AES-256 encryption.
658
+
659
+ #### Overrides
660
+
661
+ [`PdfV4SecurityHandler`](../../v4/classes/PdfV4SecurityHandler.md).[`getVersion`](../../v4/classes/PdfV4SecurityHandler.md#getversion)
662
+
663
+ ---
664
+
665
+ ### initKeys()
666
+
667
+ > `protected` **initKeys**(): `Promise`\<`void`\>
668
+
669
+ Initializes encryption keys, either deriving from existing values or generating new ones.
670
+
671
+ #### Returns
672
+
673
+ `Promise`\<`void`\>
674
+
675
+ #### Overrides
676
+
677
+ [`PdfV4SecurityHandler`](../../v4/classes/PdfV4SecurityHandler.md).[`initKeys`](../../v4/classes/PdfV4SecurityHandler.md#initkeys)
678
+
679
+ ---
680
+
681
+ ### isReady()
682
+
683
+ > **isReady**(): `boolean`
684
+
685
+ Checks if the handler is ready (has user encrypted file key).
686
+
687
+ #### Returns
688
+
689
+ `boolean`
690
+
691
+ True if the handler has the required keys.
692
+
693
+ #### Overrides
694
+
695
+ [`PdfV4SecurityHandler`](../../v4/classes/PdfV4SecurityHandler.md).[`isReady`](../../v4/classes/PdfV4SecurityHandler.md#isready)
696
+
697
+ ---
698
+
699
+ ### readEncryptionDictionary()
700
+
701
+ > **readEncryptionDictionary**(`encryptionDictionary`): `void`
702
+
703
+ Reads V5-specific encryption parameters from the dictionary.
704
+
705
+ #### Parameters
706
+
707
+ ##### encryptionDictionary
708
+
709
+ [`PdfEncryptionDictionary`](../../../types/type-aliases/PdfEncryptionDictionary.md)
710
+
711
+ The encryption dictionary from the PDF.
712
+
713
+ #### Returns
714
+
715
+ `void`
716
+
717
+ #### Throws
718
+
719
+ Error if required entries are missing or invalid.
720
+
721
+ #### Overrides
722
+
723
+ [`PdfV4SecurityHandler`](../../v4/classes/PdfV4SecurityHandler.md).[`readEncryptionDictionary`](../../v4/classes/PdfV4SecurityHandler.md#readencryptiondictionary)
724
+
725
+ ---
726
+
727
+ ### recoverUserPassword()
728
+
729
+ > **recoverUserPassword**(`ownerPassword?`): `Promise`\<`string`\>
730
+
731
+ Recovers the user password from the owner password.
732
+ Not supported for AES-256 encryption.
733
+
734
+ #### Parameters
735
+
736
+ ##### ownerPassword?
737
+
738
+ `string` | [`ByteArray`](../../../../types/type-aliases/ByteArray.md)
739
+
740
+ #### Returns
741
+
742
+ `Promise`\<`string`\>
743
+
744
+ #### Throws
745
+
746
+ Error always, as this operation is not supported for V5.
747
+
748
+ #### Overrides
749
+
750
+ [`PdfV4SecurityHandler`](../../v4/classes/PdfV4SecurityHandler.md).[`recoverUserPassword`](../../v4/classes/PdfV4SecurityHandler.md#recoveruserpassword)
751
+
752
+ ---
753
+
754
+ ### setCryptFilter()
755
+
756
+ > **setCryptFilter**(`name`, `filter`): `void`
757
+
758
+ Registers a named crypt filter.
759
+
760
+ #### Parameters
761
+
762
+ ##### name
763
+
764
+ `string`
765
+
766
+ The filter name.
767
+
768
+ ##### filter
769
+
770
+ [`PdfCryptFilter`](../../../crypt-filters/base/classes/PdfCryptFilter.md)
771
+
772
+ The crypt filter instance.
773
+
774
+ #### Returns
775
+
776
+ `void`
777
+
778
+ #### Inherited from
779
+
780
+ [`PdfV4SecurityHandler`](../../v4/classes/PdfV4SecurityHandler.md).[`setCryptFilter`](../../v4/classes/PdfV4SecurityHandler.md#setcryptfilter)
781
+
782
+ ---
783
+
784
+ ### setCryptFilterForType()
785
+
786
+ > **setCryptFilterForType**(`type`, `name`): `void`
787
+
788
+ Assigns a crypt filter to a content type.
789
+
790
+ #### Parameters
791
+
792
+ ##### type
793
+
794
+ [`CryptFilterType`](../../../types/type-aliases/CryptFilterType.md)
795
+
796
+ The content type.
797
+
798
+ ##### name
799
+
800
+ `string`
801
+
802
+ The crypt filter name.
803
+
804
+ #### Returns
805
+
806
+ `void`
807
+
808
+ #### Inherited from
809
+
810
+ [`PdfV4SecurityHandler`](../../v4/classes/PdfV4SecurityHandler.md).[`setCryptFilterForType`](../../v4/classes/PdfV4SecurityHandler.md#setcryptfilterfortype)
811
+
812
+ ---
813
+
814
+ ### setDocumentId()
815
+
816
+ > **setDocumentId**(`id`): `void`
817
+
818
+ Sets the document ID for key derivation.
819
+
820
+ #### Parameters
821
+
822
+ ##### id
823
+
824
+ [`PdfId`](../../../types/type-aliases/PdfId.md)
825
+
826
+ The document ID array.
827
+
828
+ #### Returns
829
+
830
+ `void`
831
+
832
+ #### Inherited from
833
+
834
+ [`PdfV4SecurityHandler`](../../v4/classes/PdfV4SecurityHandler.md).[`setDocumentId`](../../v4/classes/PdfV4SecurityHandler.md#setdocumentid)
835
+
836
+ ---
837
+
838
+ ### setMasterKey()
839
+
840
+ > **setMasterKey**(`masterKey`): `void`
841
+
842
+ Sets the master encryption key directly.
843
+
844
+ #### Parameters
845
+
846
+ ##### masterKey
847
+
848
+ [`ByteArray`](../../../../types/type-aliases/ByteArray.md)
849
+
850
+ The master key to use.
851
+
852
+ #### Returns
853
+
854
+ `void`
855
+
856
+ #### Inherited from
857
+
858
+ [`PdfV4SecurityHandler`](../../v4/classes/PdfV4SecurityHandler.md).[`setMasterKey`](../../v4/classes/PdfV4SecurityHandler.md#setmasterkey)
859
+
860
+ ---
861
+
862
+ ### setOwnerPassword()
863
+
864
+ > **setOwnerPassword**(`ownerPassword`): `void`
865
+
866
+ Sets the owner password.
867
+
868
+ #### Parameters
869
+
870
+ ##### ownerPassword
871
+
872
+ The owner password string or bytes.
873
+
874
+ `string` | [`ByteArray`](../../../../types/type-aliases/ByteArray.md)
875
+
876
+ #### Returns
877
+
878
+ `void`
879
+
880
+ #### Inherited from
881
+
882
+ [`PdfV4SecurityHandler`](../../v4/classes/PdfV4SecurityHandler.md).[`setOwnerPassword`](../../v4/classes/PdfV4SecurityHandler.md#setownerpassword)
883
+
884
+ ---
885
+
886
+ ### setPassword()
887
+
888
+ > **setPassword**(`password`): `void`
889
+
890
+ Sets the user password.
891
+
892
+ #### Parameters
893
+
894
+ ##### password
895
+
896
+ The user password string or bytes.
897
+
898
+ `string` | [`ByteArray`](../../../../types/type-aliases/ByteArray.md)
899
+
900
+ #### Returns
901
+
902
+ `void`
903
+
904
+ #### Inherited from
905
+
906
+ [`PdfV4SecurityHandler`](../../v4/classes/PdfV4SecurityHandler.md).[`setPassword`](../../v4/classes/PdfV4SecurityHandler.md#setpassword)
907
+
908
+ ---
909
+
910
+ ### write()
911
+
912
+ > **write**(): `Promise`\<`void`\>
913
+
914
+ Writes the encryption dictionary including V5-specific entries.
915
+
916
+ #### Returns
917
+
918
+ `Promise`\<`void`\>
919
+
920
+ #### Throws
921
+
922
+ Error if required keys are not computed.
923
+
924
+ #### Overrides
925
+
926
+ [`PdfV4SecurityHandler`](../../v4/classes/PdfV4SecurityHandler.md).[`write`](../../v4/classes/PdfV4SecurityHandler.md#write)