Skip to content

Commit 2fb084d

Browse files
committed
[RELEASE] iText 8.0.1
2 parents 4e9491a + 8c8119b commit 2fb084d

File tree

918 files changed

+14529
-38868
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

918 files changed

+14529
-38868
lines changed

Vagrantfile

-28
This file was deleted.

barcodes/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<parent>
55
<groupId>com.itextpdf</groupId>
66
<artifactId>root</artifactId>
7-
<version>8.0.0</version>
7+
<version>8.0.1</version>
88
</parent>
99
<artifactId>barcodes</artifactId>
1010
<name>iText - barcodes</name>

bouncy-castle-adapter/pom.xml

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<parent>
55
<groupId>com.itextpdf</groupId>
66
<artifactId>root</artifactId>
7-
<version>8.0.0</version>
7+
<version>8.0.1</version>
88
</parent>
99
<artifactId>bouncy-castle-adapter</artifactId>
1010
<name>iText - Bouncy Castle Adapter</name>
@@ -18,12 +18,12 @@
1818
<dependencies>
1919
<dependency>
2020
<groupId>org.bouncycastle</groupId>
21-
<artifactId>bcpkix-jdk15on</artifactId>
21+
<artifactId>bcpkix-jdk18on</artifactId>
2222
<version>${bouncycastle.version}</version>
2323
</dependency>
2424
<dependency>
2525
<groupId>org.bouncycastle</groupId>
26-
<artifactId>bcprov-jdk15on</artifactId>
26+
<artifactId>bcprov-jdk18on</artifactId>
2727
<version>${bouncycastle.version}</version>
2828
</dependency>
2929
<dependency>

bouncy-castle-adapter/src/main/java/com/itextpdf/bouncycastle/BouncyCastleFactory.java

+35-1
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ This file is part of the iText (R) project.
110110
import com.itextpdf.bouncycastle.cms.CMSExceptionBC;
111111
import com.itextpdf.bouncycastle.cms.jcajce.JcaSignerInfoGeneratorBuilderBC;
112112
import com.itextpdf.bouncycastle.cms.jcajce.JcaSimpleSignerInfoVerifierBuilderBC;
113+
import com.itextpdf.bouncycastle.cms.jcajce.JceKeyAgreeEnvelopedRecipientBC;
113114
import com.itextpdf.bouncycastle.cms.jcajce.JceKeyTransEnvelopedRecipientBC;
114115
import com.itextpdf.bouncycastle.openssl.PEMParserBC;
115116
import com.itextpdf.bouncycastle.openssl.jcajce.JcaPEMKeyConverterBC;
@@ -214,6 +215,7 @@ This file is part of the iText (R) project.
214215
import com.itextpdf.commons.bouncycastle.cms.ISignerInfoGenerator;
215216
import com.itextpdf.commons.bouncycastle.cms.jcajce.IJcaSignerInfoGeneratorBuilder;
216217
import com.itextpdf.commons.bouncycastle.cms.jcajce.IJcaSimpleSignerInfoVerifierBuilder;
218+
import com.itextpdf.commons.bouncycastle.cms.jcajce.IJceKeyAgreeEnvelopedRecipient;
217219
import com.itextpdf.commons.bouncycastle.cms.jcajce.IJceKeyTransEnvelopedRecipient;
218220
import com.itextpdf.commons.bouncycastle.openssl.IPEMParser;
219221
import com.itextpdf.commons.bouncycastle.openssl.jcajce.IJcaPEMKeyConverter;
@@ -301,11 +303,14 @@ This file is part of the iText (R) project.
301303
import org.bouncycastle.cms.CMSSignedData;
302304
import org.bouncycastle.cms.CMSTypedData;
303305
import org.bouncycastle.cms.jcajce.JcaSimpleSignerInfoVerifierBuilder;
306+
import org.bouncycastle.cms.jcajce.JceKeyAgreeEnvelopedRecipient;
304307
import org.bouncycastle.cms.jcajce.JceKeyTransEnvelopedRecipient;
305308
import org.bouncycastle.jce.provider.BouncyCastleProvider;
306309
import org.bouncycastle.openssl.PEMParser;
307310
import org.bouncycastle.openssl.jcajce.JcaPEMKeyConverter;
308311
import org.bouncycastle.openssl.jcajce.JceOpenSSLPKCS8DecryptorProviderBuilder;
312+
import org.bouncycastle.operator.DefaultAlgorithmNameFinder;
313+
import org.bouncycastle.operator.DefaultSignatureAlgorithmIdentifierFinder;
309314
import org.bouncycastle.operator.jcajce.JcaContentSignerBuilder;
310315
import org.bouncycastle.operator.jcajce.JcaContentVerifierProviderBuilder;
311316
import org.bouncycastle.operator.jcajce.JcaDigestCalculatorProviderBuilder;
@@ -332,6 +337,27 @@ public BouncyCastleFactory() {
332337
// Empty constructor.
333338
}
334339

