pdf-lite 1.0.4 → 1.0.5

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 (171) hide show
  1. package/dist/core/generators.d.ts +2 -2
  2. package/dist/core/generators.js +3 -3
  3. package/dist/core/incremental-parser.d.ts +1 -1
  4. package/dist/core/incremental-parser.js +1 -1
  5. package/dist/core/objects/pdf-array.d.ts +3 -3
  6. package/dist/core/objects/pdf-array.js +4 -4
  7. package/dist/core/objects/pdf-boolean.d.ts +2 -2
  8. package/dist/core/objects/pdf-boolean.js +2 -2
  9. package/dist/core/objects/pdf-comment.d.ts +3 -3
  10. package/dist/core/objects/pdf-comment.js +4 -4
  11. package/dist/core/objects/pdf-date.d.ts +1 -1
  12. package/dist/core/objects/pdf-date.js +1 -1
  13. package/dist/core/objects/pdf-dictionary.d.ts +3 -3
  14. package/dist/core/objects/pdf-dictionary.js +5 -5
  15. package/dist/core/objects/pdf-hexadecimal.d.ts +3 -3
  16. package/dist/core/objects/pdf-hexadecimal.js +6 -6
  17. package/dist/core/objects/pdf-indirect-object.d.ts +5 -5
  18. package/dist/core/objects/pdf-indirect-object.js +9 -9
  19. package/dist/core/objects/pdf-name.d.ts +2 -2
  20. package/dist/core/objects/pdf-name.js +2 -2
  21. package/dist/core/objects/pdf-null.d.ts +2 -2
  22. package/dist/core/objects/pdf-null.js +2 -2
  23. package/dist/core/objects/pdf-number.d.ts +3 -3
  24. package/dist/core/objects/pdf-number.js +3 -3
  25. package/dist/core/objects/pdf-object-reference.d.ts +2 -2
  26. package/dist/core/objects/pdf-object-reference.js +2 -2
  27. package/dist/core/objects/pdf-start-xref.d.ts +4 -4
  28. package/dist/core/objects/pdf-start-xref.js +4 -4
  29. package/dist/core/objects/pdf-stream.d.ts +8 -8
  30. package/dist/core/objects/pdf-stream.js +19 -19
  31. package/dist/core/objects/pdf-string.d.ts +3 -3
  32. package/dist/core/objects/pdf-string.js +4 -4
  33. package/dist/core/objects/pdf-trailer.d.ts +8 -8
  34. package/dist/core/objects/pdf-trailer.js +6 -6
  35. package/dist/core/objects/pdf-xref-table.d.ts +7 -7
  36. package/dist/core/objects/pdf-xref-table.js +8 -8
  37. package/dist/core/serializer.d.ts +3 -3
  38. package/dist/core/serializer.js +2 -2
  39. package/dist/core/streams/object-stream.d.ts +3 -3
  40. package/dist/core/streams/object-stream.js +2 -2
  41. package/dist/core/tokens/boolean-token.d.ts +1 -1
  42. package/dist/core/tokens/boolean-token.js +1 -1
  43. package/dist/core/tokens/byte-offset-token.d.ts +2 -2
  44. package/dist/core/tokens/byte-offset-token.js +2 -2
  45. package/dist/core/tokens/comment-token.d.ts +2 -2
  46. package/dist/core/tokens/comment-token.js +4 -4
  47. package/dist/core/tokens/end-array-token.d.ts +1 -1
  48. package/dist/core/tokens/end-array-token.js +2 -2
  49. package/dist/core/tokens/end-dictionary-token.d.ts +1 -1
  50. package/dist/core/tokens/end-dictionary-token.js +2 -2
  51. package/dist/core/tokens/end-object-token.d.ts +1 -1
  52. package/dist/core/tokens/end-object-token.js +2 -2
  53. package/dist/core/tokens/end-stream-token.d.ts +2 -2
  54. package/dist/core/tokens/end-stream-token.js +2 -2
  55. package/dist/core/tokens/hexadecimal-token.d.ts +2 -2
  56. package/dist/core/tokens/hexadecimal-token.js +2 -2
  57. package/dist/core/tokens/name-token.d.ts +1 -1
  58. package/dist/core/tokens/name-token.js +2 -2
  59. package/dist/core/tokens/null-token.d.ts +1 -1
  60. package/dist/core/tokens/null-token.js +2 -2
  61. package/dist/core/tokens/number-token.d.ts +3 -3
  62. package/dist/core/tokens/number-token.js +3 -3
  63. package/dist/core/tokens/object-reference-token.d.ts +1 -1
  64. package/dist/core/tokens/object-reference-token.js +2 -2
  65. package/dist/core/tokens/start-array-token.d.ts +1 -1
  66. package/dist/core/tokens/start-array-token.js +2 -2
  67. package/dist/core/tokens/start-dictionary-token.d.ts +1 -1
  68. package/dist/core/tokens/start-dictionary-token.js +2 -2
  69. package/dist/core/tokens/start-object-token.d.ts +1 -1
  70. package/dist/core/tokens/start-object-token.js +2 -2
  71. package/dist/core/tokens/start-stream-token.d.ts +3 -3
  72. package/dist/core/tokens/start-stream-token.js +3 -3
  73. package/dist/core/tokens/start-xref-token.d.ts +1 -1
  74. package/dist/core/tokens/start-xref-token.js +2 -2
  75. package/dist/core/tokens/stream-chunk-token.d.ts +2 -2
  76. package/dist/core/tokens/stream-chunk-token.js +1 -1
  77. package/dist/core/tokens/string-token.d.ts +2 -2
  78. package/dist/core/tokens/string-token.js +3 -3
  79. package/dist/core/tokens/token.d.ts +1 -1
  80. package/dist/core/tokens/token.js +1 -1
  81. package/dist/core/tokens/trailer-token.d.ts +1 -1
  82. package/dist/core/tokens/trailer-token.js +2 -2
  83. package/dist/core/tokens/whitespace-token.d.ts +2 -2
  84. package/dist/core/tokens/whitespace-token.js +1 -1
  85. package/dist/core/tokens/xref-table-entry-token.d.ts +3 -3
  86. package/dist/core/tokens/xref-table-entry-token.js +2 -2
  87. package/dist/core/tokens/xref-table-section-start-token.d.ts +2 -2
  88. package/dist/core/tokens/xref-table-section-start-token.js +3 -3
  89. package/dist/core/tokens/xref-table-start-token.d.ts +1 -1
  90. package/dist/core/tokens/xref-table-start-token.js +2 -2
  91. package/dist/crypto/key-derivation/key-derivation-aes256.d.ts +1 -1
  92. package/dist/crypto/key-derivation/key-derivation-aes256.js +2 -2
  93. package/dist/crypto/key-gen/key-gen-rc4-128.d.ts +1 -1
  94. package/dist/crypto/key-gen/key-gen-rc4-128.js +5 -5
  95. package/dist/crypto/types.d.ts +1 -1
  96. package/dist/filters/asciihex.d.ts +1 -1
  97. package/dist/filters/asciihex.js +2 -2
  98. package/dist/filters/lzw.d.ts +1 -1
  99. package/dist/filters/types.d.ts +1 -1
  100. package/dist/pdf/pdf-document.d.ts +14 -14
  101. package/dist/pdf/pdf-document.js +19 -19
  102. package/dist/pdf/pdf-reader.d.ts +3 -3
  103. package/dist/pdf/pdf-reader.js +2 -2
  104. package/dist/pdf/pdf-revision.d.ts +5 -5
  105. package/dist/pdf/pdf-revision.js +4 -4
  106. package/dist/pdf/pdf-xref-lookup.d.ts +7 -7
  107. package/dist/pdf/pdf-xref-lookup.js +9 -9
  108. package/dist/security/crypt-filters/aesv2.d.ts +2 -2
  109. package/dist/security/crypt-filters/aesv2.js +2 -2
  110. package/dist/security/crypt-filters/aesv3.d.ts +2 -2
  111. package/dist/security/crypt-filters/aesv3.js +2 -2
  112. package/dist/security/crypt-filters/base.d.ts +4 -4
  113. package/dist/security/crypt-filters/base.js +3 -3
  114. package/dist/security/crypt-filters/identity.d.ts +2 -2
  115. package/dist/security/crypt-filters/identity.js +1 -1
  116. package/dist/security/crypt-filters/v2.d.ts +1 -1
  117. package/dist/security/crypt-filters/v2.js +1 -1
  118. package/dist/security/handlers/base.d.ts +4 -4
  119. package/dist/security/handlers/base.js +12 -12
  120. package/dist/security/handlers/pubSec.d.ts +3 -3
  121. package/dist/security/handlers/pubSec.js +10 -10
  122. package/dist/security/handlers/utils.d.ts +4 -4
  123. package/dist/security/handlers/utils.js +12 -12
  124. package/dist/security/handlers/v1.d.ts +4 -4
  125. package/dist/security/handlers/v1.js +7 -7
  126. package/dist/security/handlers/v2.d.ts +3 -3
  127. package/dist/security/handlers/v2.js +5 -5
  128. package/dist/security/handlers/v4.d.ts +6 -6
  129. package/dist/security/handlers/v4.js +11 -11
  130. package/dist/security/handlers/v5.d.ts +5 -5
  131. package/dist/security/handlers/v5.js +9 -9
  132. package/dist/security/types.d.ts +9 -9
  133. package/dist/signing/document-security-store.d.ts +11 -11
  134. package/dist/signing/document-security-store.js +4 -4
  135. package/dist/signing/signatures/adbe-pkcs7-detached.d.ts +4 -4
  136. package/dist/signing/signatures/adbe-pkcs7-detached.js +11 -11
  137. package/dist/signing/signatures/adbe-pkcs7-sha1.d.ts +4 -4
  138. package/dist/signing/signatures/adbe-pkcs7-sha1.js +12 -12
  139. package/dist/signing/signatures/adbe-x509-rsa-sha1.d.ts +4 -4
  140. package/dist/signing/signatures/adbe-x509-rsa-sha1.js +8 -8
  141. package/dist/signing/signatures/base.d.ts +5 -5
  142. package/dist/signing/signatures/base.js +11 -11
  143. package/dist/signing/signatures/etsi-cades-detached.d.ts +4 -4
  144. package/dist/signing/signatures/etsi-cades-detached.js +17 -17
  145. package/dist/signing/signatures/etsi-rfc3161.d.ts +2 -2
  146. package/dist/signing/signatures/etsi-rfc3161.js +9 -9
  147. package/dist/signing/signatures/index.d.ts +6 -6
  148. package/dist/signing/signatures/index.js +6 -6
  149. package/dist/signing/signer.d.ts +3 -3
  150. package/dist/signing/signer.js +10 -10
  151. package/dist/signing/types.d.ts +7 -7
  152. package/dist/signing/utils.d.ts +2 -2
  153. package/dist/signing/utils.js +1 -1
  154. package/dist/utils/algos.js +1 -1
  155. package/dist/utils/bytesToHex.d.ts +1 -1
  156. package/dist/utils/bytesToHex.js +2 -2
  157. package/dist/utils/bytesToHexBytes.d.ts +1 -1
  158. package/dist/utils/bytesToString.d.ts +1 -1
  159. package/dist/utils/concatUint8Arrays.d.ts +1 -1
  160. package/dist/utils/escapeString.d.ts +1 -1
  161. package/dist/utils/escapeString.js +1 -1
  162. package/dist/utils/hexBytesToBytes.d.ts +1 -1
  163. package/dist/utils/hexBytesToString.d.ts +1 -1
  164. package/dist/utils/hexToBytes.d.ts +1 -1
  165. package/dist/utils/hexToBytes.js +2 -2
  166. package/dist/utils/padBytes.d.ts +1 -1
  167. package/dist/utils/replaceInBuffer.d.ts +1 -1
  168. package/dist/utils/stringToBytes.d.ts +1 -1
  169. package/dist/utils/stringToHexBytes.d.ts +1 -1
  170. package/dist/utils/unescapeString.d.ts +1 -1
  171. package/package.json +3 -3
