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