340+
/**
341+
* {@inheritDoc}
342+
*/
343+
@Override
344+
public String getAlgorithmOid(String name) {
345+
try {
346+
AlgorithmIdentifier algorithmIdentifier = new DefaultSignatureAlgorithmIdentifierFinder().find(name);
347+
return algorithmIdentifier.getAlgorithm().getId();
348+
} catch (IllegalArgumentException ignored) {
349+
return null;
350+
}
351+
}
352+
353+
/**
354+
* {@inheritDoc}
355+
*/
356+
@Override
357+
public String getAlgorithmName(String oid) {
358+
return new DefaultAlgorithmNameFinder().getAlgorithmName(new ASN1ObjectIdentifier(oid));
359+
}
360+
335361
/**
336362
* {@inheritDoc}
337363
*/
@@ -844,6 +870,14 @@ public IJceKeyTransEnvelopedRecipient createJceKeyTransEnvelopedRecipient(Privat
844870
return new JceKeyTransEnvelopedRecipientBC(new JceKeyTransEnvelopedRecipient(privateKey));
845871
}
846872

873+
/**
874+
* {@inheritDoc}
875+
*/
876+
@Override
877+
public IJceKeyAgreeEnvelopedRecipient createJceKeyAgreeEnvelopedRecipient(PrivateKey privateKey) {
878+
return new JceKeyAgreeEnvelopedRecipientBC(new JceKeyAgreeEnvelopedRecipient(privateKey));
879+
}
880+
847881
/**
848882
* {@inheritDoc}
849883
*/
@@ -1104,7 +1138,7 @@ public IRevokedStatus createRevokedStatus(Date date, int i) {
11041138
@Override
11051139
public IDERIA5String createDERIA5String(IASN1TaggedObject taggedObject, boolean b) {
11061140
return new DERIA5StringBC(
1107-
DERIA5String.getInstance(((ASN1TaggedObjectBC) taggedObject).getASN1TaggedObject(), b));
1141+
(DERIA5String)DERIA5String.getInstance(((ASN1TaggedObjectBC) taggedObject).getASN1TaggedObject(), b));
11081142
}
11091143

11101144
/**

bouncy-castle-adapter/src/main/java/com/itextpdf/bouncycastle/asn1/ASN1TaggedObjectBC.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public ASN1TaggedObject getASN1TaggedObject() {
5454
*/
5555
@Override
5656
public IASN1Primitive getObject() {
57-
return new ASN1PrimitiveBC(getASN1TaggedObject().getObject());
57+
return new ASN1PrimitiveBC(getASN1TaggedObject().getBaseObject().toASN1Primitive());
5858
}
5959

