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 SummaryConstructors
- 
Method SummaryModifier 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- 
Signpublic Sign()
 
- 
- 
Method Details- 
get
- 
importCertificatepublic void importCertificate(String sid, File crtFile, File keyFile) throws FeatureNotEnabledException, com.logicaldoc.gui.common.client.ServerException - Throws:
- FeatureNotEnabledException
- com.logicaldoc.gui.common.client.ServerException
 
- 
generateNewCertificatepublic void generateNewCertificate(String sid) throws FeatureNotEnabledException, com.logicaldoc.gui.common.client.ServerException - Throws:
- FeatureNotEnabledException
- com.logicaldoc.gui.common.client.ServerException
 
- 
processExpressionpublic 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 tenant
- pageWidth- width of the page
- pageHeight- height of the page
- imageWidth- width of the image
- imageHeight- height of the image
- Returns:
- The coordinate
 
- 
signpublic 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
 
 
-