Skip to content

Commit e46013d

Browse files
committed
[RELEASE] iText 8.0.4
2 parents 2e932a8 + 6527bf8 commit e46013d

File tree

661 files changed

+32680
-2078
lines changed

Some content is hidden

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

661 files changed

+32680
-2078
lines changed

BUILDING.md

+27
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,33 @@ $ mvn clean install \
4242
> >(tee mvn.log) 2> >(tee mvn-error.log >&2)
4343
```
4444

45+
iText is backwards compatible in minor releases. To ensure that code changes conform to this requirement we use japicmp.
46+
Todo verify this execute following commands:
47+
48+
```bash
49+
$ mvn clean install
50+
$ mvn verify --activate-profiles qa \
51+
-Dcheckstyle.skip=true \
52+
-Ddependency-check.skip=true \
53+
-Dpmd.skip=true \
54+
-Dspotbugs.skip=true \
55+
-Dmaven.main.skip=true \
56+
-Dmaven.test.skip=true \
57+
-Djapicmp.breakBuildOnModifications=true \
58+
-Djapicmp.breakBuildOnBinaryIncompatibleModifications=true \
59+
-Djapicmp.breakBuildOnSourceIncompatibleModifications=true
60+
```
61+
62+
If you add new public methods or classes those should be documented.
63+
To verify this you can execute the following commands:
64+
65+
```bash
66+
$ mvn clean install
67+
$ mvn javadoc:javadoc | grep -E "(: warning:)|(: error:)"
68+
```
69+
70+
71+
4572
[1]: https://maven.apache.org/
4673

4774
[2]: https://www.ghostscript.com/

barcodes/pom.xml

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,18 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
33
<modelVersion>4.0.0</modelVersion>
4+
45
<parent>
56
<groupId>com.itextpdf</groupId>
67
<artifactId>root</artifactId>
7-
<version>8.0.3</version>
8+
<version>8.0.4</version>
89
</parent>
10+
911
<artifactId>barcodes</artifactId>
12+
1013
<name>iText - barcodes</name>
1114
<url>https://itextpdf.com/</url>
15+
1216
<dependencies>
1317
<dependency>
1418
<groupId>com.itextpdf</groupId>

bouncy-castle-adapter/pom.xml

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,23 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
33
<modelVersion>4.0.0</modelVersion>
4+
45
<parent>
56
<groupId>com.itextpdf</groupId>
67
<artifactId>root</artifactId>
7-
<version>8.0.3</version>
8+
<version>8.0.4</version>
89
</parent>
10+
911
<artifactId>bouncy-castle-adapter</artifactId>
12+
1013
<name>iText - Bouncy Castle Adapter</name>
1114
<url>https://itextpdf.com/</url>
1215

1316
<properties>
1417
<sonar.coverage.exclusions>**/*</sonar.coverage.exclusions>
1518
<sonar.cpd.exclusions>**/*</sonar.cpd.exclusions>
1619
</properties>
17-
20+
1821
<dependencies>
1922
<dependency>
2023
<groupId>org.bouncycastle</groupId>
@@ -32,6 +35,7 @@
3235
<version>${project.version}</version>
3336
</dependency>
3437
</dependencies>
38+
3539
<build>
3640
<plugins>
3741
<plugin>

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

+81
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,10 @@ This file is part of the iText (R) project.
8181
import com.itextpdf.bouncycastle.asn1.x509.ExtensionsBC;
8282
import com.itextpdf.bouncycastle.asn1.x509.GeneralNameBC;
8383
import com.itextpdf.bouncycastle.asn1.x509.GeneralNamesBC;
84+
import com.itextpdf.bouncycastle.asn1.x509.IssuingDistributionPointBC;
8485
import com.itextpdf.bouncycastle.asn1.x509.KeyPurposeIdBC;
8586
import com.itextpdf.bouncycastle.asn1.x509.KeyUsageBC;
87+
import com.itextpdf.bouncycastle.asn1.x509.ReasonFlagsBC;
8688
import com.itextpdf.bouncycastle.asn1.x509.SubjectPublicKeyInfoBC;
8789
import com.itextpdf.bouncycastle.asn1.x509.TBSCertificateBC;
8890
import com.itextpdf.bouncycastle.asn1.x509.TimeBC;
@@ -186,8 +188,10 @@ This file is part of the iText (R) project.
186188
import com.itextpdf.commons.bouncycastle.asn1.x509.IExtensions;
187189
import com.itextpdf.commons.bouncycastle.asn1.x509.IGeneralName;
188190
import com.itextpdf.commons.bouncycastle.asn1.x509.IGeneralNames;
191+
import com.itextpdf.commons.bouncycastle.asn1.x509.IIssuingDistributionPoint;
189192
import com.itextpdf.commons.bouncycastle.asn1.x509.IKeyPurposeId;
190193
import com.itextpdf.commons.bouncycastle.asn1.x509.IKeyUsage;
194+
import com.itextpdf.commons.bouncycastle.asn1.x509.IReasonFlags;
191195
import com.itextpdf.commons.bouncycastle.asn1.x509.ISubjectPublicKeyInfo;
192196
import com.itextpdf.commons.bouncycastle.asn1.x509.ITBSCertificate;
193197
import com.itextpdf.commons.bouncycastle.asn1.x509.ITime;
@@ -282,10 +286,14 @@ This file is part of the iText (R) project.
282286
import org.bouncycastle.asn1.x509.AlgorithmIdentifier;
283287
import org.bouncycastle.asn1.x509.BasicConstraints;
284288
import org.bouncycastle.asn1.x509.CRLDistPoint;
289+
import org.bouncycastle.asn1.x509.DistributionPointName;
285290
import org.bouncycastle.asn1.x509.Extension;
286291
import org.bouncycastle.asn1.x509.Extensions;
287292
import org.bouncycastle.asn1.x509.GeneralNames;
293+
import org.bouncycastle.asn1.x509.IssuingDistributionPoint;
294+
import org.bouncycastle.asn1.x509.KeyPurposeId;
288295
import org.bouncycastle.asn1.x509.KeyUsage;
296+
import org.bouncycastle.asn1.x509.ReasonFlags;
289297
import org.bouncycastle.asn1.x509.TBSCertificate;
290298
import org.bouncycastle.asn1.x509.Time;
291299
import org.bouncycastle.cert.jcajce.JcaCertStore;
@@ -1196,6 +1204,38 @@ public ICRLDistPoint createCRLDistPoint(Object object) {
11961204
((ASN1EncodableBC) object).getEncodable() : object));
11971205
}
11981206

1207+
/**
1208+
* {@inheritDoc}
1209+
*/
1210+
@Override
1211+
public IIssuingDistributionPoint createIssuingDistributionPoint(Object point) {
1212+
return new IssuingDistributionPointBC(IssuingDistributionPoint.getInstance(point instanceof ASN1EncodableBC ?
1213+
((ASN1EncodableBC) point).getEncodable() : point));
1214+
}
1215+
1216+
/**
1217+
* {@inheritDoc}
1218+
*/
1219+
@Override
1220+
public IIssuingDistributionPoint createIssuingDistributionPoint(IDistributionPointName distributionPoint,
1221+
boolean onlyContainsUserCerts,
1222+
boolean onlyContainsCACerts,
1223+
IReasonFlags onlySomeReasons, boolean indirectCRL,
1224+
boolean onlyContainsAttributeCerts) {
1225+
return new IssuingDistributionPointBC(new IssuingDistributionPoint(distributionPoint == null ? null :
1226+
((DistributionPointNameBC) distributionPoint).getDistributionPointName(), onlyContainsUserCerts,
1227+
onlyContainsCACerts, onlySomeReasons == null ? null :
1228+
((ReasonFlagsBC) onlySomeReasons).getReasonFlags(), indirectCRL, onlyContainsAttributeCerts));
1229+
}
1230+
1231+
/**
1232+
* {@inheritDoc}
1233+
*/
1234+
@Override
1235+
public IReasonFlags createReasonFlags(int reasons) {
1236+
return new ReasonFlagsBC(new ReasonFlags(reasons));
1237+
}
1238+
11991239
/**
12001240
* {@inheritDoc}
12011241
*/
@@ -1204,6 +1244,14 @@ public IDistributionPointName createDistributionPointName() {
12041244
return DistributionPointNameBC.getInstance();
12051245
}
12061246

1247+
/**
1248+
* {@inheritDoc}
1249+
*/
1250+
@Override
1251+
public IDistributionPointName createDistributionPointName(IGeneralNames generalNames) {
1252+
return new DistributionPointNameBC(new DistributionPointName(((GeneralNamesBC)generalNames).getGeneralNames()));
1253+
}
1254+
12071255
/**
12081256
* {@inheritDoc}
12091257
*/
@@ -1558,6 +1606,14 @@ public IBasicConstraints createBasicConstraints(boolean b) {
15581606
return new BasicConstraintsBC(new BasicConstraints(b));
15591607
}
15601608

1609+
/**
1610+
* {@inheritDoc}
1611+
*/
1612+
@Override
1613+
public IBasicConstraints createBasicConstraints(int pathLength) {
1614+
return new BasicConstraintsBC(new BasicConstraints(pathLength));
1615+
}
1616+
15611617
/**
15621618
* {@inheritDoc}
15631619
*/
@@ -1582,6 +1638,15 @@ public IKeyPurposeId createKeyPurposeId() {
15821638
return KeyPurposeIdBC.getInstance();
15831639
}
15841640

1641+
/**
1642+
* {@inheritDoc}
1643+
*/
1644+
@Override
1645+
public IKeyPurposeId createKeyPurposeId(IASN1ObjectIdentifier objectIdentifier) {
1646+
return new KeyPurposeIdBC(KeyPurposeId.getInstance(
1647+
((ASN1ObjectIdentifierBC) objectIdentifier).getASN1ObjectIdentifier()));
1648+
}
1649+
15851650
/**
15861651
* {@inheritDoc}
15871652
*/
@@ -1590,6 +1655,14 @@ public IExtendedKeyUsage createExtendedKeyUsage(IKeyPurposeId purposeId) {
15901655
return new ExtendedKeyUsageBC(purposeId);
15911656
}
15921657

1658+
/**
1659+
* {@inheritDoc}
1660+
*/
1661+
@Override
1662+
public IExtendedKeyUsage createExtendedKeyUsage(IKeyPurposeId[] purposeIds) {
1663+
return new ExtendedKeyUsageBC(purposeIds);
1664+
}
1665+
15931666
/**
15941667
* {@inheritDoc}
15951668
*/
@@ -1697,6 +1770,14 @@ public ITime createTime(Date date) {
16971770
return new TimeBC(new Time(date));
16981771
}
16991772

1773+
/**
1774+
* {@inheritDoc}
1775+
*/
1776+
@Override
1777+
public ITime createEndDate(X509Certificate certificate) {
1778+
return createTime(certificate.getNotAfter());
1779+
}
1780+
17001781
/**
17011782
* {@inheritDoc}
17021783
*/

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

+8
Original file line numberDiff line numberDiff line change
@@ -55,4 +55,12 @@ public ASN1BitString getASN1BitString() {
5555
public String getString() {
5656
return getASN1BitString().getString();
5757
}
58+
59+
/**
60+
* {@inheritDoc}
61+
*/
62+
@Override
63+
public int intValue() {
64+
return getASN1BitString().intValue();
65+
}
5866
}

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

+9
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ public class CRLReasonBC extends ASN1EncodableBC implements ICRLReason {
3434
private static final CRLReasonBC INSTANCE = new CRLReasonBC(null);
3535

3636
private static final int KEY_COMPROMISE = CRLReason.keyCompromise;
37+
private static final int REMOVE_FROM_CRL = CRLReason.removeFromCRL;
3738

3839
/**
3940
* Creates new wrapper instance for {@link CRLReason}.
@@ -69,4 +70,12 @@ public CRLReason getCRLReason() {
6970
public int getKeyCompromise() {
7071
return KEY_COMPROMISE;
7172
}
73+
74+
/**
75+
* {@inheritDoc}
76+
*/
77+
@Override
78+
public int getRemoveFromCRL() {
79+
return REMOVE_FROM_CRL;
80+
}
7281
}

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

+18
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ This file is part of the iText (R) project.
2626
import com.itextpdf.commons.bouncycastle.asn1.x509.IDistributionPoint;
2727
import com.itextpdf.commons.bouncycastle.asn1.x509.IDistributionPointName;
2828

29+
import com.itextpdf.commons.bouncycastle.asn1.x509.IGeneralNames;
30+
import com.itextpdf.commons.bouncycastle.asn1.x509.IReasonFlags;
2931
import org.bouncycastle.asn1.x509.DistributionPoint;
3032

3133
/**
@@ -57,4 +59,20 @@ public DistributionPoint getPoint() {
5759
public IDistributionPointName getDistributionPoint() {
5860
return new DistributionPointNameBC(getPoint().getDistributionPoint());
5961
}
62+
63+
/**
64+
* {@inheritDoc}
65+
*/
66+
@Override
67+
public IGeneralNames getCRLIssuer() {
68+
return new GeneralNamesBC(getPoint().getCRLIssuer());
69+
}
70+
71+
/**
72+
* {@inheritDoc}
73+
*/
74+
@Override
75+
public IReasonFlags getReasons() {
76+
return new ReasonFlagsBC(getPoint().getReasons());
77+
}
6078
}

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

+18
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ This file is part of the iText (R) project.
2727
import com.itextpdf.commons.bouncycastle.asn1.x509.IKeyPurposeId;
2828

2929
import org.bouncycastle.asn1.x509.ExtendedKeyUsage;
30+
import org.bouncycastle.asn1.x509.KeyPurposeId;
3031

3132
/**
3233
* Wrapper class for {@link ExtendedKeyUsage}.
@@ -50,6 +51,15 @@ public ExtendedKeyUsageBC(IKeyPurposeId purposeId) {
5051
super(new ExtendedKeyUsage(((KeyPurposeIdBC) purposeId).getKeyPurposeId()));
5152
}
5253

54+
/**
55+
* Creates new wrapper instance for {@link ExtendedKeyUsage}.
56+
*
57+
* @param purposeIds KeyPurposeId wrappers array
58+
*/
59+
public ExtendedKeyUsageBC(IKeyPurposeId[] purposeIds) {
60+
super(new ExtendedKeyUsage(unwrapPurposeIds(purposeIds)));
61+
}
62+
5363
/**
5464
* Gets actual org.bouncycastle object being wrapped.
5565
*
@@ -58,4 +68,12 @@ public ExtendedKeyUsageBC(IKeyPurposeId purposeId) {
5868
public ExtendedKeyUsage getExtendedKeyUsage() {
5969
return (ExtendedKeyUsage) getEncodable();
6070
}
71+
72+
private static KeyPurposeId[] unwrapPurposeIds(IKeyPurposeId[] purposeIds) {
73+
KeyPurposeId[] purposeIdsUnwrapped = new KeyPurposeId[purposeIds.length];
74+
for (int i = 0; i < purposeIds.length; ++i) {
75+
purposeIdsUnwrapped[i] = ((KeyPurposeIdBC) purposeIds[i]).getKeyPurposeId();
76+
}
77+
return purposeIdsUnwrapped;
78+
}
6179
}

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

+13-2
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,12 @@ This file is part of the iText (R) project.
3535
public class ExtensionBC extends ASN1EncodableBC implements IExtension {
3636
private static final ExtensionBC INSTANCE = new ExtensionBC(null);
3737

38-
private static final ASN1ObjectIdentifierBC C_RL_DISTRIBUTION_POINTS =
38+
private static final ASN1ObjectIdentifierBC CRL_DISTRIBUTION_POINTS =
3939
new ASN1ObjectIdentifierBC(Extension.cRLDistributionPoints);
4040

41+
private static final ASN1ObjectIdentifierBC ISSUING_DISTRIBUTION_POINT =
42+
new ASN1ObjectIdentifierBC(Extension.issuingDistributionPoint);
43+
4144
private static final ASN1ObjectIdentifierBC AUTHORITY_INFO_ACCESS =
4245
new ASN1ObjectIdentifierBC(Extension.authorityInfoAccess);
4346

@@ -88,7 +91,15 @@ public Extension getExtension() {
8891
*/
8992
@Override
9093
public IASN1ObjectIdentifier getCRlDistributionPoints() {
91-
return C_RL_DISTRIBUTION_POINTS;
94+
return CRL_DISTRIBUTION_POINTS;
95+
}
96+
97+
/**
98+
* {@inheritDoc}
99+
*/
100+
@Override
101+
public IASN1ObjectIdentifier getIssuingDistributionPoint() {
102+
return ISSUING_DISTRIBUTION_POINT;
92103
}
93104

94105
/**

0 commit comments

Comments
 (0)