6060
/**
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
/*
2+
This file is part of the iText (R) project.
3+
Copyright (c) 1998-2023 Apryse Group NV
4+
Authors: Apryse Software.
5+
6+
This program is offered under a commercial and under the AGPL license.
7+
For commercial licensing, contact us at https://itextpdf.com/sales. For AGPL licensing, see below.
8+
9+
AGPL licensing:
10+
This program is free software: you can redistribute it and/or modify
11+
it under the terms of the GNU Affero General Public License as published by
12+
the Free Software Foundation, either version 3 of the License, or
13+
(at your option) any later version.
14+
15+
This program is distributed in the hope that it will be useful,
16+
but WITHOUT ANY WARRANTY; without even the implied warranty of
17+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18+
GNU Affero General Public License for more details.
19+
20+
You should have received a copy of the GNU Affero General Public License
21+
along with this program. If not, see <https://www.gnu.org/licenses/>.
22+
*/
23+
package com.itextpdf.bouncycastle.cms.jcajce;
24+
25+
import com.itextpdf.bouncycastle.cms.RecipientBC;
26+
import com.itextpdf.commons.bouncycastle.cms.jcajce.IJceKeyAgreeEnvelopedRecipient;
27+
28+
import org.bouncycastle.cms.jcajce.JceKeyAgreeEnvelopedRecipient;
29+
30+
/**
31+
* Wrapper class for {@link JceKeyAgreeEnvelopedRecipient}.
32+
*/
33+
public class JceKeyAgreeEnvelopedRecipientBC extends RecipientBC implements IJceKeyAgreeEnvelopedRecipient {
34+
/**
35+
* Creates new wrapper instance for {@link JceKeyAgreeEnvelopedRecipient}.
36+
*
37+
* @param jceKeyAgreeEnvelopedRecipient {@link JceKeyAgreeEnvelopedRecipient} to be wrapped
38+
*/
39+
public JceKeyAgreeEnvelopedRecipientBC(JceKeyAgreeEnvelopedRecipient jceKeyAgreeEnvelopedRecipient) {
40+
super(jceKeyAgreeEnvelopedRecipient);
41+
}
42+
43+
/**
44+
* Gets actual org.bouncycastle object being wrapped.
45+
*
46+
* @return wrapped {@link JceKeyAgreeEnvelopedRecipient}.
47+
*/
48+
public JceKeyAgreeEnvelopedRecipient getJceKeyAgreeEnvelopedRecipient() {
49+
return (JceKeyAgreeEnvelopedRecipient) getRecipient();
50+
}
51+
52+
/**
53+
* {@inheritDoc}
54+
*/
55+
@Override
56+
public IJceKeyAgreeEnvelopedRecipient setProvider(String provider) {
57+
getJceKeyAgreeEnvelopedRecipient().setProvider(provider);
58+
return this;
59+
}
60+
}

bouncy-castle-connector/pom.xml

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<parent>
55
<groupId>com.itextpdf</groupId>
66
<artifactId>root</artifactId>
7-
<version>8.0.0</version>
7+
<version>8.0.1</version>
88
</parent>
99
<artifactId>bouncy-castle-connector</artifactId>
1010
<name>iText - Bouncy Castle Connector</name>
@@ -24,11 +24,11 @@
2424
<exclusions>
2525
<exclusion>
2626
<groupId>org.bouncycastle</groupId>
27-
<artifactId>bcpkix-jdk15on</artifactId>
27+
<artifactId>bcpkix-jdk18on</artifactId>
2828
</exclusion>
2929
<exclusion>
3030
<groupId>org.bouncycastle</groupId>
31-
<artifactId>bcprov-jdk15on</artifactId>
31+
<artifactId>bcprov-jdk18on</artifactId>
3232
</exclusion>
3333
</exclusions>
3434
</dependency>

bouncy-castle-connector/src/main/java/com/itextpdf/bouncycastleconnector/BouncyCastleDefaultFactory.java

