Class Sign

java.lang.Object
com.logicaldoc.sign.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 Details

    • Sign

      public Sign()
  • Method Details

    • get

      public static Sign get()
    • importCertificate

      public void importCertificate(String sid, File crtFile, File keyFile) throws FeatureNotEnabledException, com.logicaldoc.gui.common.client.ServerException
      Throws:
      FeatureNotEnabledException
      com.logicaldoc.gui.common.client.ServerException
    • generateNewCertificate

      public void generateNewCertificate(String sid) throws FeatureNotEnabledException, com.logicaldoc.gui.common.client.ServerException
      Throws:
      FeatureNotEnabledException
      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 List<Long> sign(String sid, com.logicaldoc.core.security.user.User user, Set<Long> docIds, String reason, int page, String signX, String signY, String signWidth) throws IOException, UnrecoverableKeyException, KeyStoreException, NoSuchAlgorithmException, CertificateException, com.logicaldoc.core.PersistenceException, FeatureNotEnabledException, com.logicaldoc.gui.common.client.ServerException, com.logicaldoc.core.automation.AutomationException
      Signs a set of documents
      Parameters:
      sid - The current session
      user - The user
      docIds - Set of IDs to sign
      reason - Reason for the signature
      page - index of the page to use
      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
      Returns:
      The list of signed documents
      Throws:
      IOException - I/O error
      com.logicaldoc.core.PersistenceException - Error in the data layer
      CertificateException - Error accessing the certificate
      NoSuchAlgorithmException - Error accessing the certificate
      KeyStoreException - Error accessing the certificate
      UnrecoverableKeyException - Error accessing the certificate
      FeatureNotEnabledException - Feature not enabled in the license
      com.logicaldoc.gui.common.client.ServerException - A generic error
      com.logicaldoc.core.automation.AutomationException - the script of the visual representation has been evaluated but produced an error