It may be a problem setting the same password for user and owner.

Paulo

-----Original Message-----
From: aeternum [mailto:marcus.kl...@gmail.com] 
Sent: Tuesday, July 19, 2011 11:34 AM
To: itext-questions@lists.sourceforge.net
Subject: Re: [iText-questions] PDF encryption as a Web Service on a JDK 1.4 
based Application Server

Thx for the answer. I have included the Bouncy Castle Jars
(bcprov-jdk14-146.jar and bcmail-jdk14-146.jar) into the classpath and the
application doenst throw an exception at all. If it would, the return
parameter wouldnt be filled, but it is. The pdf-data i am throwing to the
web service gets returned and can be displayed. Just the pwd is not set at
all! :(

/public byte[] encrypt(byte[] pdf, byte[] pwd) {
                // TODO : Implement
                
                try {
                        PdfReader reader = new PdfReader(pdf);
                        ByteArrayOutputStream boas = new 
ByteArrayOutputStream();
                        try {
                                PdfStamper stamper = new PdfStamper(reader, 
boas);                      
                                stamper.setEncryption(pwd, pwd,
                                                PdfWriter.ALLOW_PRINTING, 
PdfWriter.ENCRYPTION_AES_128 |
PdfWriter.DO_NOT_ENCRYPT_METADATA);
                                stamper.close();
                                *return boas.toByteArray();*
                        } catch (DocumentException e) {
                                e.printStackTrace();
                        }                               
                } catch (IOException e) {
                        e.printStackTrace();
                }               
                
                
                return null;
        }/

--
View this message in context: 
http://itext-general.2136553.n4.nabble.com/PDF-encryption-as-a-Web-Service-on-a-JDK-1-4-based-Application-Server-tp3677768p3677811.html
Sent from the iText - General mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Magic Quadrant for Content-Aware Data Loss Prevention
Research study explores the data loss prevention market. Includes in-depth
analysis on the changes within the DLP market, and the criteria used to
evaluate the strengths and weaknesses of these DLP solutions.
http://www.accelacomm.com/jaw/sfnl/114/51385063/
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions

iText(R) is a registered trademark of 1T3XT BVBA.
Many questions posted to this list can (and will) be answered with a reference 
to the iText book: http://www.itextpdf.com/book/
Please check the keywords list before you ask for examples: 
http://itextpdf.com/themes/keywords.php


Aviso Legal:
Esta mensagem é destinada exclusivamente ao destinatário. Pode conter 
informação confidencial ou legalmente protegida. A incorrecta transmissão desta 
mensagem não significa a perca de confidencialidade. Se esta mensagem for 
recebida por engano, por favor envie-a de volta para o remetente e apague-a do 
seu sistema de imediato. É proibido a qualquer pessoa que não o destinatário de 
usar, revelar ou distribuir qualquer parte desta mensagem. 

Disclaimer:
This message is destined exclusively to the intended receiver. It may contain 
confidential or legally protected information. The incorrect transmission of 
this message does not mean the loss of its confidentiality. If this message is 
received by mistake, please send it back to the sender and delete it from your 
system immediately. It is forbidden to any person who is not the intended 
receiver to use, distribute or copy any part of this message.


------------------------------------------------------------------------------
Magic Quadrant for Content-Aware Data Loss Prevention
Research study explores the data loss prevention market. Includes in-depth
analysis on the changes within the DLP market, and the criteria used to
evaluate the strengths and weaknesses of these DLP solutions.
http://www.accelacomm.com/jaw/sfnl/114/51385063/
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions

iText(R) is a registered trademark of 1T3XT BVBA.
Many questions posted to this list can (and will) be answered with a reference 
to the iText book: http://www.itextpdf.com/book/
Please check the keywords list before you ask for examples: 
http://itextpdf.com/themes/keywords.php

Reply via email to