|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public static interface EGIZSignatureHandler.Factory
An implementation of this Factory is required to create and control the EGIZSignatureHandler
Method Summary | |
---|---|
void |
doSign(EGIZSignatureHandler handler,
MessageDigest digest)
Do the actual signing. |
boolean |
doVerify(EGIZSignatureHandler handler,
MessageDigest digest)
Do the actual verification. |
int[] |
getCertificateSizes()
Get the value passed in to setCertificateSizes(int[]) |
MessageDigest |
getMessageDigest()
Return the MessageDigest object to be used by this Handler |
String |
getMethod()
Get the "method" field of the signature, eg "urn:pdfsigfilter:bka.gv.at:binaer:v1.1.0"; |
PDFPage |
getPage()
Return the PDFPage set set by setPage(org.faceless.pdf2.PDFPage, int, int, int, int) |
Rectangle |
getRectangle()
Return the Rectangle, as set set by setPage(org.faceless.pdf2.PDFPage, int, int, int, int) |
void |
populateCanvas(PDFCanvas canvas,
int width,
int height,
EGIZSignatureHandler handler)
Populate the supplied canvas with the signature appearance. |
void |
preSign(EGIZSignatureHandler handler,
KeyStore keystore,
String alias,
char[] password)
Set any fields in the Signature that need to be set prior to the start of the signing process. |
void |
preVerify(EGIZSignatureHandler handler)
Called right at the start of the verification process before the digest is created and the doVerify(org.faceless.pdf2.EGIZSignatureHandler, java.security.MessageDigest) method is called |
void |
setCertificateSizes(int[] sizes)
Set the size in bytes of each X.509 certificate that will be stored. |
void |
setLogo(PDFImage logo)
Set the logo to be displayed on the stamp |
void |
setPage(PDFPage page,
int x1,
int y1,
int x2,
int y2)
Set the page and size of the stamp that will be added by the signature |
Methods inherited from interface org.faceless.pdf2.SignatureHandlerFactory |
---|
getHandler |
Method Detail |
---|
void setLogo(PDFImage logo)
void setCertificateSizes(int[] sizes)
int[] getCertificateSizes()
setCertificateSizes(int[])
String getMethod()
void populateCanvas(PDFCanvas canvas, int width, int height, EGIZSignatureHandler handler)
PDFCanvas
of the specified size, containing text or images
representing the signature. Tokens must be inserted into the canvas to indicate
the location of the signature date, value, issuer, method and so on. These tokens
can be created using the createToken()
method of the handler
property.
canvas
- the Canvaswidth
- the width of the canvas in pointsheight
- the height of the canvas in pointshandler
- the SignatureHandler this canvas is being created forvoid setPage(PDFPage page, int x1, int y1, int x2, int y2)
page
- the PDFPage to stampx1
- the first X coordinatey1
- the first Y coordinatex2
- the second X coordinatey2
- the second Y coordinatePDFPage getPage()
setPage(org.faceless.pdf2.PDFPage, int, int, int, int)
Rectangle getRectangle()
setPage(org.faceless.pdf2.PDFPage, int, int, int, int)
MessageDigest getMessageDigest() throws NoSuchAlgorithmException
MessageDigest
object to be used by this Handler
NoSuchAlgorithmException
void preSign(EGIZSignatureHandler handler, KeyStore keystore, String alias, char[] password) throws GeneralSecurityException
populateCanvas()
handler
- the EGIZSignatureHandlerkeystore
- the KeyStorealias
- the aliaspassword
- the password
GeneralSecurityException
void preVerify(EGIZSignatureHandler handler) throws GeneralSecurityException
doVerify(org.faceless.pdf2.EGIZSignatureHandler, java.security.MessageDigest)
method is called
GeneralSecurityException
void doSign(EGIZSignatureHandler handler, MessageDigest digest) throws IOException, GeneralSecurityException, CertificateException
1. Create the signature somehow, then 2. Call "handler.setSignatureValue(data)" where "data" is a byte array containing the "Signaturwert" fields. This value will be base64 encoded by the handler. 3. Call "handler.setSignerInfo(info)" where info is a String containing the value of the "Unterzeichner" field. The value may contain a "\n" to control where the line is split. 4. Call "handler.setIssuerInfo(info)" where info is a String containing the value of the "Aussteller-Zertifikat" field. The value may contain a "\n" to control where the line is split. 5. Call "handler.setCertificates(certs)" where "certs" is an array of javax.security.certs.X509Certificate. 6. Call "handler.setSignDate(date)" where "date" is a java.util.Calendar 7. Call "handler.setSerialNumber(num)" where "num" is a java.math.BigInteger 8. Call "handler.setParameter(val)" where "val" is a String.The
setNNN
method calls can be made in any order.
IOException
GeneralSecurityException
CertificateException
boolean doVerify(EGIZSignatureHandler handler, MessageDigest digest) throws GeneralSecurityException, IOException
SignatureHandler.getMessageDigest()
, which has been udpated
with the digestable parts of the PDF. It should return true if the signature
is consided valid by this handler.
GeneralSecurityException
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |