[Tex/LaTex] How to attach a digital signature to the pdf created by xetex

copyrightdrmSecurityxetex

I want to create a locked document created by XeLaTeX, using \special command. The instructions are provided here. By setting perm as 0x0904 the document can be signed in Acrobat (If there has been a signature region before).

I have found that digsig package and eforms package can help me to produce a signature region by loading pdfLaTeX. The instructions can be refered here. However, both of them do not work in XeLaTeX, which confuses me a lot (Because I have to create a document by XeLaTeX). I wonder if there is a method to make them effective in XeLaTeX? If not, is there a better package to support the digital signature?

Best Answer

Inserting the following code somewhere would work

\special{pdf:ann width 3in height 1in
  <<
    /T (My Signature)
    /Subtype /Widget
    /FT /Sig
    /F 4
    /Q 1
    /MK << /BC [] >>
  >>
}

This is XeLaTeX version of what digsig.sty actually does.