@@ -1,12 +1,12 @@
1
- import { PdfIndirectObject } from '../core/objects/pdf-indirect-object';
2
- import { PdfXRefTable, PdfXRefTableEntry } from '../core/objects/pdf-xref-table';
3
- import { PdfStartXRef } from '../core/objects/pdf-start-xref';
4
- import { PdfTrailer } from '../core/objects/pdf-trailer';
5
- import { PdfNumber } from '../core/objects/pdf-number';
6
- import { PdfComment } from '../core/objects/pdf-comment';
7
- import { PdfObjStream, PdfStream, PdfXRefStream, PdfXRefStreamCompressedEntry, } from '../core/objects/pdf-stream';
8
- import { PdfDictionary } from '../core/objects/pdf-dictionary';
9
- import { PdfObjectReference } from '../core/objects/pdf-object-reference';
1
+ import { PdfIndirectObject } from '../core/objects/pdf-indirect-object.js';
2
+ import { PdfXRefTable, PdfXRefTableEntry, } from '../core/objects/pdf-xref-table.js';
3
+ import { PdfStartXRef } from '../core/objects/pdf-start-xref.js';
4
+ import { PdfTrailer } from '../core/objects/pdf-trailer.js';
5
+ import { PdfNumber } from '../core/objects/pdf-number.js';
6
+ import { PdfComment } from '../core/objects/pdf-comment.js';
7
+ import { PdfObjStream, PdfStream, PdfXRefStream, PdfXRefStreamCompressedEntry, } from '../core/objects/pdf-stream.js';
8
+ import { PdfDictionary } from '../core/objects/pdf-dictionary.js';
9
+ import { PdfObjectReference } from '../core/objects/pdf-object-reference.js';
10
10
  /**
11
11
  * Manages cross-reference (xref) lookup for PDF objects.
12
12
  * Handles both traditional xref tables and xref streams, including hybrid documents.
@@ -1,5 +1,5 @@
1
- import { PdfCryptFilter, CryptFilterOptions } from './base';
2
- import { Cipher } from '../../crypto/types';
1
+ import { PdfCryptFilter, CryptFilterOptions } from './base.js';
2
+ import { Cipher } from '../../crypto/types.js';
3
3
  /**
4
4
  * AESV2 crypt filter using AES-128-CBC encryption.
5
5
  * Implements 128-bit AES encryption in CBC mode for PDF content.
@@ -1,5 +1,5 @@
1
- import { PdfCryptFilter } from './base';
2
- import { aes128 } from '../../crypto/ciphers/aes128';
1
+ import { PdfCryptFilter } from './base.js';
2
+ import { aes128 } from '../../crypto/ciphers/aes128.js';
3
3
  /**
4
4
  * AESV2 crypt filter using AES-128-CBC encryption.
5
5
  * Implements 128-bit AES encryption in CBC mode for PDF content.
@@ -1,5 +1,5 @@
1
- import { Cipher } from '../../crypto/types';
2
- import { PdfCryptFilter, CryptFilterOptions } from './base';
1
+ import { Cipher } from '../../crypto/types.js';
2
+ import { PdfCryptFilter, CryptFilterOptions } from './base.js';
3
3
  /**
4
4
  * AESV3 crypt filter using AES-256-CBC encryption.
5
5
  * Implements 256-bit AES encryption in CBC mode for PDF content.
@@ -1,5 +1,5 @@
1
- import { aes256 } from '../../crypto/ciphers/aes256';
2
- import { PdfCryptFilter } from './base';
1
+ import { aes256 } from '../../crypto/ciphers/aes256.js';
2
+ import { PdfCryptFilter } from './base.js';
3
3
  /**
4
4
  * AESV3 crypt filter using AES-256-CBC encryption.
5
5
  * Implements 256-bit AES encryption in CBC mode for PDF content.
@@ -1,7 +1,7 @@
1
- import { Cipher } from '../../crypto/types';
2
- import { ByteArray } from '../../types';
3
- import { PdfSecurityHandler } from '../handlers/base';
4
- import { PdfCryptFilterDictionary } from '../types';
1
+ import { Cipher } from '../../crypto/types.js';
2
+ import { ByteArray } from '../../types.js';
3
+ import { PdfSecurityHandler } from '../handlers/base.js';
4
+ import { PdfCryptFilterDictionary } from '../types.js';
5
5
  /**
6
6
  * Configuration options for creating a crypt filter.
7
7
  */