+16
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ This file is part of the iText (R) project.
113113
import com.itextpdf.commons.bouncycastle.cms.ISignerInfoGenerator;
114114
import com.itextpdf.commons.bouncycastle.cms.jcajce.IJcaSignerInfoGeneratorBuilder;
115115
import com.itextpdf.commons.bouncycastle.cms.jcajce.IJcaSimpleSignerInfoVerifierBuilder;
116+
import com.itextpdf.commons.bouncycastle.cms.jcajce.IJceKeyAgreeEnvelopedRecipient;
116117
import com.itextpdf.commons.bouncycastle.cms.jcajce.IJceKeyTransEnvelopedRecipient;
117118
import com.itextpdf.commons.bouncycastle.openssl.IPEMParser;
118119
import com.itextpdf.commons.bouncycastle.openssl.jcajce.IJcaPEMKeyConverter;
@@ -152,6 +153,16 @@ class BouncyCastleDefaultFactory implements IBouncyCastleFactory {
152153
BouncyCastleDefaultFactory() {
153154
// Empty constructor
154155
}
156+
157+
@Override
158+
public String getAlgorithmOid(String name) {
159+
throw new UnsupportedOperationException(BouncyCastleLogMessageConstant.BOUNCY_CASTLE_DEPENDENCY_MUST_PRESENT);
160+
}
161+
162+
@Override
163+
public String getAlgorithmName(String oid) {
164+
throw new UnsupportedOperationException(BouncyCastleLogMessageConstant.BOUNCY_CASTLE_DEPENDENCY_MUST_PRESENT);
165+
}
155166

156167
@Override
157168
public IASN1ObjectIdentifier createASN1ObjectIdentifier(IASN1Encodable encodable) {
@@ -428,6 +439,11 @@ public String getProviderName() {
428439
public IJceKeyTransEnvelopedRecipient createJceKeyTransEnvelopedRecipient(PrivateKey privateKey) {
429440
throw new UnsupportedOperationException(BouncyCastleLogMessageConstant.BOUNCY_CASTLE_DEPENDENCY_MUST_PRESENT);
430441
}
442+
443+
@Override
444+
public IJceKeyAgreeEnvelopedRecipient createJceKeyAgreeEnvelopedRecipient(PrivateKey privateKey) {
445+
throw new UnsupportedOperationException(BouncyCastleLogMessageConstant.BOUNCY_CASTLE_DEPENDENCY_MUST_PRESENT);
446+
}
431447

432448
@Override
433449
public IJcaContentVerifierProviderBuilder createJcaContentVerifierProviderBuilder() {

bouncy-castle-connector/src/main/java/com/itextpdf/bouncycastleconnector/logs/BouncyCastleLogMessageConstant.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,6 @@ private BouncyCastleLogMessageConstant() {
3232
}
3333

3434
public static final String BOUNCY_CASTLE_DEPENDENCY_MUST_PRESENT =
35-
"Either com.itextpdf:bouncy-castle-adapter or com.itextpdf:bouncy-castle-fips-adapter dependency must be added in order to use BouncyCastleFactoryCreator";
35+
"Either com.itextpdf:bouncy-castle-adapter or com.itextpdf:bouncy-castle-fips-adapter " // Android-Conversion-Replace "com.itextpdf.android:bouncy-castle-adapter-android "
36+
+ "dependency must be added in order to use BouncyCastleFactoryCreator";
3637
}

bouncy-castle-fips-adapter/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<parent>
55
<groupId>com.itextpdf</groupId>
66
<artifactId>root</artifactId>
7-
<version>8.0.0</version>
7+
<version>8.0.1</version>
88
</parent>
99
<artifactId>bouncy-castle-fips-adapter</artifactId>
1010
<name>iText - Bouncy Castle FIPS Adapter</name>

bouncy-castle-fips-adapter/src/main/java/com/itextpdf/bouncycastlefips/BouncyCastleFipsFactory.java

+30
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ This file is part of the iText (R) project.
110110
import com.itextpdf.bouncycastlefips.cms.CMSExceptionBCFips;
111111
import com.itextpdf.bouncycastlefips.cms.jcajce.JcaSignerInfoGeneratorBuilderBCFips;
112112
import com.itextpdf.bouncycastlefips.cms.jcajce.JcaSimpleSignerInfoVerifierBuilderBCFips;
113+
import com.itextpdf.bouncycastlefips.cms.jcajce.JceKeyAgreeEnvelopedRecipientBCFips;
113114
import com.itextpdf.bouncycastlefips.cms.jcajce.JceKeyTransEnvelopedRecipientBCFips;
114115
import com.itextpdf.bouncycastlefips.openssl.PEMParserBCFips;
115116
import com.itextpdf.bouncycastlefips.openssl.jcajce.JcaPEMKeyConverterBCFips;
@@ -214,6 +215,7 @@ This file is part of the iText (R) project.
214215
import com.itextpdf.commons.bouncycastle.cms.ISignerInfoGenerator;
215216
import com.itextpdf.commons.bouncycastle.cms.jcajce.IJcaSignerInfoGeneratorBuilder;
216217
import com.itextpdf.commons.bouncycastle.cms.jcajce.IJcaSimpleSignerInfoVerifierBuilder;
218+
import com.itextpdf.commons.bouncycastle.cms.jcajce.IJceKeyAgreeEnvelopedRecipient;
217219
import com.itextpdf.commons.bouncycastle.cms.jcajce.IJceKeyTransEnvelopedRecipient;
218220
import com.itextpdf.commons.bouncycastle.openssl.IPEMParser;
219221
import com.itextpdf.commons.bouncycastle.openssl.jcajce.IJcaPEMKeyConverter;
@@ -304,12 +306,15 @@ This file is part of the iText (R) project.
304306
import org.bouncycastle.cms.CMSSignedData;
305307
import org.bouncycastle.cms.CMSTypedData;
306308
import org.bouncycastle.cms.jcajce.JcaSimpleSignerInfoVerifierBuilder;
309+
import org.bouncycastle.cms.jcajce.JceKeyAgreeEnvelopedRecipient;
307310
import org.bouncycastle.cms.jcajce.JceKeyTransEnvelopedRecipient;
308311
import org.bouncycastle.crypto.CryptoServicesRegistrar;
309312
import org.bouncycastle.jcajce.provider.BouncyCastleFipsProvider;
310313
import org.bouncycastle.openssl.PEMParser;
311314
import org.bouncycastle.openssl.jcajce.JcaPEMKeyConverter;
312315
import org.bouncycastle.openssl.jcajce.JceOpenSSLPKCS8DecryptorProviderBuilder;
316+
import org.bouncycastle.operator.DefaultAlgorithmNameFinder;
317+
import org.bouncycastle.operator.DefaultSignatureAlgorithmIdentifierFinder;
313318
import org.bouncycastle.operator.jcajce.JcaContentSignerBuilder;
314319
import org.bouncycastle.operator.jcajce.JcaContentVerifierProviderBuilder;
315320
import org.bouncycastle.operator.jcajce.JcaDigestCalculatorProviderBuilder;
@@ -336,6 +341,23 @@ public BouncyCastleFipsFactory() {
336341
// Empty constructor.
337342
}
338343

344+
/**
345+
* {@inheritDoc}
346+
*/
347+
@Override
348+
public String getAlgorithmOid(String name) {
349+
AlgorithmIdentifier algorithmIdentifier = new DefaultSignatureAlgorithmIdentifierFinder().find(name);
350+
return algorithmIdentifier.getAlgorithm().getId();
351+
}
352+
353+
/**
354+
* {@inheritDoc}
355+
*/
356+
@Override
357+
public String getAlgorithmName(String oid) {
358+
return new DefaultAlgorithmNameFinder().getAlgorithmName(new ASN1ObjectIdentifier(oid));
359+
}
360+
339361
/**
340362
* {@inheritDoc}
341363
*/
@@ -856,6 +878,14 @@ public IJceKeyTransEnvelopedRecipient createJceKeyTransEnvelopedRecipient(Privat
856878
return new JceKeyTransEnvelopedRecipientBCFips(new JceKeyTransEnvelopedRecipient(privateKey));
857879
}
858880

881+
/**
882+
* {@inheritDoc}
883+
*/
884+
@Override
885+
public IJceKeyAgreeEnvelopedRecipient createJceKeyAgreeEnvelopedRecipient(PrivateKey privateKey) {
886+
return new JceKeyAgreeEnvelopedRecipientBCFips(new JceKeyAgreeEnvelopedRecipient(privateKey));
887+
}
888+
859889
/**
860890
* {@inheritDoc}
861891
*/

0 commit comments

Comments
 (0)