由可信的第三方(“时间加盖权”,TSA)以电子形式认证给定事件的时间的过程。欧盟法规eIDAS赋予了这些时间戳法律力量--也就是说,任何人都不能对事件的时间或内容提出异议,如果它是时间戳的话。它适用于多种场景,包括时间戳审计日志。(注:时间戳对于良好的审计跟踪是不够的,因为它不能阻止恶意参与者完全删除事件)
可信时间戳有许多标准,核心标像大多数射频控制器一样,它很难读懂。幸运的是,对于Java用户来说,Bouncy城堡实现了这个标准。不幸的是,与大多数安全API一样,使用它是很困难的,甚至是非常糟糕的。我必须实现它,所以我将共享时间戳数据所需的代码。
,但我会尽力解释主要的流程。显然,有大量的代码可以简单地遵循标准。邦西城堡类是一个很难导航的迷宫。
主要的方法显然是timestamp(hash, tsaURL, username, password, tsaPolicyOid)
:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
|