pdfsignature-ag凯发旗舰厅



com.spire.pdf.security
class pdfsignature

java.lang.object
  extended by com.spire.pdf.security.pdfsignature

public class pdfsignature
extends java.lang.object

represents a digital signature used for signing a pdf document.


constructor summary
pdfsignature()
           
pdfsignature(pdfdocumentbase document, pdfpagebase page, pdfcertificate certificate, java.lang.string signaturename)
           
(pdfdocumentbase document, pdfpagebase page, pdfcertificate certificate, java.lang.string signaturename, pdfsignaturefieldwidget fieldwidget)
           
(pdfdocumentbase document, pdfpagebase page, pdfcertificate certificate, java.lang.string signaturename, java.awt.geom.rectangle2d bounds)
          initializes a new instance of the class.
pdfsignature(pdfdocument document, pdfpagebase page, pdfcertificate certificate, java.lang.string signaturename)
           
(pdfdocument document, pdfpagebase page, pdfcertificate certificate, java.lang.string signaturename, pdfsignaturefieldwidget fieldwidget)
           
(pdfdocument document, pdfpagebase page, pdfcertificate certificate, java.lang.string signaturename, java.awt.geom.rectangle2d bounds)
           
pdfsignature(pdfnewpage page, pdfcertificate cert, java.lang.string signaturename)
           
 
method summary
 void addshowconfiguretext(signatureconfiguretext config)
           
 void (iocspresponsegenerate handler, com.spire.ms.system.security.cryptography.x509certificates.x509certificate2collection extracertificates)
          configure ocsp which must conform to rfc 2560.
 void configurehttpocsp(java.lang.string ocspurl, com.spire.ms.system.security.cryptography.x509certificates.x509certificate2collection extracertificates)
          configure ocsp which must conform to rfc 2560.
 void configuretimestamp(igeneratetimestamp handler)
          configure timestamp which must conform to rfc 3161.
 void configuretimestamp(java.lang.string tsaurl)
          configure timestamp which must conform to rfc 3161.
 void configuretimestamp(java.lang.string tsaurl, java.lang.string tsausername, java.lang.string tsapassword)
          configure timestamp which must conform to rfc 3161.
 pdfcertificate getcertificate()
          gets signing certificate.
 com.spire.ms.system.security.cryptography.x509certificates.x509certificate2collection getcertificates()
          get all certificates.
  getconfiggraphictype()
          digital signature graphic type
 boolean getcustomsignposition()
           
 java.util.date getdate()
          get signature datetime
 java.lang.string getdigitalsigner()
          deprecated. 
 java.lang.string getdigitalsignerlable()
          deprecated. 
 java.lang.string getname()
          digital signature common name
 java.util.enumset<signatureconfiguretext> getshowconfiguretext()
          show digital signature,configuer text
 java.lang.string getsignaturename()
          get/set pdf signature name
 java.util.hashmap getsigninfofont()
          get signature info font
 signtextalignment getsigntextalignment()
          sets the alignment of signature text
 boolean istag()
          digital signature whether to display the label
 void istag(boolean value)
          digital signature whether to display the label
 void removeshowconfiguretext(signatureconfiguretext config)
           
 void setbounds(java.awt.geom.rectangle2d value)
           
 void setcertificated(boolean value)
          sets a value indicating certificate document or not.
 void setconfiggraphictype( value)
          deprecated. 
 void setcontactinfo(java.lang.string value)
          sets information provided by the signer to enable a recipient to contact
 void setcontactinfolabel(java.lang.string value)
          digital signature contactinfo label
 void setcustomsigndetailposition(float infox, float infoy, float infowidth, float infoheight)
          define sign anem ,unit is percent,for example,whole area0,0,1,1...
 void setcustomsignimageposition(float imagex, float imagey, float imagewidth, float imageheight)
          define sign image area,unit is percent,for example,whole area0,0,1,1...
 void setcustomsignnameposition(float namex, float namey, float namewidth, float nameheight)
          define sign anem ,unit is percent,for example,whole area0,0,1,1...
 void setcustomsignposition(boolean customsignposition)
           
 void setdate(java.util.date value)
          set signature date
 void setdatelabel(java.lang.string value)
          digital signature date label
 void setdigitalsigner(java.lang.string value)
          deprecated. 
 void setdigitalsignerlable(java.lang.string value)
          deprecated. 
 void setdistinguishedname(java.lang.string value)
          sets distinguishedname values
 void setdistinguishednamelabel(java.lang.string value)
          set digital signature distinguished label
 void setdocumentpermissions(pdfcertificationflags value)
          sets the permission for certificated document.
 void setgraphicmode(graphicmode value)
          digital signature graphic type
 void setlocationinfo(java.lang.string value)
          sets the physical location of the signing.
 void setlocationinfolabel(java.lang.string value)
          set digital signature locationinfo label
 void setname(java.lang.string value)
          set digital signature common name
 void setnamelabel(java.lang.string value)
          set digital signature common name label
 void setreason(java.lang.string value)
          sets reason of signing
 void setreasonlabel(java.lang.string value)
          digital signature reason label
 void setshowconfiguretext(java.util.enumset<signatureconfiguretext> value)
           
 void setsignaturename(java.lang.string value)
           
 void setsigndetailsfont(pdffontbase value)
          set the signdetails font.
 void setsignfontcolor(com.spire.ms.system.drawing.color value)
          set font color for the signature info if not set, the default is black
 void setsignimagelayout(signimagelayout value)
          set the sign image layout.
 void setsignimagesource(pdfimage value)
          digital signature configuer graphic file path
 void setsigninfofont(java.util.hashmap value)
           
 void setsignnamefont(pdffontbase value)
          set the sign name font.
 void setsigntextalignment(signtextalignment value)
          sets the alignment of signature text
 boolean verifydocmodified()
          check if the document was altered after signed.
 boolean verifysignature()
          check thie validity of the signature
 
