public class OFDValidator extends Object implements Closeable
| 构造器和说明 |
|---|
OFDValidator(OFDReader reader)
创建一个OFD验证引擎
|
| 限定符和类型 | 方法和说明 |
|---|---|
void |
checkSignedValue(org.ofdrw.core.signatures.SigType type,
String alg,
Path signatureFilePath,
Path signedValuePath)
检查电子签章数据
|
void |
close() |
void |
exeValidate()
执行OFD电子签名验证
|
OFDValidator |
setValidator(SignedDataValidateContainer validator)
设置用于电子签章数据验证的容器
|
public OFDValidator(OFDReader reader)
reader - OFD解析器public void exeValidate()
throws OFDVerifyException,
IOException,
GeneralSecurityException
OFDVerifyException - 验证异常,电子签名失效DocNotSignException - 文件未进行电子签名IOException - 文件读写过程中IO异常NoSuchAlgorithmException - 未知的杂凑算法GeneralSecurityExceptionpublic OFDValidator setValidator(SignedDataValidateContainer validator)
validator - 验证容器public void checkSignedValue(org.ofdrw.core.signatures.SigType type,
String alg,
Path signatureFilePath,
Path signedValuePath)
throws IOException,
GeneralSecurityException
type - 验证类型 数字签名/电子签章alg - 算法名称signatureFilePath - 签名文件(Signature.xml)路径signedValuePath - 签名值文件(SignedValue.dat)路径InvalidSignedValueException - 电子签章数据失效IOException - IO异常GeneralSecurityExceptionpublic void close()
throws IOException
close 在接口中 Closeableclose 在接口中 AutoCloseableIOExceptionCopyright © 2023. All rights reserved.