admin管理员组文章数量:1122846
I'm trying to sign a pdf (converted to a hash) using . So far I'm sending the TSR, and receive a binary response like so.
So far so good. Now let's parse:
I then (upon validation) I attempt to decode the binary response I received from the freetsa endpoint (using the validateTimestamp method) but I'm having trouble parsing the decoded response.
The problem:
Specifically in this line:
$parsed = ASN1::asn1map($decoded[0], $schema)
I'm getting an empty response ($parsed is empty), and the reason is the schema that I'm passing is incorrect.
What I already tried:
I tried using the RFC3161 schema but I couldn't get it to work (still empty responses), so I attempted building the schema from scratch. To the best of my ability, so far I've only been able to create this schema, but it's not complete.
Where I'm at now:
Now the $parsed
variable is not empty, but there's still some data that need to be parsed too (the schema I'm passing is not complete yet).
There has to be an easier way to parse the TSR in php, I don't believe everyone is going through the hustle of trying to figure out the schema manually. It's very strict and unforgiving and even a single mistake results in parse errors.
Q:
Is there a better way to decode the response in php? (or at least to get the schema correct 100%?)
p.s: I do have the response of freetsa (.tsr) and the decoded output of openssl ts -reply -in response.tsr -text
in case that helps.
Thanks
本文标签: How to properly decode the (timestamp signature) response of freetsaorg TSR in PHPStack Overflow
版权声明:本文标题:How to properly decode the (timestamp signature) response of freetsa.org TSR in PHP? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736301771a1931292.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论