Skip to content

Commit

Permalink
[RELEASE] iText 8.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
iText-CI committed Jul 20, 2023
2 parents 4e9491a + 8c8119b commit 2fb084d
Show file tree
Hide file tree
Showing 918 changed files with 14,529 additions and 38,868 deletions.
28 changes: 0 additions & 28 deletions Vagrantfile

This file was deleted.

2 changes: 1 addition & 1 deletion barcodes/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>com.itextpdf</groupId>
<artifactId>root</artifactId>
<version>8.0.0</version>
<version>8.0.1</version>
</parent>
<artifactId>barcodes</artifactId>
<name>iText - barcodes</name>
Expand Down
6 changes: 3 additions & 3 deletions bouncy-castle-adapter/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>com.itextpdf</groupId>
<artifactId>root</artifactId>
<version>8.0.0</version>
<version>8.0.1</version>
</parent>
<artifactId>bouncy-castle-adapter</artifactId>
<name>iText - Bouncy Castle Adapter</name>
Expand All @@ -18,12 +18,12 @@
<dependencies>
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcpkix-jdk15on</artifactId>
<artifactId>bcpkix-jdk18on</artifactId>
<version>${bouncycastle.version}</version>
</dependency>
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcprov-jdk15on</artifactId>
<artifactId>bcprov-jdk18on</artifactId>
<version>${bouncycastle.version}</version>
</dependency>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ This file is part of the iText (R) project.
import com.itextpdf.bouncycastle.cms.CMSExceptionBC;
import com.itextpdf.bouncycastle.cms.jcajce.JcaSignerInfoGeneratorBuilderBC;
import com.itextpdf.bouncycastle.cms.jcajce.JcaSimpleSignerInfoVerifierBuilderBC;
import com.itextpdf.bouncycastle.cms.jcajce.JceKeyAgreeEnvelopedRecipientBC;
import com.itextpdf.bouncycastle.cms.jcajce.JceKeyTransEnvelopedRecipientBC;
import com.itextpdf.bouncycastle.openssl.PEMParserBC;
import com.itextpdf.bouncycastle.openssl.jcajce.JcaPEMKeyConverterBC;
Expand Down Expand Up @@ -214,6 +215,7 @@ This file is part of the iText (R) project.
import com.itextpdf.commons.bouncycastle.cms.ISignerInfoGenerator;
import com.itextpdf.commons.bouncycastle.cms.jcajce.IJcaSignerInfoGeneratorBuilder;
import com.itextpdf.commons.bouncycastle.cms.jcajce.IJcaSimpleSignerInfoVerifierBuilder;
import com.itextpdf.commons.bouncycastle.cms.jcajce.IJceKeyAgreeEnvelopedRecipient;
import com.itextpdf.commons.bouncycastle.cms.jcajce.IJceKeyTransEnvelopedRecipient;
import com.itextpdf.commons.bouncycastle.openssl.IPEMParser;
import com.itextpdf.commons.bouncycastle.openssl.jcajce.IJcaPEMKeyConverter;
Expand Down Expand Up @@ -301,11 +303,14 @@ This file is part of the iText (R) project.
import org.bouncycastle.cms.CMSSignedData;
import org.bouncycastle.cms.CMSTypedData;
import org.bouncycastle.cms.jcajce.JcaSimpleSignerInfoVerifierBuilder;
import org.bouncycastle.cms.jcajce.JceKeyAgreeEnvelopedRecipient;
import org.bouncycastle.cms.jcajce.JceKeyTransEnvelopedRecipient;
import org.bouncycastle.jce.provider.BouncyCastleProvider;
import org.bouncycastle.openssl.PEMParser;
import org.bouncycastle.openssl.jcajce.JcaPEMKeyConverter;
import org.bouncycastle.openssl.jcajce.JceOpenSSLPKCS8DecryptorProviderBuilder;
import org.bouncycastle.operator.DefaultAlgorithmNameFinder;
import org.bouncycastle.operator.DefaultSignatureAlgorithmIdentifierFinder;
import org.bouncycastle.operator.jcajce.JcaContentSignerBuilder;
import org.bouncycastle.operator.jcajce.JcaContentVerifierProviderBuilder;
import org.bouncycastle.operator.jcajce.JcaDigestCalculatorProviderBuilder;
Expand All @@ -332,6 +337,27 @@ public BouncyCastleFactory() {
// Empty constructor.
}