constructor detail

pdfsignature

public pdfsignature()

pdfsignature

public pdfsignature(pdfnewpage page,
                    pdfcertificate cert,
                    java.lang.string signaturename)

pdfsignature

public pdfsignature(pdfdocumentbase document,
                    pdfpagebase page,
                    pdfcertificate certificate,
                    java.lang.string signaturename,
                    java.awt.geom.rectangle2d bounds)
initializes a new instance of the class.
parameters:
document - the document, which has the page.
page - the page.
certificate - the certificate.
signaturename - the name of the signature.
bounds - the bounds

pdfsignature

public pdfsignature(pdfdocumentbase document,
                    pdfpagebase page,
                    pdfcertificate certificate,
                    java.lang.string signaturename)

pdfsignature

public pdfsignature(pdfdocumentbase document,
                    pdfpagebase page,
                    pdfcertificate certificate,
                    java.lang.string signaturename,
                    pdfsignaturefieldwidget fieldwidget)

pdfsignature

public pdfsignature(pdfdocument document,
                    pdfpagebase page,
                    pdfcertificate certificate,
                    java.lang.string signaturename,
                    java.awt.geom.rectangle2d bounds)

pdfsignature

public pdfsignature(pdfdocument document,
                    pdfpagebase page,
                    pdfcertificate certificate,
                    java.lang.string signaturename)

pdfsignature

public pdfsignature(pdfdocument document,
                    pdfpagebase page,
                    pdfcertificate certificate,
                    java.lang.string signaturename,
                    pdfsignaturefieldwidget fieldwidget)
method detail

getcertificates

public com.spire.ms.system.security.cryptography.x509certificates.x509certificate2collection getcertificates()
get all certificates.

setbounds

public void setbounds(java.awt.geom.rectangle2d value)

setcontactinfo

public void setcontactinfo(java.lang.string value)
sets information provided by the signer to enable a recipient to contact
parameters:
value - the signer to verify the signature; for example, a phone number

setreason

public void setreason(java.lang.string value)
sets reason of signing

setlocationinfo

public void setlocationinfo(java.lang.string value)
sets the physical location of the signing.
parameters:
value - locationinfo

setcertificated

public void setcertificated(boolean value)
sets a value indicating certificate document or not.
parameters:
value - certificate document if true.

setdocumentpermissions

public void setdocumentpermissions(pdfcertificationflags value)
sets the permission for certificated document.
parameters:
value - the pdfcertificationflags

getcertificate

public pdfcertificate getcertificate()
gets signing certificate.
throws:
com.spire.ms.system.exception

getsigntextalignment

public signtextalignment getsigntextalignment()
sets the alignment of signature text
returns:

setsigntextalignment

public void setsigntextalignment(signtextalignment value)
sets the alignment of signature text

getdate

public java.util.date getdate()
get signature datetime

setdate

public void setdate(java.util.date value)
set signature date

getsignaturename

public java.lang.string getsignaturename()
get/set pdf signature name

setsignaturename

public void setsignaturename(java.lang.string value)

setsignnamefont

public void setsignnamefont(pdffontbase value)
set the sign name font. note: this font applys to sign name when the graphicmode is signnameonly or signnameandsigndetail. if not set, the default font will be applied.
parameters:
value -

setsignfontcolor

public void setsignfontcolor(com.spire.ms.system.drawing.color value)
set font color for the signature info if not set, the default is black
parameters:
value -

setsigndetailsfont

public void setsigndetailsfont(pdffontbase value)
set the signdetails font. note: if not set, the default font will be applied.
parameters:
value -

getsigninfofont

public java.util.hashmap getsigninfofont()
get signature info font

setsigninfofont

public void setsigninfofont(java.util.hashmap value)

getdigitalsigner

