您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

PDFEncryption.java 1.6KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. /*
  2. * Copyright 1999-2004 The Apache Software Foundation.
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. /* $Id$ */
  17. package org.apache.fop.pdf;
  18. /**
  19. * This interface defines the contract for classes implementing PDF encryption.
  20. */
  21. public interface PDFEncryption {
  22. /**
  23. * Returns the encryption parameters.
  24. * @return the encryption parameters
  25. */
  26. PDFEncryptionParams getParams();
  27. /**
  28. * Sets the encryption parameters.
  29. * @param params The parameterss to set
  30. */
  31. void setParams(PDFEncryptionParams params);
  32. /**
  33. * Adds a PDFFilter to the PDFStream object
  34. * @param stream the stream to add an encryption filter to
  35. */
  36. void applyFilter(AbstractPDFStream stream);
  37. /**
  38. * Encrypt an array of bytes using a reference PDFObject for calculating
  39. * the encryption key.
  40. * @param data data to encrypt
  41. * @param refObj reference PDFObject
  42. * @return byte[] the encrypted data
  43. */
  44. byte[] encrypt(byte[] data, PDFObject refObj);
  45. /**
  46. * Returns the trailer entry for encryption.
  47. * @return the trailer entry
  48. */
  49. String getTrailerEntry();
  50. }