使用密钥对的公钥加密数据以后,如果将二进制数据放到 C#程序中使用私钥解密,是没有问题的,但是如果放到 openssl 中进行解密,则直接提示
140029040199320:error:0D0680A8:asn1 encoding routines:ASN1_CHECK_TLEN:wrong tag:tasn_dec.c:1217:
140029040199320:error:0D06C03A:asn1 encoding routines:ASN1_D2I_EX_PRIMITIVE:nested asn1 error:tasn_dec.c:785:
140029040199320:error:0D08303A:asn1 encoding routines:ASN1_TEMPLATE_NOEXP_D2I:nested asn1 error:tasn_dec.c:717:Field=n, Type=RSA
140029040199320:error:04093004:rsa routines:OLD_RSA_PRIV_DECODE:RSA lib:rsa_ameth.c:119:
140029040199320:error:0407B07B:rsa routines:RSA_check_key:d e not congruent to 1:rsa_chk.c:148:
140029040199320:error:0407B07C:rsa routines:RSA_check_key:dmp1 not congruent to d:rsa_chk.c:167:
140029040199320:error:0407B07D:rsa routines:RSA_check_key:dmq1 not congruent to d:rsa_chk.c:185:
140029040199320:error:0407B07E:rsa routines:RSA_check_key:iqmp not inverse of q:rsa_chk.c:196:
若使用 openssl 库进行解密,则提示
rsa_ossl_private_decrypt:padding check failed
有人遇到过这个问题吗?
140029040199320:error:0D0680A8:asn1 encoding routines:ASN1_CHECK_TLEN:wrong tag:tasn_dec.c:1217:
140029040199320:error:0D06C03A:asn1 encoding routines:ASN1_D2I_EX_PRIMITIVE:nested asn1 error:tasn_dec.c:785:
140029040199320:error:0D08303A:asn1 encoding routines:ASN1_TEMPLATE_NOEXP_D2I:nested asn1 error:tasn_dec.c:717:Field=n, Type=RSA
140029040199320:error:04093004:rsa routines:OLD_RSA_PRIV_DECODE:RSA lib:rsa_ameth.c:119:
140029040199320:error:0407B07B:rsa routines:RSA_check_key:d e not congruent to 1:rsa_chk.c:148:
140029040199320:error:0407B07C:rsa routines:RSA_check_key:dmp1 not congruent to d:rsa_chk.c:167:
140029040199320:error:0407B07D:rsa routines:RSA_check_key:dmq1 not congruent to d:rsa_chk.c:185:
140029040199320:error:0407B07E:rsa routines:RSA_check_key:iqmp not inverse of q:rsa_chk.c:196:
若使用 openssl 库进行解密,则提示
rsa_ossl_private_decrypt:padding check failed
有人遇到过这个问题吗?