如何验证使用RSASSA-PSS的RFC3161时间戳记令牌

时间:2019-01-29 16:01:24

标签: encryption openssl cryptography bouncycastle rfc3161

我的时间戳提供者最近从使用 rsaEncryption 签名时间戳令牌到 rsassaPss see the diff of the asn1parse here)。

在进行更改之前,我在OpenSSL(v1.1.1a)中使用以下命令来验证时间戳记令牌:

$ openssl ts -verify -partial_chain -in token-rsaencryption.der -token_in \
> -digest bcbfcee484a9b243bafad6b8a43e0ddc1bf091837463e7c717495395eefbc2a6 \
> -CAfile cert.pem -untrusted cert.pem
Verification: OK
Using configuration from C:/Program Files/Git/mingw64/ssl/openssl.cnf

但是该命令不再起作用。

$ openssl ts -verify -partial_chain -in token-rsassapss.der -token_in \
> -digest 00017f0b41ce9649602a0218cd02ed0b0a3d93130329451cc782b7dfda79ce71 \
> -CAfile cert.pem -untrusted cert.pem
Verification: FAILED
Using configuration from C:/Program Files/Git/mingw64/ssl/openssl.cnf 
14548:error:0407008A:rsa routines:RSA_padding_check_PKCS1_type_1:invalid padding:../openssl-1.1.1a/crypto/rsa/rsa_pk1.c:67:
14548:error:04067072:rsa routines:rsa_ossl_public_decrypt:padding check failed:../openssl-1.1.1a/crypto/rsa/rsa_ossl.c:582:
14548:error:21071069:PKCS7 routines:PKCS7_signatureVerify:signature failure:../openssl-1.1.1a/crypto/pkcs7/pk7_doit.c:1037:
14548:error:2F06A06D:time stamp routines:TS_RESP_verify_signature:signature failure:../openssl-1.1.1a/crypto/ts/ts_rsp_verify.c:143:

可能是因为RSASSA-PSS is not supported in timestamp verification using OpenSSL yet

是否还有其他选项可以用rsassaPss验证RFC3161令牌?

如果要查看文件,请同时使用时间戳记令牌(rsaEncryption和rsassaPss)和签名证书are in this zip

0 个答案:

没有答案