Package com.logicaldoc.sign
Class Sign
java.lang.Object
com.logicaldoc.sign.Sign
A front-end to OpenSSL and Java cryptography to handle certificates.
- Since:
- 7.1.2
- Author:
- Marco Meschieri - LogicalDOC
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidstatic Signget()voidimportCertificate(String sid, File crtFile, File keyFile) static intprocessExpression(String expression, long tenantId, int pageWidth, int pageHeight, int imageWidth, int imageHeight) Processes the expression for X or Y positioning.sign(String sid, com.logicaldoc.core.security.user.User user, Set<Long> docIds, String reason, int page, String signX, String signY, String signWidth) Signs a set of documents
-
Constructor Details
-
Sign
public Sign()
-
-
Method Details
-
get
-
importCertificate
public void importCertificate(String sid, File crtFile, File keyFile) throws FeatureNotEnabledException, com.logicaldoc.gui.common.client.ServerException - Throws:
FeatureNotEnabledExceptioncom.logicaldoc.gui.common.client.ServerException
-
generateNewCertificate
public void generateNewCertificate(String sid) throws FeatureNotEnabledException, com.logicaldoc.gui.common.client.ServerException - Throws:
FeatureNotEnabledExceptioncom.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:- PAGE_WIDTH
- PAGE_HEIGHT
- PAGE_CENTER
- PAGE_MIDDLE
- IMAGE_WIDTH
- IMAGE_HEIGHT
- Parameters:
expression- The expression to process(you can use the macros)tenantId- identifier of the tenantpageWidth- width of the pagepageHeight- height of the pageimageWidth- width of the imageimageHeight- 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 sessionuser- The userdocIds- Set of IDs to signreason- Reason for the signaturepage- index of the page to usesignX- X position to override the default one defined in the KeystoresignY- Y position to override the default one defined in the KeystoresignWidth- Width to override the default one defined in the Keystore- Returns:
- The list of signed documents
- Throws:
IOException- I/O errorcom.logicaldoc.core.PersistenceException- Error in the data layerCertificateException- Error accessing the certificateNoSuchAlgorithmException- Error accessing the certificateKeyStoreException- Error accessing the certificateUnrecoverableKeyException- Error accessing the certificateFeatureNotEnabledException- Feature not enabled in the licensecom.logicaldoc.gui.common.client.ServerException- A generic errorcom.logicaldoc.core.automation.AutomationException- the script of the visual representation has been evaluated but produced an error
-