@deprecated
public java.lang.string getdigitalsigner()
deprecated. 
the name of the person or authority signing the document, usually called signer.
returns:

setdigitalsigner

@deprecated
public void setdigitalsigner(java.lang.string value)
deprecated. 
the name of the person or authority signing the document, usually called signer.

getdigitalsignerlable

@deprecated
public java.lang.string getdigitalsignerlable()
deprecated. 
digital signature common name label
returns:

setdigitalsignerlable

@deprecated
public void setdigitalsignerlable(java.lang.string value)
deprecated. 
digital signature common name label

getname

public java.lang.string getname()
digital signature common name

setname

public void setname(java.lang.string value)
set digital signature common name

setnamelabel

public void setnamelabel(java.lang.string value)
set digital signature common name label

setdistinguishednamelabel

public void setdistinguishednamelabel(java.lang.string value)
set digital signature distinguished label

setdistinguishedname

public void setdistinguishedname(java.lang.string value)
sets distinguishedname values
parameters:
value -

istag

public boolean istag()
digital signature whether to display the label

istag

public void istag(boolean value)
digital signature whether to display the label

getshowconfiguretext

public java.util.enumset<signatureconfiguretext> getshowconfiguretext()
show digital signature,configuer text

setshowconfiguretext

public void setshowconfiguretext(java.util.enumset<signatureconfiguretext> value)

addshowconfiguretext

public void addshowconfiguretext(signatureconfiguretext config)

removeshowconfiguretext

public void removeshowconfiguretext(signatureconfiguretext config)

setgraphicmode

public void setgraphicmode(graphicmode value)
digital signature graphic type

setcustomsignposition

public void setcustomsignposition(boolean customsignposition)

getcustomsignposition

public boolean getcustomsignposition()

setcustomsignimageposition

public void setcustomsignimageposition(float imagex,
                                       float imagey,
                                       float imagewidth,
                                       float imageheight)
define sign image area,unit is percent,for example,whole area0,0,1,1...

setcustomsignnameposition

public void setcustomsignnameposition(float namex,
                                      float namey,
                                      float namewidth,
                                      float nameheight)
define sign anem ,unit is percent,for example,whole area0,0,1,1...

setcustomsigndetailposition

public void setcustomsigndetailposition(float infox,
                                        float infoy,
                                        float infowidth,
                                        float infoheight)
define sign anem ,unit is percent,for example,whole area0,0,1,1...

getconfiggraphictype

public  getconfiggraphictype()
digital signature graphic type
returns:

setconfiggraphictype

@deprecated
public void setconfiggraphictype( value)
deprecated. 
digital signature graphic type

setsignimagesource

public void setsignimagesource(pdfimage value)
digital signature configuer graphic file path

setsignimagelayout

public void setsignimagelayout(signimagelayout value)
set the sign image layout.

setreasonlabel

public void setreasonlabel(java.lang.string value)
digital signature reason label

setdatelabel

public void setdatelabel(java.lang.string value)
digital signature date label

setcontactinfolabel

public void setcontactinfolabel(java.lang.string value)
digital signature contactinfo label

setlocationinfolabel

public void setlocationinfolabel(java.lang.string value)
set digital signature locationinfo label

verifysignature

public boolean verifysignature()
check thie validity of the signature

verifydocmodified

public boolean verifydocmodified()
check if the document was altered after signed. true if modified; otherwise false.
returns:
doc modified

configuretimestamp

public void configuretimestamp(java.lang.string tsaurl)
configure timestamp which must conform to rfc 3161.
parameters:
tsaurl - tsa url
throws:
com.spire.ms.system.exception

configuretimestamp

public void configuretimestamp(java.lang.string tsaurl,
                               java.lang.string tsausername,
                               java.lang.string tsapassword)
configure timestamp which must conform to rfc 3161.
parameters:
tsaurl - tsa url
tsausername - tsa username
tsapassword - tsa password
throws:
com.spire.ms.system.exception

configuretimestamp

public void configuretimestamp(igeneratetimestamp handler)
configure timestamp which must conform to rfc 3161.
parameters:
handler -

configurehttpocsp

public void configurehttpocsp(java.lang.string ocspurl,
                              com.spire.ms.system.security.cryptography.x509certificates.x509certificate2collection extracertificates)
configure ocsp which must conform to rfc 2560.
parameters:
ocspurl - ocsp url. it it's null it will be taken from the checked cert.
extracertificates - represents an additional collection of certificates that can be searched. if null,only use windows cert store.
throws:
com.spire.ms.system.exception

configurecustomocsp

public void configurecustomocsp(iocspresponsegenerate handler,
                                com.spire.ms.system.security.cryptography.x509certificates.x509certificate2collection extracertificates)
configure ocsp which must conform to rfc 2560.
parameters:
handler - the handler which generate ocsp response.
extracertificates - represents an additional collection of certificates that can be searched if null,only use windows cert store.


网站地图