%    Copyright (C) 1996, 1997 Aladdin Enterprises.  All rights reserved.
% 
% This file is part of GNU Ghostscript.
% 
% GNU Ghostscript is distributed in the hope that it will be useful, but
% WITHOUT ANY WARRANTY.  No author or distributor accepts responsibility
% to anyone for the consequences of using it or for whether it serves any
% particular purpose or works at all, unless he says so in writing.  Refer
% to the GNU General Public License for full details.
% 
% Everyone is granted permission to copy, modify and redistribute GNU
% Ghostscript, but only under the conditions described in the GNU General
% Public License.  A copy of this license is supposed to have been given
% to you along with GNU Ghostscript so you can know your rights and
% responsibilities.  It should be in a file named COPYING.  Among other
% things, the copyright notice and this notice must be preserved on all
% copies.
% 
% Aladdin Enterprises supports the work of the GNU Project, but is not
% affiliated with the Free Software Foundation or the GNU Project.  GNU
% Ghostscript, as distributed by Aladdin Enterprises, does not require any
% GNU software to build or run it.

% $Id: pdf_sec.ps,v 1.1 2000/12/11 02:31:37 bhinkle Exp $
% pdf_sec.ps
% Security hooks for PDF reader.

% This file contains the procedures that have to take encryption into
% account when reading a PDF file.  There is no actual decryption code here,
% because U.S. export control laws might prohibit making this file available
% to anyone outside the U.S. if the code were included.  Instead, you can
% get the real version of this file from
%	http://www.ozemail.com.au/~geoffk/pdfencrypt/pdf_sec.ps
% or, if the ~ character upsets your software,
%	http://www.ozemail.com.au/%7Egeoffk/pdfencrypt/pdf_sec.ps
% NOTE: these URLs are referenced in the error message below.

/.setlanguagelevel where { pop 2 .setlanguagelevel } if
.currentglobal true .setglobal
/pdfdict where { pop } { /pdfdict 100 dict def } ifelse
pdfdict begin

% Process the encryption information in the Trailer.
/pdf_process_Encrypt
 { (\n\n) print
   (    **** The PDF input file uses encryption and cannot be processed.\n) print
   (    **** Please get and install the patch available from\n) print
   (    ****     http://www.ozemail.com.au/~geoffk/pdfencrypt/pdf_sec.ps\n) print
   (\n\n) print flush
   /pdfopen cvx /invalidfileaccess signalerror
 } bind def

% Run the code to resolve an object reference.
/pdf_run_resolve
 { PDFfile resolveopdict .pdfrun
 } bind def

% Prefix a decryption filter to a stream if needed.
% Stack: readdata? dict parms file/string filternames
/pdf_decrypt_stream
 {
 } bind def

end			% pdfdict
.setglobal
