/**
  * (Optional, PDF 1.7) An array of names indicating acceptable digest algorithms to use when
  * signing. The value shall be one of <b>SHA1</b>, <b>SHA256</b>, <b>SHA384</b>, <b>SHA512</b>,
  * <b>RIPEMD160</b>. The default value is implementation-specific.
  *
  * <p>This property is only applicable if the digital credential signing contains RSA
  * public/privat keys
  *
  * @param digestMethod is a list of possible names of the digests, that should be used for
  *     signing.
  */
 public void setDigestMethod(List<COSName> digestMethod) {
   // integrity check
   for (COSName cosName : digestMethod) {
     if (!(cosName.equals(COSName.DIGEST_SHA1)
         || cosName.equals(COSName.DIGEST_SHA256)
         || cosName.equals(COSName.DIGEST_SHA384)
         || cosName.equals(COSName.DIGEST_SHA512)
         || cosName.equals(COSName.DIGEST_RIPEMD160))) {
       throw new IllegalArgumentException(
           "Specified digest " + cosName.getName() + " isn't allowed.");
     }
   }
   dictionary.setItem(COSName.DIGEST_METHOD, COSArrayList.converterToCOSArray(digestMethod));
 }
 /**
  * Sets the child fields.
  *
  * @param children The list of child fields.
  */
 public void setChildren(List<PDField> children) {
   COSArray kidsArray = COSArrayList.converterToCOSArray(children);
   getCOSObject().setItem(COSName.KIDS, kidsArray);
 }
 /**
  * (Optional, PDF 1.6) An array of text strings that specifying possible legal attestations.
  *
  * @param legalAttestation is a list of possible text string that specifying possible legal
  *     attestations.
  */
 public void setLegalAttestation(List<String> legalAttestation) {
   dictionary.setItem(
       COSName.LEGAL_ATTESTATION, COSArrayList.converterToCOSArray(legalAttestation));
 }
 /**
  * (Optional) An array of text strings that specifying possible reasons for signing a document. If
  * specified, the reasons supplied in this entry replace those used by conforming products.
  *
  * @param reasons is a list of possible text string that specifying possible reasons
  */
 public void setReasonsd(List<String> reasons) {
   dictionary.setItem(COSName.REASONS, COSArrayList.converterToCOSArray(reasons));
 }
 /**
  * (Optional) An array of names indicating encodings to use when signing. The first name in the
  * array that matches an encoding supported by the signature handler shall be the encoding that is
  * actually used for signing.
  *
  * @param subfilter is the name that shall be used for encoding
  */
 public void setSubFilter(List<COSName> subfilter) {
   dictionary.setItem(COSName.SUBFILTER, COSArrayList.converterToCOSArray(subfilter));
 }
예제 #6
0
 /**
  * This will set the next action, or sequence of actions, to be performed after this one. The
  * value is either a single action dictionary or an array of action dictionaries to be performed
  * in order.
  *
  * @param next The Next action or sequence of actions.
  */
 public void setNext(List next) {
   action.setItem("Next", COSArrayList.converterToCOSArray(next));
 }