@@ -1,6 +1,6 @@
1
- import { PdfDictionary } from '../../core/objects/pdf-dictionary';
2
- import { PdfName } from '../../core/objects/pdf-name';
3
- import { PdfNumber } from '../../core/objects/pdf-number';
1
+ import { PdfDictionary } from '../../core/objects/pdf-dictionary.js';
2
+ import { PdfName } from '../../core/objects/pdf-name.js';
3
+ import { PdfNumber } from '../../core/objects/pdf-number.js';
4
4
  /**
5
5
  * Abstract base class for PDF crypt filters.
6
6
  * Crypt filters define how specific types of data (strings, streams, files) are encrypted.
@@ -1,5 +1,5 @@
1
- import { Cipher } from '../../crypto/types';
2
- import { PdfCryptFilter, CryptFilterOptions } from './base';
1
+ import { Cipher } from '../../crypto/types.js';
2
+ import { PdfCryptFilter, CryptFilterOptions } from './base.js';
3
3
  /**
4
4
  * Identity crypt filter that passes data through without encryption.
5
5
  * Used when no encryption is needed for specific content types.
@@ -1,4 +1,4 @@
1
- import { PdfCryptFilter } from './base';
1
+ import { PdfCryptFilter } from './base.js';
2
2
  /**
3
3
  * Identity crypt filter that passes data through without encryption.
4
4
  * Used when no encryption is needed for specific content types.
@@ -1,5 +1,5 @@
1
1
  import { Cipher } from '../../crypto/types.js';
2
- import { PdfCryptFilter, CryptFilterOptions } from './base';
2
+ import { PdfCryptFilter, CryptFilterOptions } from './base.js';
3
3
  /**
4
4
  * V2 crypt filter using RC4 encryption.
5
5
  * Implements the legacy RC4 stream cipher for PDF encryption.
@@ -1,5 +1,5 @@
1
1
  import { rc4 } from '../../crypto/ciphers/rc4.js';
2
- import { PdfCryptFilter } from './base';
2
+ import { PdfCryptFilter } from './base.js';
3
3
  /**
4
4
  * V2 crypt filter using RC4 encryption.
5
5
  * Implements the legacy RC4 stream cipher for PDF encryption.
@@ -1,7 +1,7 @@
1
- import { PdfIndirectObject } from '../../core/objects/pdf-indirect-object';
2
- import { Cipher } from '../../crypto/types';
3
- import { ByteArray, PdfPermissions } from '../../types';
4
- import { PdfEncryptionAlgorithmType, PdfEncryptionDictionary, PdfId } from '../types';
1
+ import { PdfIndirectObject } from '../../core/objects/pdf-indirect-object.js';
2
+ import { Cipher } from '../../crypto/types.js';
3
+ import { ByteArray, PdfPermissions } from '../../types.js';
4
+ import { PdfEncryptionAlgorithmType, PdfEncryptionDictionary, PdfId } from '../types.js';
5
5
  /**
6
6
  * Base options for creating a security handler.
7
7
  */
