StandardProtectionPolicy spp =
new StandardProtectionPolicy(ownerPassword, userPassword, ap);
spp.setEncryptionKeyLength(keyLength);
document.protect(spp);
}
document.save( outfile );
}
else
{
System.err.println( "Error: Document is already encrypted." );
}