Yes, I know the constant is defined, but the functionality isn't there.

I can run the EncryptWithCertificate.java example from the book fine.
However, if I change ENCRYPTION_AES_128 to ENCRYPTION_AES_256 in this
example (in the two locations that it occurs), then I get:

Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException
    at java.lang.System.arraycopy(Native Method)
    at
com.itextpdf.text.pdf.PdfEncryption.setupByEncryptionKey(PdfEncryption.java:527)
    at
com.itextpdf.text.pdf.PdfEncryption.getEncryptionDictionary(PdfEncryption.java:633)
    at com.itextpdf.text.pdf.PdfWriter.setEncryption(PdfWriter.java:2057)
    at
part3.chapter12.EncryptWithCertificate.createPdf(EncryptWithCertificate.java:73)
    at
part3.chapter12.EncryptWithCertificate.main(EncryptWithCertificate.java:178)

This behaviour was mentioned in a previous message on this list - the
explanation at the time was that the AES-256 functionality wasn't
implemented yet.

I have installed the Unlimited Strength Jurisdiction Policy Files, and the
example code installs the BouncyCastle crypto provider:

Security.addProvider(new BouncyCastleProvider());

On 22 May 2012 15:23, 1T3XT BVBA <[email protected]> wrote:

> On 22/05/2012 15:27, David Allsopp wrote:
> > Hi,
> >
> > I see from past messages on this list that AES-256 is not supported
> > for certificate-based encryption, but that it was expected to be
> > available last year.
>
> See
>
> http://api.itextpdf.com/itext/com/itextpdf/text/pdf/PdfWriter.html#ENCRYPTION_AES_256
>
>
> ------------------------------------------------------------------------------
>
>
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
iText-questions mailing list
[email protected]
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