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
Copy file name to clipboardExpand all lines: sign/src/main/java/com/itextpdf/signatures/PdfPKCS7.java
+45-11Lines changed: 45 additions & 11 deletions
Original file line number
Diff line number
Diff line change
@@ -798,12 +798,20 @@ public byte[] getEncodedPKCS7(byte[] secondDigest) {
798
798
* in the signerInfo can also be set, and/or a time-stamp-authority client
799
799
* may be provided.
800
800
*
801
+
* <p>
802
+
* Note: do not pass in the full DER-encoded OCSPResponse object obtained from the responder,
803
+
* only the DER-encoded BasicOCSPResponse value contained in the response data.
804
+
*
801
805
* @param secondDigest the digest in the authenticatedAttributes
802
806
* @param tsaClient TSAClient - null or an optional time stamp authority client
803
-
* @param 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.
804
-
* @param crlBytes collection of DER-encoded CRL for certificates from the signature certificates chain, or null if CRL revocation data is not to be added.
805
-
* @param sigtype specifies the PKCS7 standard flavor to which created PKCS7SignedData object will adhere: either basic CMS or CAdES
807
+
* @param ocsp DER-encoded BasicOCSPResponse for the first certificate in the signature certificates chain,
808
+
* or null if OCSP revocation data is not to be added.
809
+
* @param crlBytes collection of DER-encoded CRL for certificates from the signature certificates chain,
810
+
* or null if CRL revocation data is not to be added.
811
+
* @param sigtype specifies the PKCS7 standard flavor to which created PKCS7SignedData object will adhere:
812
+
* either basic CMS or CAdES
806
813
* @return byte[] the bytes for the PKCS7SignedData object
* in the signerInfo can also be set, and/or a time-stamp-authority client
817
825
* may be provided.
818
826
*
827
+
* <p>
828
+
* Note: do not pass in the full DER-encoded OCSPResponse object obtained from the responder,
829
+
* only the DER-encoded BasicOCSPResponse value contained in the response data.
830
+
*
819
831
* @param secondDigest the digest in the authenticatedAttributes
820
832
* @param sigtype specifies the PKCS7 standard flavor to which created PKCS7SignedData object will adhere: either basic CMS or CAdES
821
833
* @param tsaClient TSAClient - null or an optional time stamp authority client
822
-
* @param 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.
823
-
* @param crlBytes collection of DER-encoded CRL for certificates from the signature certificates chain, or null if CRL revocation data is not to be added.
834
+
* @param ocsp collection of DER-encoded BasicOCSPResponses for the certificate in the signature certificates
835
+
* chain, or null if OCSP revocation data is not to be added.
836
+
* @param crlBytes collection of DER-encoded CRL for certificates from the signature certificates chain,
837
+
* or null if CRL revocation data is not to be added.
* @param 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.
1001
-
* @param crlBytes collection of DER-encoded CRL for certificates from the signature certificates chain, or null if CRL revocation data is not to be added.
1002
-
* @param sigtype specifies the PKCS7 standard flavor to which created PKCS7SignedData object will adhere: either basic CMS or CAdES
1021
+
* @param ocsp collection of DER-encoded BasicOCSPResponses for the certificate in the signature certificates
1022
+
* chain, or null if OCSP revocation data is not to be added.
1023
+
* @param crlBytes collection of DER-encoded CRL for certificates from the signature certificates chain,
1024
+
* or null if CRL revocation data is not to be added.
1025
+
* @param sigtype specifies the PKCS7 standard flavor to which created PKCS7SignedData object will adhere:
1026
+
* either basic CMS or CAdES
1003
1027
* @return the byte array representation of the authenticatedAttributes ready to be signed
* @deprecated This method overload is deprecated. Please use {@link #getAuthenticatedAttributeBytes(byte[], PdfSigner.CryptoStandard, Collection, Collection)}
1005
1030
*/
1006
1031
@Deprecated
@@ -1013,6 +1038,11 @@ public byte[] getAuthenticatedAttributeBytes(byte[] secondDigest, byte[] ocsp, C
1013
1038
* The document digest is generated and put inside the attribute. The signing is done over the DER encoded
1014
1039
* authenticatedAttributes. This method provides that encoding and the parameters must be
1015
1040
* exactly the same as in {@link #getEncodedPKCS7(byte[])}.
1041
+
*
1042
+
* <p>
1043
+
* Note: do not pass in the full DER-encoded OCSPResponse object obtained from the responder,
1044
+
* only the DER-encoded BasicOCSPResponse value contained in the response data.
1045
+
*
1016
1046
* <p>
1017
1047
* A simple example:
1018
1048
* <pre>
@@ -1032,10 +1062,14 @@ public byte[] getAuthenticatedAttributeBytes(byte[] secondDigest, byte[] ocsp, C
1032
1062
* </pre>
1033
1063
*
1034
1064
* @param secondDigest the content digest
1035
-
* @param sigtype specifies the PKCS7 standard flavor to which created PKCS7SignedData object will adhere: either basic CMS or CAdES
1036
-
* @param 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.
1037
-
* @param crlBytes collection of DER-encoded CRL for certificates from the signature certificates chain, or null if CRL revocation data is not to be added.
1065
+
* @param sigtype specifies the PKCS7 standard flavor to which created PKCS7SignedData object will adhere:
1066
+
* either basic CMS or CAdES
1067
+
* @param ocsp collection of DER-encoded BasicOCSPResponses for the certificate in the signature certificates
1068
+
* chain, or null if OCSP revocation data is not to be added.
1069
+
* @param crlBytes collection of DER-encoded CRL for certificates from the signature certificates chain,
1070
+
* or null if CRL revocation data is not to be added.
1038
1071
* @return the byte array representation of the authenticatedAttributes ready to be signed
0 commit comments