我正在寻找一个允许创建和验证XAdES签名的Java库(格式越多越好:XAdES-BES,XAdES-C,XAdES-XL等).
我发现最有趣的实现是:
您建议使用哪个或建立哪个?
在代码运行的系统上设置的时区中,获取ZonedDateTime(表示当前日期的开始和结束)的正确和更简洁的方法是什么?
以下代码是不是太复杂了?
ZonedDateTime nowInZone = SystemClock.Instance.Now.InZone(DateTimeZoneProviders.Bcl.GetSystemDefault());
ZonedDateTime start = new LocalDateTime(nowInZone.Year, nowInZone.Month, nowInZone.Day, 0, 0, 0).InZoneStrictly(DateTimeZoneProviders.Bcl.GetSystemDefault());
ZonedDateTime end = new LocalDateTime(nowInZone.Year, nowInZone.Month, nowInZone.Day, 23, 59, 59).InZoneStrictly(DateTimeZoneProviders.Bcl.GetSystemDefault());
Run Code Online (Sandbox Code Playgroud)
鉴于这些值,我需要测试另一个ZonedDateTime是否在它们之间.
我有一个 PDF ( https://github.com/giacgbj/stackOverflow/blob/master/xxx.pdf ),以某种方式由第三方进行数字签名,其签名具有外观
当我使用以下代码(iText 7.1.0)拼合PDF(https://github.com/giacgbj/stackOverflow/blob/master/xxxFlattened.pdf )时
try (PdfWriter output = new PdfWriter("output.pdf");
PdfDocument input = new PdfDocument(new PdfReader("input.pdf"), output)) {
PdfAcroForm.getAcroForm(input, true).flattenFields();
}
Run Code Online (Sandbox Code Playgroud)
签名的外观被拉伸成这样:
使用 PDFBox 或 GhostScript 等命令行参数或转换 (imagemagick) 或 pdf2ps/ps2pdf 可以拼合相同的 PDF。
这种行为的原因是什么?