/**
* {@inheritDoc}
*/
@Override
public String getAlgorithmOid(String name) {
try {
AlgorithmIdentifier algorithmIdentifier = new DefaultSignatureAlgorithmIdentifierFinder().find(name);
return algorithmIdentifier.getAlgorithm().getId();
} catch (IllegalArgumentException ignored) {
return null;
}
}

/**
* {@inheritDoc}
*/
@Override
public String getAlgorithmName(String oid) {
return new DefaultAlgorithmNameFinder().getAlgorithmName(new ASN1ObjectIdentifier(oid));
}

/**
* {@inheritDoc}
*/
Expand Down Expand Up @@ -844,6 +870,14 @@ public IJceKeyTransEnvelopedRecipient createJceKeyTransEnvelopedRecipient(Privat
return new JceKeyTransEnvelopedRecipientBC(new JceKeyTransEnvelopedRecipient(privateKey));
}

/**
* {@inheritDoc}
*/
@Override
public IJceKeyAgreeEnvelopedRecipient createJceKeyAgreeEnvelopedRecipient(PrivateKey privateKey) {
return new JceKeyAgreeEnvelopedRecipientBC(new JceKeyAgreeEnvelopedRecipient(privateKey));
}

/**
* {@inheritDoc}
*/
Expand Down Expand Up @@ -1104,7 +1138,7 @@ public IRevokedStatus createRevokedStatus(Date date, int i) {
@Override
public IDERIA5String createDERIA5String(IASN1TaggedObject taggedObject, boolean b) {
return new DERIA5StringBC(
DERIA5String.getInstance(((ASN1TaggedObjectBC) taggedObject).getASN1TaggedObject(), b));
(DERIA5String)DERIA5String.getInstance(((ASN1TaggedObjectBC) taggedObject).getASN1TaggedObject(), b));
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public ASN1TaggedObject getASN1TaggedObject() {
*/
@Override
public IASN1Primitive getObject() {
return new ASN1PrimitiveBC(getASN1TaggedObject().getObject());
return new ASN1PrimitiveBC(getASN1TaggedObject().getBaseObject().toASN1Primitive());
}

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
/*
This file is part of the iText (R) project.
Copyright (c) 1998-2023 Apryse Group NV
Authors: Apryse Software.
This program is offered under a commercial and under the AGPL license.
For commercial licensing, contact us at https://itextpdf.com/sales. For AGPL licensing, see below.
AGPL licensing:
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.itextpdf.bouncycastle.cms.jcajce;

import com.itextpdf.bouncycastle.cms.RecipientBC;
import com.itextpdf.commons.bouncycastle.cms.jcajce.IJceKeyAgreeEnvelopedRecipient;

import org.bouncycastle.cms.jcajce.JceKeyAgreeEnvelopedRecipient;

/**
* Wrapper class for {@link JceKeyAgreeEnvelopedRecipient}.
*/
public class JceKeyAgreeEnvelopedRecipientBC extends RecipientBC implements IJceKeyAgreeEnvelopedRecipient {
/**
* Creates new wrapper instance for {@link JceKeyAgreeEnvelopedRecipient}.
*
* @param jceKeyAgreeEnvelopedRecipient {@link JceKeyAgreeEnvelopedRecipient} to be wrapped
*/
public JceKeyAgreeEnvelopedRecipientBC(JceKeyAgreeEnvelopedRecipient jceKeyAgreeEnvelopedRecipient) {
super(jceKeyAgreeEnvelopedRecipient);
}

/**
* Gets actual org.bouncycastle object being wrapped.
*
* @return wrapped {@link JceKeyAgreeEnvelopedRecipient}.
*/
public JceKeyAgreeEnvelopedRecipient getJceKeyAgreeEnvelopedRecipient() {
return (JceKeyAgreeEnvelopedRecipient) getRecipient();
}

/**
* {@inheritDoc}
*/
@Override
public IJceKeyAgreeEnvelopedRecipient setProvider(String provider) {
getJceKeyAgreeEnvelopedRecipient().setProvider(provider);
return this;
}
}
6 changes: 3 additions & 3 deletions bouncy-castle-connector/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>com.itextpdf</groupId>
<artifactId>root</artifactId>
<version>8.0.0</version>
<version>8.0.1</version>
</parent>
<artifactId>bouncy-castle-connector</artifactId>
<name>iText - Bouncy Castle Connector</name>
Expand All @@ -24,11 +24,11 @@
<exclusions>
<exclusion>
<groupId>org.bouncycastle</groupId>
<artifactId>bcpkix-jdk15on</artifactId>
<artifactId>bcpkix-jdk18on</artifactId>
</exclusion>
<exclusion>
<groupId>org.bouncycastle</groupId>
<artifactId>bcprov-jdk15on</artifactId>
<artifactId>bcprov-jdk18on</artifactId>
</exclusion>
</exclusions>
</dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ This file is part of the iText (R) project.
import com.itextpdf.commons.bouncycastle.cms.ISignerInfoGenerator;
import com.itextpdf.commons.bouncycastle.cms.jcajce.IJcaSignerInfoGeneratorBuilder;
import com.itextpdf.commons.bouncycastle.cms.jcajce.IJcaSimpleSignerInfoVerifierBuilder;
import com.itextpdf.commons.bouncycastle.cms.jcajce.IJceKeyAgreeEnvelopedRecipient;
import com.itextpdf.commons.bouncycastle.cms.jcajce.IJceKeyTransEnvelopedRecipient;
import com.itextpdf.commons.bouncycastle.openssl.IPEMParser;
import com.itextpdf.commons.bouncycastle.openssl.jcajce.IJcaPEMKeyConverter;
Expand Down Expand Up @@ -152,6 +153,16 @@ class BouncyCastleDefaultFactory implements IBouncyCastleFactory {
BouncyCastleDefaultFactory() {
// Empty constructor
}

@Override
public String getAlgorithmOid(String name) {
throw new UnsupportedOperationException(BouncyCastleLogMessageConstant.BOUNCY_CASTLE_DEPENDENCY_MUST_PRESENT);
}

@Override
public String getAlgorithmName(String oid) {
throw new UnsupportedOperationException(BouncyCastleLogMessageConstant.BOUNCY_CASTLE_DEPENDENCY_MUST_PRESENT);
}

@Override
public IASN1ObjectIdentifier createASN1ObjectIdentifier(IASN1Encodable encodable) {
Expand Down Expand Up @@ -428,6 +439,11 @@ public String getProviderName() {
public IJceKeyTransEnvelopedRecipient createJceKeyTransEnvelopedRecipient(PrivateKey privateKey) {
throw new UnsupportedOperationException(BouncyCastleLogMessageConstant.BOUNCY_CASTLE_DEPENDENCY_MUST_PRESENT);
}

@Override
public IJceKeyAgreeEnvelopedRecipient createJceKeyAgreeEnvelopedRecipient(PrivateKey privateKey) {
throw new UnsupportedOperationException(BouncyCastleLogMessageConstant.BOUNCY_CASTLE_DEPENDENCY_MUST_PRESENT);
}

@Override
public IJcaContentVerifierProviderBuilder createJcaContentVerifierProviderBuilder() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,6 @@ private BouncyCastleLogMessageConstant() {
}

public static final String BOUNCY_CASTLE_DEPENDENCY_MUST_PRESENT =
"Either com.itextpdf:bouncy-castle-adapter or com.itextpdf:bouncy-castle-fips-adapter dependency must be added in order to use BouncyCastleFactoryCreator";
"Either com.itextpdf:bouncy-castle-adapter or com.itextpdf:bouncy-castle-fips-adapter " // Android-Conversion-Replace "com.itextpdf.android:bouncy-castle-adapter-android "
+ "dependency must be added in order to use BouncyCastleFactoryCreator";
}
2 changes: 1 addition & 1 deletion bouncy-castle-fips-adapter/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>com.itextpdf</groupId>
<artifactId>root</artifactId>
<version>8.0.0</version>
<version>8.0.1</version>
</parent>
<artifactId>bouncy-castle-fips-adapter</artifactId>
<name>iText - Bouncy Castle FIPS Adapter</name>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ This file is part of the iText (R) project.
import com.itextpdf.bouncycastlefips.cms.CMSExceptionBCFips;
import com.itextpdf.bouncycastlefips.cms.jcajce.JcaSignerInfoGeneratorBuilderBCFips;
import com.itextpdf.bouncycastlefips.cms.jcajce.JcaSimpleSignerInfoVerifierBuilderBCFips;
import com.itextpdf.bouncycastlefips.cms.jcajce.JceKeyAgreeEnvelopedRecipientBCFips;
import com.itextpdf.bouncycastlefips.cms.jcajce.JceKeyTransEnvelopedRecipientBCFips;
import com.itextpdf.bouncycastlefips.openssl.PEMParserBCFips;
import com.itextpdf.bouncycastlefips.openssl.jcajce.JcaPEMKeyConverterBCFips;
Expand Down Expand Up @@ -214,6 +215,7 @@ This file is part of the iText (R) project.
import com.itextpdf.commons.bouncycastle.cms.ISignerInfoGenerator;
import com.itextpdf.commons.bouncycastle.cms.jcajce.IJcaSignerInfoGeneratorBuilder;
import com.itextpdf.commons.bouncycastle.cms.jcajce.IJcaSimpleSignerInfoVerifierBuilder;
import com.itextpdf.commons.bouncycastle.cms.jcajce.IJceKeyAgreeEnvelopedRecipient;
import com.itextpdf.commons.bouncycastle.cms.jcajce.IJceKeyTransEnvelopedRecipient;
import com.itextpdf.commons.bouncycastle.openssl.IPEMParser;
import com.itextpdf.commons.bouncycastle.openssl.jcajce.IJcaPEMKeyConverter;
Expand Down Expand Up @@ -304,12 +306,15 @@ This file is part of the iText (R) project.
import org.bouncycastle.cms.CMSSignedData;
import org.bouncycastle.cms.CMSTypedData;
import org.bouncycastle.cms.jcajce.JcaSimpleSignerInfoVerifierBuilder;
import org.bouncycastle.cms.jcajce.JceKeyAgreeEnvelopedRecipient;
import org.bouncycastle.cms.jcajce.JceKeyTransEnvelopedRecipient;
import org.bouncycastle.crypto.CryptoServicesRegistrar;
import org.bouncycastle.jcajce.provider.BouncyCastleFipsProvider;
import org.bouncycastle.openssl.PEMParser;
import org.bouncycastle.openssl.jcajce.JcaPEMKeyConverter;
import org.bouncycastle.openssl.jcajce.JceOpenSSLPKCS8DecryptorProviderBuilder;
import org.bouncycastle.operator.DefaultAlgorithmNameFinder;
import org.bouncycastle.operator.DefaultSignatureAlgorithmIdentifierFinder;
import org.bouncycastle.operator.jcajce.JcaContentSignerBuilder;
import org.bouncycastle.operator.jcajce.JcaContentVerifierProviderBuilder;
import org.bouncycastle.operator.jcajce.JcaDigestCalculatorProviderBuilder;
Expand All @@ -336,6 +341,23 @@ public BouncyCastleFipsFactory() {
// Empty constructor.
}

/**
* {@inheritDoc}
*/
@Override
public String getAlgorithmOid(String name) {
AlgorithmIdentifier algorithmIdentifier = new DefaultSignatureAlgorithmIdentifierFinder().find(name);
return algorithmIdentifier.getAlgorithm().getId();
}

/**
* {@inheritDoc}
*/
@Override
public String getAlgorithmName(String oid) {
return new DefaultAlgorithmNameFinder().getAlgorithmName(new ASN1ObjectIdentifier(oid));
}

/**
* {@inheritDoc}
*/
Expand Down Expand Up @@ -856,6 +878,14 @@ public IJceKeyTransEnvelopedRecipient createJceKeyTransEnvelopedRecipient(Privat
return new JceKeyTransEnvelopedRecipientBCFips(new JceKeyTransEnvelopedRecipient(privateKey));
}

/**
* {@inheritDoc}
*/
@Override
public IJceKeyAgreeEnvelopedRecipient createJceKeyAgreeEnvelopedRecipient(PrivateKey privateKey) {
return new JceKeyAgreeEnvelopedRecipientBCFips(new JceKeyAgreeEnvelopedRecipient(privateKey));
}

/**
* {@inheritDoc}
*/
Expand Down
Loading

0 comments on commit 2fb084d

Please sign in to comment.