32 lines
631 B
Plaintext
Executable File
32 lines
631 B
Plaintext
Executable File
package com.fp.frontend.validators;
|
|
|
|
import java.io.InputStream;
|
|
|
|
import com.lowagie.text.pdf.AcroFields;
|
|
import com.lowagie.text.pdf.PdfReader;
|
|
|
|
public class DocFirmaValidator {
|
|
|
|
public static boolean validDocSign(InputStream path) {
|
|
boolean validSign = false;
|
|
try {
|
|
PdfReader reader = new PdfReader(path);
|
|
if (reader != null) {
|
|
AcroFields af = reader.getAcroFields();
|
|
if (af != null) {
|
|
if (af.getSignatureNames() != null
|
|
&& af.getSignatureNames().size() != 0) {
|
|
|
|
validSign = true;
|
|
}
|
|
}
|
|
}
|
|
|
|
} catch (Exception e) {
|
|
|
|
}
|
|
return validSign;
|
|
}
|
|
|
|
}
|