Skip to content

Commit

Permalink
Decryption support
Browse files Browse the repository at this point in the history
Relies on three primary classes:

  - \Smalot\PdfParser\Encryption\Info
  - \Smalot\PdfParser\Encryption\FileKey
  - \Smalot\PdfParser\Encryption\Stream

This namespace also has a number of exception classes.

\Smalot\PdfParser\RawData\RawDataParser interacts with decryption
support via:

  - $decryptionHelper variable
  - decodeStream() now handles decryption after header processing and
    before the object filters are invoked
  - parseData() calls setupDecryption() if the document has an Encrypt object

Also added is \Smalot\PdfParser\Utils with a number of static utility
methods for binary string processing, etc.
  • Loading branch information
unixnut committed Jan 19, 2024
1 parent 65e3852 commit 1236fec
Show file tree
Hide file tree
Showing 10 changed files with 1,333 additions and 0 deletions.
49 changes: 49 additions & 0 deletions src/Smalot/PdfParser/Encryption/DecryptionError.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<?php

/**
* This file is based on code of tecnickcom/TCPDF PDF library.
*
* Original author Nicola Asuni ([email protected]) and
* contributors (https://github.com/tecnickcom/TCPDF/graphs/contributors).
*
* @see https://github.com/tecnickcom/TCPDF
*
* Original code was licensed on the terms of the LGPL v3.
*
* ------------------------------------------------------------------------------
*
* @file This file is part of the PdfParser library.
*
* @author Alastair Irvine <[email protected]>
*
* @date 2024-01-12
*
* @license LGPLv3
*
* @url <https://github.com/smalot/pdfparser>
*
* PdfParser is a pdf library written in PHP, extraction oriented.
* Copyright (C) 2017 - Sébastien MALOT <[email protected]>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program.
* If not, see <http://www.pdfparser.org/sites/default/LICENSE.txt>.
*/

namespace Smalot\PdfParser\Encryption;

/**
*/
class DecryptionError extends \RuntimeException
{
}
Loading

0 comments on commit 1236fec

Please sign in to comment.