@@ -1,15 +1,15 @@
1
- import { PdfArray } from '../../core/objects/pdf-array';
2
- import { PdfBoolean } from '../../core/objects/pdf-boolean';
3
- import { PdfDictionary } from '../../core/objects/pdf-dictionary';
4
- import { PdfHexadecimal } from '../../core/objects/pdf-hexadecimal';
5
- import { PdfIndirectObject } from '../../core/objects/pdf-indirect-object';
6
- import { PdfName } from '../../core/objects/pdf-name';
7
- import { PdfNumber } from '../../core/objects/pdf-number';
8
- import { PdfStream } from '../../core/objects/pdf-stream';
9
- import { PdfString } from '../../core/objects/pdf-string';
10
- import { PERMISSION_FLAGS } from '../../types';
11
- import { assert, assertIfDefined } from '../../utils/assert';
12
- import { stringToBytes } from '../../utils/stringToBytes';
1
+ import { PdfArray } from '../../core/objects/pdf-array.js';
2
+ import { PdfBoolean } from '../../core/objects/pdf-boolean.js';
3
+ import { PdfDictionary } from '../../core/objects/pdf-dictionary.js';
4
+ import { PdfHexadecimal } from '../../core/objects/pdf-hexadecimal.js';
5
+ import { PdfIndirectObject } from '../../core/objects/pdf-indirect-object.js';
6
+ import { PdfName } from '../../core/objects/pdf-name.js';
7
+ import { PdfNumber } from '../../core/objects/pdf-number.js';
8
+ import { PdfStream } from '../../core/objects/pdf-stream.js';
9
+ import { PdfString } from '../../core/objects/pdf-string.js';
10
+ import { PERMISSION_FLAGS } from '../../types.js';
11
+ import { assert, assertIfDefined } from '../../utils/assert.js';
12
+ import { stringToBytes } from '../../utils/stringToBytes.js';
13
13
  /**
14
14
  * Abstract base class for PDF security handlers.
15
15
  * Security handlers manage encryption, decryption, and access permissions for PDF documents.
@@ -1,6 +1,6 @@
1
- import { ByteArray, PdfPermissions } from '../../types';
2
- import { PdfEncryptionDictionary, PdfEncryptionRecipient, PdfId } from '../types';
3
- import { PdfSecurityHandler, PdfStandardSecurityHandler } from './base';
1
+ import { ByteArray, PdfPermissions } from '../../types.js';
2
+ import { PdfEncryptionDictionary, PdfEncryptionRecipient, PdfId } from '../types.js';
3
+ import { PdfSecurityHandler, PdfStandardSecurityHandler } from './base.js';
4
4
  /**
5
5
  * Public key security handler implementing certificate-based encryption.
6
6
  * Uses PKCS#7 enveloped data to encrypt the file key for each recipient.
@@ -1,13 +1,13 @@
1
- import { Certificate } from 'pki-lite/x509/Certificate';
2
- import { EnvelopedData } from 'pki-lite/pkcs7/EnvelopedData';
3
- import { PrivateKeyInfo } from 'pki-lite/keys/PrivateKeyInfo';
4
- import { getRandomBytes, sha1, sha256 } from '../../utils/algos';
5
- import { PdfV5SecurityHandler } from './v5';
6
- import { PdfSecurityHandler } from './base';
7
- import { createStandardSecurityHandlerFromDictionary } from './utils';
8
- import { PdfName } from '../../core/objects/pdf-name';
9
- import { PdfArray } from '../../core/objects/pdf-array';
10
- import { PdfHexadecimal } from '../../core/objects/pdf-hexadecimal';
1
+ import { Certificate } from 'pki-lite/x509/Certificate.js';
2
+ import { EnvelopedData } from 'pki-lite/pkcs7/EnvelopedData.js';
3
+ import { PrivateKeyInfo } from 'pki-lite/keys/PrivateKeyInfo.js';
4
+ import { getRandomBytes, sha1, sha256 } from '../../utils/algos.js';
5
+ import { PdfV5SecurityHandler } from './v5.js';
6
+ import { PdfSecurityHandler } from './base.js';
7
+ import { createStandardSecurityHandlerFromDictionary } from './utils.js';
8
+ import { PdfName } from '../../core/objects/pdf-name.js';
9
+ import { PdfArray } from '../../core/objects/pdf-array.js';
10
+ import { PdfHexadecimal } from '../../core/objects/pdf-hexadecimal.js';
11
11
  /**
12
12
  * Public key security handler implementing certificate-based encryption.
13
13
  * Uses PKCS#7 enveloped data to encrypt the file key for each recipient.
@@ -1,7 +1,7 @@
1
- import { PdfEncryptionAlgorithmType, PdfEncryptionDictionary, PdfEncryptionOptions, PdfEncryptionRecipient, PdfId } from '../types';
2
- import { PdfSecurityHandler, PdfStandardSecurityHandler } from './base';
3
- import { ByteArray } from '../../types';
4
- import { PdfCryptFilter } from '../crypt-filters/base';
1
+ import { PdfEncryptionAlgorithmType, PdfEncryptionDictionary, PdfEncryptionOptions, PdfEncryptionRecipient, PdfId } from '../types.js';
2
+ import { PdfSecurityHandler, PdfStandardSecurityHandler } from './base.js';
3
+ import { ByteArray } from '../../types.js';
4
+ import { PdfCryptFilter } from '../crypt-filters/base.js';
5
5
  /**
6
6
  * Creates a security handler from an encryption dictionary.
7
7
  * Automatically detects the handler type (Standard or Adobe.PubSec) and version.
@@ -1,15 +1,15 @@
1
- import { assert, assertIfDefined } from '../../utils/assert';
2
- import { PdfV1SecurityHandler } from './v1';
3
- import { PdfV2SecurityHandler } from './v2';
4
- import { PdfV4SecurityHandler } from './v4';
5
- import { PdfV5SecurityHandler } from './v5';
6
- import { V2CryptFilter } from '../crypt-filters/v2';
7
- import { AesV2CryptFilter } from '../crypt-filters/aesv2';
8
- import { AesV3CryptFilter } from '../crypt-filters/aesv3';
9
- import { IdentityCryptFilter } from '../crypt-filters/identity';
10
- import { PdfName } from '../../core/objects/pdf-name';
11
- import { PdfNumber } from '../../core/objects/pdf-number';
12
- import { PdfPublicKeySecurityHandler } from './pubSec';
1
+ import { assert, assertIfDefined } from '../../utils/assert.js';
2
+ import { PdfV1SecurityHandler } from './v1.js';
3
+ import { PdfV2SecurityHandler } from './v2.js';
4
+ import { PdfV4SecurityHandler } from './v4.js';
5
+ import { PdfV5SecurityHandler } from './v5.js';
6
+ import { V2CryptFilter } from '../crypt-filters/v2.js';
7
+ import { AesV2CryptFilter } from '../crypt-filters/aesv2.js';
8
+ import { AesV3CryptFilter } from '../crypt-filters/aesv3.js';
9
+ import { IdentityCryptFilter } from '../crypt-filters/identity.js';
10
+ import { PdfName } from '../../core/objects/pdf-name.js';
11
+ import { PdfNumber } from '../../core/objects/pdf-number.js';
12
+ import { PdfPublicKeySecurityHandler } from './pubSec.js';
13
13
  /**
14
14
  * Creates a security handler from an encryption dictionary.
15
15
  * Automatically detects the handler type (Standard or Adobe.PubSec) and version.
@@ -1,7 +1,7 @@
1
- import { Cipher } from '../../crypto/types';
2
- import { ByteArray } from '../../types';
3
- import { PdfEncryptionAlgorithmType } from '../types';
4
- import { PdfStandardSecurityHandler } from './base';
1
+ import { Cipher } from '../../crypto/types.js';
2
+ import { ByteArray } from '../../types.js';
3
+ import { PdfEncryptionAlgorithmType } from '../types.js';
4
+ import { PdfStandardSecurityHandler } from './base.js';
5
5
  /**
6
6
  * V1 security handler implementing 40-bit RC4 encryption.
7
7
  * This is the original PDF encryption format (PDF 1.1).
@@ -1,10 +1,10 @@
1
- import { rc4 } from '../../crypto/ciphers/rc4';
2
- import { computeMasterKey, deriveObjectKey, } from '../../crypto/key-derivation/key-derivation';
3
- import { computeORc4_40, computeURc4_40, decryptUserPasswordRc4_40, } from '../../crypto/key-gen/key-gen-rc4-40';
4
- import { assert } from '../../utils/assert';
5
- import { bytesToString } from '../../utils/bytesToString';
6
- import { stringToBytes } from '../../utils/stringToBytes';
7
- import { PdfStandardSecurityHandler } from './base';
1
+ import { rc4 } from '../../crypto/ciphers/rc4.js';
2
+ import { computeMasterKey, deriveObjectKey, } from '../../crypto/key-derivation/key-derivation.js';
3
+ import { computeORc4_40, computeURc4_40, decryptUserPasswordRc4_40, } from '../../crypto/key-gen/key-gen-rc4-40.js';
4
+ import { assert } from '../../utils/assert.js';
5
+ import { bytesToString } from '../../utils/bytesToString.js';
6
+ import { stringToBytes } from '../../utils/stringToBytes.js';
7
+ import { PdfStandardSecurityHandler } from './base.js';
8
8
  /**
9
9
  * V1 security handler implementing 40-bit RC4 encryption.
10
10
  * This is the original PDF encryption format (PDF 1.1).
@@ -1,6 +1,6 @@
1
- import { Cipher } from '../../crypto/types';
2
- import { ByteArray } from '../../types';
3
- import { PdfV1SecurityHandler } from './v1';
1
+ import { Cipher } from '../../crypto/types.js';
2
+ import { ByteArray } from '../../types.js';
3
+ import { PdfV1SecurityHandler } from './v1.js';
4
4
  /**
5
5
  * V2 security handler implementing 128-bit RC4 encryption.
6
6
  * Extends V1 with stronger key length (PDF 1.4).
@@ -1,8 +1,8 @@
1
- import { rc4 } from '../../crypto/ciphers/rc4';
2
- import { computeOValueRc4_128, computeUValueRc4_128, decryptUserPasswordRc4_128, } from '../../crypto/key-gen/key-gen-rc4-128';
3
- import { bytesToString } from '../../utils/bytesToString';
4
- import { stringToBytes } from '../../utils/stringToBytes';
5
- import { PdfV1SecurityHandler } from './v1';
1
+ import { rc4 } from '../../crypto/ciphers/rc4.js';
2
+ import { computeOValueRc4_128, computeUValueRc4_128, decryptUserPasswordRc4_128, } from '../../crypto/key-gen/key-gen-rc4-128.js';
3
+ import { bytesToString } from '../../utils/bytesToString.js';
4
+ import { stringToBytes } from '../../utils/stringToBytes.js';
5
+ import { PdfV1SecurityHandler } from './v1.js';
6
6
  /**
7
7
  * V2 security handler implementing 128-bit RC4 encryption.
8
8
  * Extends V1 with stronger key length (PDF 1.4).
@@ -1,9 +1,9 @@
1
- import { Cipher } from '../../crypto/types';
2
- import { ByteArray } from '../../types';
3
- import { PdfCryptFilter } from '../crypt-filters/base';
4
- import { CryptFilterType, PdfEncryptionAlgorithmType, PdfEncryptionDictionary } from '../types';
5
- import { PdfStandardSecurityHandlerOptions } from './base';
6
- import { PdfV2SecurityHandler } from './v2';
1
+ import { Cipher } from '../../crypto/types.js';
2
+ import { ByteArray } from '../../types.js';
3
+ import { PdfCryptFilter } from '../crypt-filters/base.js';
4
+ import { CryptFilterType, PdfEncryptionAlgorithmType, PdfEncryptionDictionary } from '../types.js';
5
+ import { PdfStandardSecurityHandlerOptions } from './base.js';
6
+ import { PdfV2SecurityHandler } from './v2.js';
7
7
  /**
8
8
  * V4 security handler implementing AES-128-CBC encryption with crypt filters.
9
9
  * Supports different encryption methods for strings, streams, and embedded files (PDF 1.5).
@@ -1,14 +1,14 @@
1
- import { PdfDictionary } from '../../core/objects/pdf-dictionary';
2
- import { PdfName } from '../../core/objects/pdf-name';
3
- import { PdfNumber } from '../../core/objects/pdf-number';
4
- import { aes128 } from '../../crypto/ciphers/aes128';
5
- import { deriveObjectKey } from '../../crypto/key-derivation/key-derivation';
6
- import { assert, assertIfDefined } from '../../utils/assert';
7
- import { AesV2CryptFilter } from '../crypt-filters/aesv2';
8
- import { AesV3CryptFilter } from '../crypt-filters/aesv3';
9
- import { IdentityCryptFilter } from '../crypt-filters/identity';
10
- import { V2CryptFilter } from '../crypt-filters/v2';
11
- import { PdfV2SecurityHandler } from './v2';
1
+ import { PdfDictionary } from '../../core/objects/pdf-dictionary.js';
2
+ import { PdfName } from '../../core/objects/pdf-name.js';
3
+ import { PdfNumber } from '../../core/objects/pdf-number.js';
4
+ import { aes128 } from '../../crypto/ciphers/aes128.js';
5
+ import { deriveObjectKey } from '../../crypto/key-derivation/key-derivation.js';
6
+ import { assert, assertIfDefined } from '../../utils/assert.js';
7
+ import { AesV2CryptFilter } from '../crypt-filters/aesv2.js';
8
+ import { AesV3CryptFilter } from '../crypt-filters/aesv3.js';
9
+ import { IdentityCryptFilter } from '../crypt-filters/identity.js';
10
+ import { V2CryptFilter } from '../crypt-filters/v2.js';
11
+ import { PdfV2SecurityHandler } from './v2.js';
12
12
  const IDENTITY_CRYPT_FILTER = new IdentityCryptFilter({ authEvent: 'DocOpen' });
13
13
  /**
14
14
  * V4 security handler implementing AES-128-CBC encryption with crypt filters.
@@ -1,8 +1,8 @@
1
- import { ByteArray } from '../../types';
2
- import { PdfEncryptionDictionary } from '../types';
3
- import { PdfV4SecurityHandler } from './v4';
4
- import { PdfStandardSecurityHandlerOptions } from './base';
5
- import { Cipher } from '../../crypto/types';
1
+ import { ByteArray } from '../../types.js';
2
+ import { PdfEncryptionDictionary } from '../types.js';
3
+ import { PdfV4SecurityHandler } from './v4.js';
4
+ import { PdfStandardSecurityHandlerOptions } from './base.js';
5
+ import { Cipher } from '../../crypto/types.js';
6
6
  /**
7
7
  * V5 security handler implementing AES-256-CBC encryption.
8
8
  * This is the most secure encryption method (PDF 2.0).
@@ -1,12 +1,12 @@
1
- import { aes256 } from '../../crypto/ciphers/aes256';
2
- import { getFileKey } from '../../crypto/key-derivation/key-derivation-aes256';
3
- import { generateOandOe, generateUandUe, } from '../../crypto/key-gen/key-gen-aes256';
4
- import { aes256ecbEncrypt, getRandomBytes } from '../../utils/algos';
5
- import { assert } from '../../utils/assert';
6
- import { PdfV4SecurityHandler } from './v4';
7
- import { AesV3CryptFilter } from '../crypt-filters/aesv3';
8
- import { PdfHexadecimal } from '../../core/objects/pdf-hexadecimal';
9
- import { PdfString } from '../../core/objects/pdf-string';
1
+ import { aes256 } from '../../crypto/ciphers/aes256.js';
2
+ import { getFileKey } from '../../crypto/key-derivation/key-derivation-aes256.js';
3
+ import { generateOandOe, generateUandUe, } from '../../crypto/key-gen/key-gen-aes256.js';
4
+ import { aes256ecbEncrypt, getRandomBytes } from '../../utils/algos.js';
5
+ import { assert } from '../../utils/assert.js';
6
+ import { PdfV4SecurityHandler } from './v4.js';
7
+ import { AesV3CryptFilter } from '../crypt-filters/aesv3.js';
8
+ import { PdfHexadecimal } from '../../core/objects/pdf-hexadecimal.js';
9
+ import { PdfString } from '../../core/objects/pdf-string.js';
10
10
  /**
11
11
  * V5 security handler implementing AES-256-CBC encryption.
12
12
  * This is the most secure encryption method (PDF 2.0).
@@ -1,12 +1,12 @@
1
- import { PdfArray } from '../core/objects/pdf-array';
2
- import { PdfBoolean } from '../core/objects/pdf-boolean';
3
- import { PdfDictionary } from '../core/objects/pdf-dictionary';
4
- import { PdfHexadecimal } from '../core/objects/pdf-hexadecimal';
5
- import { PdfIndirectObject } from '../core/objects/pdf-indirect-object';
6
- import { PdfName } from '../core/objects/pdf-name';
7
- import { PdfNumber } from '../core/objects/pdf-number';
8
- import { PdfString } from '../core/objects/pdf-string';
9
- import { ByteArray } from '../types';
1
+ import { PdfArray } from '../core/objects/pdf-array.js';
2
+ import { PdfBoolean } from '../core/objects/pdf-boolean.js';
3
+ import { PdfDictionary } from '../core/objects/pdf-dictionary.js';
4
+ import { PdfHexadecimal } from '../core/objects/pdf-hexadecimal.js';
5
+ import { PdfIndirectObject } from '../core/objects/pdf-indirect-object.js';
6
+ import { PdfName } from '../core/objects/pdf-name.js';
7
+ import { PdfNumber } from '../core/objects/pdf-number.js';
8
+ import { PdfString } from '../core/objects/pdf-string.js';
9
+ import { ByteArray } from '../types.js';
10
10
  /**
11
11
  * Represents the PDF document ID array containing two hexadecimal identifiers.
12
12
  * The first element is the permanent ID assigned when the document is created,
@@ -1,14 +1,14 @@
1
- import { PdfArray } from '../core/objects/pdf-array';
2
- import { PdfDate } from '../core/objects/pdf-date';
3
- import { PdfDictionary } from '../core/objects/pdf-dictionary';
4
- import { PdfIndirectObject } from '../core/objects/pdf-indirect-object';
5
- import { PdfName } from '../core/objects/pdf-name';
6
- import { PdfObjectReference } from '../core/objects/pdf-object-reference';
7
- import { PdfStream } from '../core/objects/pdf-stream';
8
- import { PdfString } from '../core/objects/pdf-string';
9
- import { PdfDocument } from '../pdf/pdf-document';
10
- import { ByteArray } from '../types';
11
- import { RevocationInfo } from './types';
1
+ import { PdfArray } from '../core/objects/pdf-array.js';
2
+ import { PdfDate } from '../core/objects/pdf-date.js';
3
+ import { PdfDictionary } from '../core/objects/pdf-dictionary.js';
4
+ import { PdfIndirectObject } from '../core/objects/pdf-indirect-object.js';
5
+ import { PdfName } from '../core/objects/pdf-name.js';
6
+ import { PdfObjectReference } from '../core/objects/pdf-object-reference.js';
7
+ import { PdfStream } from '../core/objects/pdf-stream.js';
8
+ import { PdfString } from '../core/objects/pdf-string.js';
9
+ import { PdfDocument } from '../pdf/pdf-document.js';
10
+ import { ByteArray } from '../types.js';
11
+ import { RevocationInfo } from './types.js';
12
12
  /**
13
13
  * Indirect object containing a certificate stream.
14
14
  */
