You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A number of methods that expect to be passed a DER-encoded
BasicOCSPResponse had confusing Javadoc suggesting that they expect a
full OCSPResponse structure, but do not do any sanity checking.
This causes iText to output botched ASN.1 structures without informing the
user.
RES-382
Autoported commit.
Original commit hash: [147f3f6e1]
Copy file name to clipboardExpand all lines: itext/itext.sign/itext/signatures/PdfPKCS7.cs
+60-22Lines changed: 60 additions & 22 deletions
Original file line number
Diff line number
Diff line change
@@ -664,16 +664,26 @@ public virtual byte[] GetEncodedPKCS7(byte[] secondDigest) {
664
664
/// Gets the bytes for the PKCS7SignedData object. Optionally the authenticatedAttributes
665
665
/// in the signerInfo can also be set, and/or a time-stamp-authority client
666
666
/// may be provided.
667
+
/// <para />
668
+
/// Note: do not pass in the full DER-encoded OCSPResponse object obtained from the responder,
669
+
/// only the DER-encoded BasicOCSPResponse value contained in the response data.
667
670
/// </remarks>
668
671
/// <param name="secondDigest">the digest in the authenticatedAttributes</param>
669
672
/// <param name="tsaClient">TSAClient - null or an optional time stamp authority client</param>
670
-
/// <param name="ocsp">DER-encoded OCSP response for the first certificate in the signature certificates chain, or null if OCSP revocation data is not to be added.
671
-
/// </param>
672
-
/// <param name="crlBytes">collection of DER-encoded CRL for certificates from the signature certificates chain, or null if CRL revocation data is not to be added.
673
-
/// </param>
674
-
/// <param name="sigtype">specifies the PKCS7 standard flavor to which created PKCS7SignedData object will adhere: either basic CMS or CAdES
675
-
/// </param>
673
+
/// <param name="ocsp">
674
+
/// DER-encoded BasicOCSPResponse for the first certificate in the signature certificates chain,
675
+
/// or null if OCSP revocation data is not to be added.
676
+
/// </param>
677
+
/// <param name="crlBytes">
678
+
/// collection of DER-encoded CRL for certificates from the signature certificates chain,
679
+
/// or null if CRL revocation data is not to be added.
680
+
/// </param>
681
+
/// <param name="sigtype">
682
+
/// specifies the PKCS7 standard flavor to which created PKCS7SignedData object will adhere:
683
+
/// either basic CMS or CAdES
684
+
/// </param>
676
685
/// <returns>byte[] the bytes for the PKCS7SignedData object</returns>
/// Gets the bytes for the PKCS7SignedData object. Optionally the authenticatedAttributes
688
698
/// in the signerInfo can also be set, and/or a time-stamp-authority client
689
699
/// may be provided.
700
+
/// <para />
701
+
/// Note: do not pass in the full DER-encoded OCSPResponse object obtained from the responder,
702
+
/// only the DER-encoded BasicOCSPResponse value contained in the response data.
690
703
/// </remarks>
691
704
/// <param name="secondDigest">the digest in the authenticatedAttributes</param>
692
705
/// <param name="sigtype">specifies the PKCS7 standard flavor to which created PKCS7SignedData object will adhere: either basic CMS or CAdES
693
706
/// </param>
694
707
/// <param name="tsaClient">TSAClient - null or an optional time stamp authority client</param>
695
-
/// <param name="ocsp">collection of DER-encoded OCSP responses for the certificate in the signature certificates chain, or null if OCSP revocation data is not to be added.
696
-
/// </param>
697
-
/// <param name="crlBytes">collection of DER-encoded CRL for certificates from the signature certificates chain, or null if CRL revocation data is not to be added.
698
-
/// </param>
708
+
/// <param name="ocsp">
709
+
/// collection of DER-encoded BasicOCSPResponses for the certificate in the signature certificates
710
+
/// chain, or null if OCSP revocation data is not to be added.
711
+
/// </param>
712
+
/// <param name="crlBytes">
713
+
/// collection of DER-encoded CRL for certificates from the signature certificates chain,
714
+
/// or null if CRL revocation data is not to be added.
/// <param name="ocsp">collection of DER-encoded OCSP responses for the certificate in the signature certificates chain, or null if OCSP revocation data is not to be added.
870
-
/// </param>
871
-
/// <param name="crlBytes">collection of DER-encoded CRL for certificates from the signature certificates chain, or null if CRL revocation data is not to be added.
872
-
/// </param>
873
-
/// <param name="sigtype">specifies the PKCS7 standard flavor to which created PKCS7SignedData object will adhere: either basic CMS or CAdES
874
-
/// </param>
890
+
/// <param name="ocsp">
891
+
/// collection of DER-encoded BasicOCSPResponses for the certificate in the signature certificates
892
+
/// chain, or null if OCSP revocation data is not to be added.
893
+
/// </param>
894
+
/// <param name="crlBytes">
895
+
/// collection of DER-encoded CRL for certificates from the signature certificates chain,
896
+
/// or null if CRL revocation data is not to be added.
897
+
/// </param>
898
+
/// <param name="sigtype">
899
+
/// specifies the PKCS7 standard flavor to which created PKCS7SignedData object will adhere:
900
+
/// either basic CMS or CAdES
901
+
/// </param>
875
902
/// <returns>the byte array representation of the authenticatedAttributes ready to be signed</returns>
/// <param name="sigtype">specifies the PKCS7 standard flavor to which created PKCS7SignedData object will adhere: either basic CMS or CAdES
911
-
/// </param>
912
-
/// <param name="ocsp">collection of DER-encoded OCSP responses for the certificate in the signature certificates chain, or null if OCSP revocation data is not to be added.
913
-
/// </param>
914
-
/// <param name="crlBytes">collection of DER-encoded CRL for certificates from the signature certificates chain, or null if CRL revocation data is not to be added.
915
-
/// </param>
941
+
/// <param name="sigtype">
942
+
/// specifies the PKCS7 standard flavor to which created PKCS7SignedData object will adhere:
943
+
/// either basic CMS or CAdES
944
+
/// </param>
945
+
/// <param name="ocsp">
946
+
/// collection of DER-encoded BasicOCSPResponses for the certificate in the signature certificates
947
+
/// chain, or null if OCSP revocation data is not to be added.
948
+
/// </param>
949
+
/// <param name="crlBytes">
950
+
/// collection of DER-encoded CRL for certificates from the signature certificates chain,
951
+
/// or null if CRL revocation data is not to be added.
952
+
/// </param>
916
953
/// <returns>the byte array representation of the authenticatedAttributes ready to be signed</returns>
0 commit comments