java.lang.Object
com.lowagie.text.pdf.PdfSignatureAppearance
Deprecated.
This class takes care of the cryptographic options and appearances that form a signature.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceDeprecated.An interface to retrieve the signature dictionary for modification. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intDeprecated.static final intDeprecated.static final intDeprecated.static final intDeprecated.static final intDeprecated.static final StringDeprecated.Commands to draw a yellow question mark in a stream contentstatic final PdfNameDeprecated.The self signed filter.static final intDeprecated.The rendering mode is just the descriptionstatic final intDeprecated.The rendering mode is an image and the descriptionstatic final intDeprecated.The rendering mode is an image and the descriptionstatic final intDeprecated.The rendering mode is the name of the signer and the descriptionstatic final PdfNameDeprecated.The VeriSign filter.static final PdfNameDeprecated.The Windows Certificate Security. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose(PdfDictionary update) Deprecated.This is the last method to be called when using external signatures.static floatDeprecated.Fits the text to some rectangle adjusting the font size as needed.Deprecated.Gets the main appearance layer.intDeprecated.Gets the certified status of this document.Deprecated.Gets the signing contact.CRL[]Deprecated.Gets the certificate revocation list.Deprecated.Gets the user made signature dictionary.Deprecated.Gets the field name.Deprecated.Gets the filter used to sign the document.getImage()Deprecated.Gets the background image for the layer 2.floatDeprecated.Gets the scaling to be applied to the background image.getLayer(int layer) Deprecated.Gets a template layer to create a signature appearance.Deprecated.Gets the n2 and n4 layer font.Deprecated.Gets the signature text identifying the signer if set by setLayer2Text().Deprecated.Gets the text identifying the signature status if set by setLayer4Text().Deprecated.Gets the signing location or null if not set.final StringDeprecated.Gets a new signature fied name that doesn't clash with any existing name.intgetPage()Deprecated.Gets the page number of the field.Deprecated.Gets the rectangle that represent the position and dimension of the signature in the page.Deprecated.Gets the private key.Deprecated.Returns the Cryptographic Service Provider that will sign the document.Deprecated.Gets the document bytes that are hashable when using external signatures.Deprecated.Gets the signing reason or null if not set.getRect()Deprecated.Gets the rectangle representing the signature dimensions.intDeprecated.Gets the rendering mode for this signature.intDeprecated.Gets the run direction.Deprecated.Getter for property signatureEvent.Deprecated.Gets the Image object to render.Deprecated.Gets the signature date.Deprecated.Gets the signature date.Deprecated.Gets the instance of the standard signature dictionary.Deprecated.Gets thePdfStamperassociated with this instance.Deprecated.Gets the temporary file.Deprecated.Gets the template that aggregates all appearance layers.booleanDeprecated.Gets the Acrobat 6.0 layer mode.booleanDeprecated.Gets the visibility status of the signature.booleanDeprecated.Checks if a new field was created.booleanDeprecated.Checks if the document is in the process of closing.voidpreClose()Deprecated.This is the first method to be called when using external signatures.voidDeprecated.This is the first method to be called when using external signatures.voidsetAcro6Layers(boolean acro6Layers) Deprecated.Acrobat 6.0 and higher recommends that only layer n2 and n4 be present.voidsetCertificationLevel(int certificationLevel) Deprecated.Sets the document type to certified instead of simply signed.voidsetContact(String contact) Deprecated.Sets the signing contact.voidsetCrypto(PrivateKey privKey, Certificate[] certChain, CRL[] crlList, PdfName filter) Deprecated.Sets the cryptographic parameters.voidsetCrypto(PrivateKey privKey, X509Certificate certificate, CRL crl, PdfName filter) Deprecated.Sets the cryptographic parameters.voidsetCryptoDictionary(PdfDictionary cryptoDictionary) Deprecated.Sets a user made signature dictionary.voidsetExternalDigest(byte[] digest, byte[] RSAdata, String digestEncryptionAlgorithm) Deprecated.Sets the digest/signature to an external calculated value.voidsetFieldNameForInvisibleSignatures(String fieldName) Deprecated.Sets the field name for a new invisible signature fieldvoidDeprecated.Sets the background image for the layer 2.voidsetImageScale(float imageScale) Deprecated.Sets the scaling to be applied to the background image.voidsetLayer2Font(Font layer2Font) Deprecated.Sets the n2 and n4 layer font.voidsetLayer2Text(String text) Deprecated.Sets the signature text identifying the signer.voidsetLayer4Text(String text) Deprecated.Sets the text identifying the signature status.voidsetLocation(String location) Deprecated.Sets the signing location.voidsetProvider(String provider) Deprecated.Sets the Cryptographic Service Provider that will sign the document.voidDeprecated.Sets the signing reason.voidsetRender(int render) Deprecated.Sets the rendering mode for this signature.voidsetRunDirection(int runDirection) Deprecated.Sets the run direction in the n2 and n4 layer.voidsetSignatureEvent(PdfSignatureAppearance.SignatureEvent signatureEvent) Deprecated.Sets the signature event to allow modification of the signature dictionary.voidsetSignatureGraphic(Image signatureGraphic) Deprecated.Sets the Image object to render when Render is set toSignatureRenderGraphicAndDescriptionvoidsetSignDate(Calendar signDate) Deprecated.Sets the signature date.voidsetVisibleSignature(Rectangle pageRect, int page) Deprecated.voidsetVisibleSignature(Rectangle pageRect, int page, String fieldName) Deprecated.Sets the signature to be visible.voidsetVisibleSignature(String fieldName) Deprecated.Sets the signature to be visible.
-
Field Details
-
SignatureRenderDescription
public static final int SignatureRenderDescriptionDeprecated.The rendering mode is just the description- See Also:
-
SignatureRenderNameAndDescription
public static final int SignatureRenderNameAndDescriptionDeprecated.The rendering mode is the name of the signer and the description- See Also:
-
SignatureRenderGraphicAndDescription
public static final int SignatureRenderGraphicAndDescriptionDeprecated.The rendering mode is an image and the description- See Also:
-
SignatureRenderGraphic
public static final int SignatureRenderGraphicDeprecated.The rendering mode is an image and the description- See Also:
-
SELF_SIGNED
Deprecated.The self signed filter. -
VERISIGN_SIGNED
Deprecated.The VeriSign filter. -
WINCER_SIGNED
Deprecated.The Windows Certificate Security. -
NOT_CERTIFIED
public static final int NOT_CERTIFIEDDeprecated.- See Also:
-
CERTIFIED_ALL_CHANGES_ALLOWED
public static final int CERTIFIED_ALL_CHANGES_ALLOWEDDeprecated.- See Also:
-
CERTIFIED_NO_CHANGES_ALLOWED
public static final int CERTIFIED_NO_CHANGES_ALLOWEDDeprecated.- See Also:
-
CERTIFIED_FORM_FILLING
public static final int CERTIFIED_FORM_FILLINGDeprecated.- See Also:
-
CERTIFIED_FORM_FILLING_AND_ANNOTATIONS
public static final int CERTIFIED_FORM_FILLING_AND_ANNOTATIONSDeprecated.- See Also:
-
questionMark
Deprecated.Commands to draw a yellow question mark in a stream content- See Also:
-
-
Method Details
-
fitText
public static float fitText(Font font, String text, Rectangle rect, float maxFontSize, int runDirection) Deprecated.Fits the text to some rectangle adjusting the font size as needed.- Parameters:
font- the font to usetext- the textrect- the rectangle where the text must fitmaxFontSize- the maximum font sizerunDirection- the run direction- Returns:
- the calculated font size that makes the text fit
-
getRender
public int getRender()Deprecated.Gets the rendering mode for this signature.- Returns:
- the rendering mode for this signature
-
setRender
public void setRender(int render) Deprecated.Sets the rendering mode for this signature. The rendering modes can be the constantsSignatureRenderDescription,SignatureRenderNameAndDescriptionorSignatureRenderGraphicAndDescription. The two last modes should be used with Acrobat 6 layer type.- Parameters:
render- the render mode
-
getSignatureGraphic
Deprecated.Gets the Image object to render.- Returns:
- the image
-
setSignatureGraphic
Deprecated.Sets the Image object to render when Render is set toSignatureRenderGraphicAndDescription- Parameters:
signatureGraphic- image rendered. Ifnullthe mode is defaulted toSignatureRenderDescription
-
getLayer2Text
Deprecated.Gets the signature text identifying the signer if set by setLayer2Text().- Returns:
- the signature text identifying the signer
-
setLayer2Text
Deprecated.Sets the signature text identifying the signer.- Parameters:
text- the signature text identifying the signer. Ifnullor not set a standard description will be used
-
getLayer4Text
Deprecated.Gets the text identifying the signature status if set by setLayer4Text().- Returns:
- the text identifying the signature status
-
setLayer4Text
Deprecated.Sets the text identifying the signature status.- Parameters:
text- the text identifying the signature status. Ifnullor not set the description "Signature Not Verified" will be used
-
getRect
Deprecated.Gets the rectangle representing the signature dimensions.- Returns:
- the rectangle representing the signature dimensions. It may be
nullor have zero width or height for invisible signatures
-
isInvisible
public boolean isInvisible()Deprecated.Gets the visibility status of the signature.- Returns:
- the visibility status of the signature
-
setCrypto
Deprecated.Sets the cryptographic parameters.- Parameters:
privKey- the private keycertificate- the certificatecrl- the certificate revocation list. It may benullfilter- the cryptographic filter type. It can be SELF_SIGNED, VERISIGN_SIGNED or WINCER_SIGNED
-
setCrypto
Deprecated.Sets the cryptographic parameters.- Parameters:
privKey- the private keycertChain- the certification chaincrlList- the crl listfilter- the PdfName
-
setVisibleSignature
Deprecated. -
setVisibleSignature
Deprecated.Sets the signature to be visible. It creates a new visible signature field.- Parameters:
pageRect- the position and dimension of the field in the pagepage- the page to place the field. The fist page is 1fieldName- the field name ornullto generate automatically a new field name
-
setVisibleSignature
Deprecated.Sets the signature to be visible. An empty signature field with the same name must already exist.- Parameters:
fieldName- the existing empty signature field name
-
getLayer
Deprecated.Gets a template layer to create a signature appearance. The layers can go from 0 to 4.Consult PPKAppearances.pdf for further details.
- Parameters:
layer- the layer- Returns:
- a template
-
getTopLayer
Deprecated.Gets the template that aggregates all appearance layers. This corresponds to the /FRM resource.Consult PPKAppearances.pdf for further details.
- Returns:
- the template that aggregates all appearance layers
-
getAppearance
Deprecated.Gets the main appearance layer.Consult PPKAppearances.pdf for further details.
- Returns:
- the main appearance layer
- Throws:
DocumentException- on error
-
setExternalDigest
Deprecated.Sets the digest/signature to an external calculated value.- Parameters:
digest- the digest. This is the actual signatureRSAdata- the extra data that goes into the data tag in PKCS#7digestEncryptionAlgorithm- the encryption algorithm. It may must benullif thedigestis alsonull. If thedigestis notnullthen it may be "RSA" or "DSA"
-
getReason
Deprecated.Gets the signing reason or null if not set.- Returns:
- the signing reason
-
setReason
Deprecated.Sets the signing reason.- Parameters:
reason- the signing reason
-
getLocation
Deprecated.Gets the signing location or null if not set.- Returns:
- the signing location
-
setLocation
Deprecated.Sets the signing location.- Parameters:
location- the signing location
-
getProvider
Deprecated.Returns the Cryptographic Service Provider that will sign the document. This method might return null if the provider was not set.- Returns:
- provider the name of the provider, for example "SUN", or
nullto use the default provider.
-
setProvider
Deprecated.Sets the Cryptographic Service Provider that will sign the document.- Parameters:
provider- the name of the provider, for example "SUN", ornullto use the default provider.
-
getPrivKey
Deprecated.Gets the private key.- Returns:
- the private key
-
getCrlList
Deprecated.Gets the certificate revocation list.- Returns:
- the certificate revocation list
-
getFilter
Deprecated.Gets the filter used to sign the document.- Returns:
- the filter used to sign the document
-
isNewField
public boolean isNewField()Deprecated.Checks if a new field was created.- Returns:
trueif a new field was created,falseif signing an existing field or if the signature is invisible
-
getPage
public int getPage()Deprecated.Gets the page number of the field.- Returns:
- the page number of the field
-
getFieldName
Deprecated.Gets the field name.- Returns:
- the field name
-
setFieldNameForInvisibleSignatures
Deprecated.Sets the field name for a new invisible signature field- Parameters:
fieldName- for the new invisible signature field
-
getPageRect
Deprecated.Gets the rectangle that represent the position and dimension of the signature in the page.- Returns:
- the rectangle that represent the position and dimension of the signature in the page
-
getSignDate
Deprecated.Gets the signature date.- Returns:
- the signature date
-
setSignDate
Deprecated.Sets the signature date.- Parameters:
signDate- the signature date
-
getSignDateNullSafe
Deprecated.Gets the signature date. If the date is not set the current Date is returned.- Returns:
- the signature date
-
getTempFile
Deprecated.Gets the temporary file.- Returns:
- the temporary file or
nullis the document is created in memory
-
getNewSigName
Deprecated.Gets a new signature fied name that doesn't clash with any existing name.- Returns:
- a new signature fied name
-
preClose
Deprecated.This is the first method to be called when using external signatures. The general sequence is: preClose(), getDocumentBytes() and close().If calling preClose() dont't call PdfStamper.close().
No external signatures are allowed if this method is called.
- Throws:
IOException- on errorDocumentException- on error
-
preClose
Deprecated.This is the first method to be called when using external signatures. The general sequence is: preClose(), getDocumentBytes() and close().If calling preClose() dont't call PdfStamper.close().
If using an external signature
exclusionSizesmust contain at least thePdfName.CONTENTSkey with the size that it will take in the document. Note that due to the hex string coding this size should be byte_size*2+2.- Parameters:
exclusionSizes- aHashMapwith names and sizes to be excluded in the signature calculation. The key is aPdfNameand the value anInteger. At least thePdfName.CONTENTSmust be present- Throws:
IOException- on errorDocumentException- on error
-
close
Deprecated.This is the last method to be called when using external signatures. The general sequence is: preClose(), getDocumentBytes() and close().updateis aPdfDictionarythat must have exactly the same keys as the ones provided inpreClose(Map).- Parameters:
update- aPdfDictionarywith the key/value that will fill the holes defined inpreClose(Map)- Throws:
DocumentException- on errorIOException- on error
-
getRangeStream
Deprecated.Gets the document bytes that are hashable when using external signatures. The general sequence is: preClose(), getRangeStream() and close().- Returns:
- the document bytes that are hashable
-
getCryptoDictionary
Deprecated.Gets the user made signature dictionary. This is the dictionary at the /V key.- Returns:
- the user made signature dictionary
-
setCryptoDictionary
Deprecated.Sets a user made signature dictionary. This is the dictionary at the /V key.- Parameters:
cryptoDictionary- a user made signature dictionary
-
getStamper
Deprecated.Gets thePdfStamperassociated with this instance.- Returns:
- the
PdfStamperassociated with this instance
-
isPreClosed
public boolean isPreClosed()Deprecated.Checks if the document is in the process of closing.- Returns:
trueif the document is in the process of closing,falseotherwise
-
getSigStandard
Deprecated.Gets the instance of the standard signature dictionary. This instance is only available after pre close.The main use is to insert external signatures.
- Returns:
- the instance of the standard signature dictionary
-
getContact
Deprecated.Gets the signing contact.- Returns:
- the signing contact
-
setContact
Deprecated.Sets the signing contact.- Parameters:
contact- the signing contact
-
getLayer2Font
Deprecated.Gets the n2 and n4 layer font.- Returns:
- the n2 and n4 layer font
-
setLayer2Font
Deprecated.Sets the n2 and n4 layer font. If the font size is zero, auto-fit will be used.- Parameters:
layer2Font- the n2 and n4 font
-
isAcro6Layers
public boolean isAcro6Layers()Deprecated.Gets the Acrobat 6.0 layer mode.- Returns:
- the Acrobat 6.0 layer mode
-
setAcro6Layers
public void setAcro6Layers(boolean acro6Layers) Deprecated.Acrobat 6.0 and higher recommends that only layer n2 and n4 be present. This method sets that mode.- Parameters:
acro6Layers- iftrueonly the layers n2 and n4 will be present
-
getRunDirection
public int getRunDirection()Deprecated.Gets the run direction.- Returns:
- the run direction
-
setRunDirection
public void setRunDirection(int runDirection) Deprecated.Sets the run direction in the n2 and n4 layer.- Parameters:
runDirection- the run direction
-
getSignatureEvent
Deprecated.Getter for property signatureEvent.- Returns:
- Value of property signatureEvent.
-
setSignatureEvent
Deprecated.Sets the signature event to allow modification of the signature dictionary.- Parameters:
signatureEvent- the signature event
-
getImage
Deprecated.Gets the background image for the layer 2.- Returns:
- the background image for the layer 2
-
setImage
Deprecated.Sets the background image for the layer 2.- Parameters:
image- the background image for the layer 2
-
getImageScale
public float getImageScale()Deprecated.Gets the scaling to be applied to the background image.- Returns:
- the scaling to be applied to the background image
-
setImageScale
public void setImageScale(float imageScale) Deprecated.Sets the scaling to be applied to the background image. If it's zero the image will fully fill the rectangle. If it's less than zero the image will fill the rectangle but will keep the proportions. If it's greater than zero that scaling will be applied. In any of the cases the image will always be centered. It's zero by default.- Parameters:
imageScale- the scaling to be applied to the background image
-
getCertificationLevel
public int getCertificationLevel()Deprecated.Gets the certified status of this document.- Returns:
- the certified status
-
setCertificationLevel
public void setCertificationLevel(int certificationLevel) Deprecated.Sets the document type to certified instead of simply signed.- Parameters:
certificationLevel- the values can be:NOT_CERTIFIED,CERTIFIED_NO_CHANGES_ALLOWED,CERTIFIED_FORM_FILLINGandCERTIFIED_FORM_FILLING_AND_ANNOTATIONS
-