@@ -1,7 +1,7 @@
1
- import { PdfArray } from '../core/objects/pdf-array';
2
- import { PdfDictionary } from '../core/objects/pdf-dictionary';
3
- import { PdfIndirectObject } from '../core/objects/pdf-indirect-object';
4
- import { PdfStream } from '../core/objects/pdf-stream';
1
+ import { PdfArray } from '../core/objects/pdf-array.js';
2
+ import { PdfDictionary } from '../core/objects/pdf-dictionary.js';
3
+ import { PdfIndirectObject } from '../core/objects/pdf-indirect-object.js';
4
+ import { PdfStream } from '../core/objects/pdf-stream.js';
5
5
  /**
6
6
  * Indirect object containing a certificate stream.
7
7
  */
@@ -1,7 +1,7 @@
1
- import { RevocationInfo, TimeStampAuthority } from '../types';
2
- import { AsymmetricEncryptionAlgorithmParams } from 'pki-lite/core/index';
3
- import { PdfSignatureObject, PdfSignatureSignOptions } from './base';
4
- import { ByteArray } from '../../types';
1
+ import { RevocationInfo, TimeStampAuthority } from '../types.js';
2
+ import { AsymmetricEncryptionAlgorithmParams } from 'pki-lite/core/index.js';
3
+ import { PdfSignatureObject, PdfSignatureSignOptions } from './base.js';
4
+ import { ByteArray } from '../../types.js';
5
5
  /**
6
6
  * PKCS#7 detached signature object (adbe.pkcs7.detached).
7
7
  * Creates CMS SignedData with the document hash as external data.
@@ -1,14 +1,14 @@
1
- import { SignedData } from 'pki-lite/pkcs7/SignedData';
2
- import { Certificate } from 'pki-lite/x509/Certificate';
3
- import { SignerInfo } from 'pki-lite/pkcs7/SignerInfo';
4
- import { Attribute } from 'pki-lite/x509/Attribute';
5
- import { RevocationInfoArchival } from 'pki-lite/adobe/RevocationInfoArchival';
6
- import { CertificateList } from 'pki-lite/x509/CertificateList';
7
- import { OCSPResponse } from 'pki-lite/ocsp/OCSPResponse';
8
- import { PrivateKeyInfo } from 'pki-lite/keys/PrivateKeyInfo';
9
- import { OtherRevInfo } from 'pki-lite/adobe/OtherRevInfo';
10
- import { fetchRevocationInfo } from '../utils';
11
- import { PdfSignatureObject } from './base';
1
+ import { SignedData } from 'pki-lite/pkcs7/SignedData.js';
2
+ import { Certificate } from 'pki-lite/x509/Certificate.js';
3
+ import { SignerInfo } from 'pki-lite/pkcs7/SignerInfo.js';
4
+ import { Attribute } from 'pki-lite/x509/Attribute.js';
5
+ import { RevocationInfoArchival } from 'pki-lite/adobe/RevocationInfoArchival.js';
6
+ import { CertificateList } from 'pki-lite/x509/CertificateList.js';
7
+ import { OCSPResponse } from 'pki-lite/ocsp/OCSPResponse.js';
8
+ import { PrivateKeyInfo } from 'pki-lite/keys/PrivateKeyInfo.js';
9
+ import { OtherRevInfo } from 'pki-lite/adobe/OtherRevInfo.js';
10
+ import { fetchRevocationInfo } from '../utils.js';
11
+ import { PdfSignatureObject } from './base.js';
12
12
  /**
13
13
  * PKCS#7 detached signature object (adbe.pkcs7.detached).
14
14
  * Creates CMS SignedData with the document hash as external data.
@@ -1,7 +1,7 @@
1
- import { RevocationInfo, TimeStampAuthority } from '../types';
2
- import { AsymmetricEncryptionAlgorithmParams } from 'pki-lite/core/index';
3
- import { PdfSignatureObject, PdfSignatureSignOptions } from './base';
4
- import { ByteArray } from '../../types';
1
+ import { RevocationInfo, TimeStampAuthority } from '../types.js';
2
+ import { AsymmetricEncryptionAlgorithmParams } from 'pki-lite/core/index.js';
3
+ import { PdfSignatureObject, PdfSignatureSignOptions } from './base.js';
4
+ import { ByteArray } from '../../types.js';
5
5
  /**
6
6
  * PKCS#7 SHA-1 signature object (adbe.pkcs7.sha1).
7
7
  * Creates CMS SignedData with SHA-1 hash embedded as signed content.
@@ -1,15 +1,15 @@
1
- import { SignedData } from 'pki-lite/pkcs7/SignedData';
2
- import { Certificate } from 'pki-lite/x509/Certificate';
3
- import { SignerInfo } from 'pki-lite/pkcs7/SignerInfo';
4
- import { Attribute } from 'pki-lite/x509/Attribute';
5
- import { RevocationInfoArchival } from 'pki-lite/adobe/RevocationInfoArchival';
6
- import { CertificateList } from 'pki-lite/x509/CertificateList';
7
- import { OCSPResponse } from 'pki-lite/ocsp/OCSPResponse';
8
- import { PrivateKeyInfo } from 'pki-lite/keys/PrivateKeyInfo';
9
- import { OtherRevInfo } from 'pki-lite/adobe/OtherRevInfo';
10
- import { fetchRevocationInfo } from '../utils';
11
- import { PdfSignatureObject } from './base';
12
- import { DigestAlgorithmIdentifier } from 'pki-lite/algorithms/AlgorithmIdentifier';
1
+ import { SignedData } from 'pki-lite/pkcs7/SignedData.js';
2
+ import { Certificate } from 'pki-lite/x509/Certificate.js';
3
+ import { SignerInfo } from 'pki-lite/pkcs7/SignerInfo.js';
4
+ import { Attribute } from 'pki-lite/x509/Attribute.js';
5
+ import { RevocationInfoArchival } from 'pki-lite/adobe/RevocationInfoArchival.js';
6
+ import { CertificateList } from 'pki-lite/x509/CertificateList.js';
7
+ import { OCSPResponse } from 'pki-lite/ocsp/OCSPResponse.js';
8
+ import { PrivateKeyInfo } from 'pki-lite/keys/PrivateKeyInfo.js';
9
+ import { OtherRevInfo } from 'pki-lite/adobe/OtherRevInfo.js';
10
+ import { fetchRevocationInfo } from '../utils.js';
11
+ import { PdfSignatureObject } from './base.js';
12
+ import { DigestAlgorithmIdentifier } from 'pki-lite/algorithms/AlgorithmIdentifier.js';
13
13
  /**
14
14
  * PKCS#7 SHA-1 signature object (adbe.pkcs7.sha1).
15
15
  * Creates CMS SignedData with SHA-1 hash embedded as signed content.
@@ -1,7 +1,7 @@
1
- import { AsymmetricEncryptionAlgorithmParams } from 'pki-lite/core/index';
2
- import { PdfSignatureObject, PdfSignatureSignOptions } from './base';
3
- import { ByteArray } from '../../types';
4
- import { RevocationInfo } from '../types';
1
+ import { AsymmetricEncryptionAlgorithmParams } from 'pki-lite/core/index.js';
2
+ import { PdfSignatureObject, PdfSignatureSignOptions } from './base.js';
3
+ import { ByteArray } from '../../types.js';
4
+ import { RevocationInfo } from '../types.js';
5
5
  /**
6
6
  * X.509 RSA-SHA1 signature object (adbe.x509.rsa_sha1).
7
7
  * Creates a raw RSA-SHA1 signature with certificates in the Cert entry.
@@ -1,11 +1,11 @@
1
- import { PrivateKeyInfo } from 'pki-lite/keys/PrivateKeyInfo';
2
- import { PdfSignatureObject } from './base';
3
- import { OctetString } from 'pki-lite/asn1/OctetString';
4
- import { AlgorithmIdentifier } from 'pki-lite/algorithms/AlgorithmIdentifier';
5
- import { Certificate } from 'pki-lite/x509/Certificate';
6
- import { fetchRevocationInfo } from '../utils';
7
- import { PdfArray } from '../../core/objects/pdf-array';
8
- import { PdfHexadecimal } from '../../core/objects/pdf-hexadecimal';
1
+ import { PrivateKeyInfo } from 'pki-lite/keys/PrivateKeyInfo.js';
2
+ import { PdfSignatureObject } from './base.js';
3
+ import { OctetString } from 'pki-lite/asn1/OctetString.js';
4
+ import { AlgorithmIdentifier } from 'pki-lite/algorithms/AlgorithmIdentifier.js';
5
+ import { Certificate } from 'pki-lite/x509/Certificate.js';
6
+ import { fetchRevocationInfo } from '../utils.js';
7
+ import { PdfArray } from '../../core/objects/pdf-array.js';
8
+ import { PdfHexadecimal } from '../../core/objects/pdf-hexadecimal.js';
9
9
  /**
10
10
  * X.509 RSA-SHA1 signature object (adbe.x509.rsa_sha1).
11
11
  * Creates a raw RSA-SHA1 signature with certificates in the Cert entry.
@@ -1,8 +1,8 @@
1
- import { PdfDictionary } from '../../core/objects/pdf-dictionary';
2
- import { PdfSignatureDictionaryEntries, PdfSignatureSubType, PdfSignatureVerificationOptions, PdfSignatureVerificationResult, RevocationInfo } from '../types';
3
- import { PdfHexadecimal } from '../../core/objects/pdf-hexadecimal';
4
- import { PdfIndirectObject } from '../../core/objects/pdf-indirect-object';
5
- import { ByteArray } from '../../types';
1
+ import { PdfDictionary } from '../../core/objects/pdf-dictionary.js';
2
+ import { PdfSignatureDictionaryEntries, PdfSignatureSubType, PdfSignatureVerificationOptions, PdfSignatureVerificationResult, RevocationInfo } from '../types.js';
3
+ import { PdfHexadecimal } from '../../core/objects/pdf-hexadecimal.js';
4
+ import { PdfIndirectObject } from '../../core/objects/pdf-indirect-object.js';
5
+ import { ByteArray } from '../../types.js';
6
6
  /**
7
7
  * PDF signature dictionary containing all signature-related entries.
8
8
  * Manages the ByteRange and Contents fields with appropriate placeholder sizing.