Class Sign


  • public class Sign
    extends Object
    A front-end to OpenSSL and Java cryptography to handle certificates.
    Since:
    7.1.2
    Author:
    Marco Meschieri - LogicalDOC
    • Constructor Detail

      • Sign

        public Sign()
    • Method Detail

      • get

        public static Sign get()
      • generateNewCertificate

        public void generateNewCertificate​(String sid)
                                    throws com.logicaldoc.gui.common.client.ServerException
        Throws:
        com.logicaldoc.gui.common.client.ServerException
      • processExpression

        public static int processExpression​(String expression,
                                            long tenantId,
                                            int pageWidth,
                                            int pageHeight,
                                            int imageWidth,
                                            int imageHeight)
        Processes the expression for X or Y positioning. Available variables are:
        1. PAGE_WIDTH
        2. PAGE_HEIGHT
        3. PAGE_CENTER
        4. PAGE_MIDDLE
        5. IMAGE_WIDTH
        6. IMAGE_HEIGHT
        Parameters:
        expression - The expression to process(you can use the macros)
        tenantId - identifier of the tenant
        pageWidth - width of the page
        pageHeight - height of the page
        imageWidth - width of the image
        imageHeight - height of the image
        Returns:
        The coordinate
      • sign

        public Long[] sign​(String sid,
                           com.logicaldoc.core.security.User user,
                           long[] docIds,
                           String reason,
                           int page,
                           String signX,
                           String signY,
                           String signWidth)
                    throws Exception
        Signs a set of documents
        Parameters:
        sid - The current session
        user - The user
        docIds - Array of IDs to sign
        reason - Reason for the signature
        signX - X position to override the default one defined in the Keystore
        signY - Y position to override the default one defined in the Keystore
        signWidth - Width to override the default one defined in the Keystore
        page - index of the page to use
        Returns:
        The list of signed documents
        Throws:
        Exception - A generic error