aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--poi-ooxml/src/main/java/org/apache/poi/poifs/crypt/dsig/SignatureConfig.java96
-rw-r--r--poi-ooxml/src/main/java/org/apache/poi/poifs/crypt/dsig/SignatureInfo.java23
2 files changed, 4 insertions, 115 deletions
diff --git a/poi-ooxml/src/main/java/org/apache/poi/poifs/crypt/dsig/SignatureConfig.java b/poi-ooxml/src/main/java/org/apache/poi/poifs/crypt/dsig/SignatureConfig.java
index b7ce3c014f..c87fb8e7c8 100644
--- a/poi-ooxml/src/main/java/org/apache/poi/poifs/crypt/dsig/SignatureConfig.java
+++ b/poi-ooxml/src/main/java/org/apache/poi/poifs/crypt/dsig/SignatureConfig.java
@@ -125,12 +125,6 @@ public class SignatureConfig {
Office2010SignatureFacet::new
);
-
- private final ThreadLocal<OPCPackage> opcPackage = new ThreadLocal<>();
- private final ThreadLocal<XMLSignatureFactory> signatureFactory = new ThreadLocal<>();
- private final ThreadLocal<KeyInfoFactory> keyInfoFactory = new ThreadLocal<>();
- private final ThreadLocal<Provider> provider = new ThreadLocal<>();
-
private List<SignatureFacet> signatureFacets = new ArrayList<>();
private HashAlgorithm digestAlgo = HashAlgorithm.sha256;
private Date executionTime = new Date();
@@ -325,28 +319,6 @@ public class SignatureConfig {
}
/**
- * @return the opc package to be used by this thread, stored as thread-local
- *
- * @deprecated in POI 5.0.0 - use {@link SignatureInfo#setOpcPackage(OPCPackage)} instead
- */
- @Deprecated
- @Removal(version = "5.0.0")
- public OPCPackage getOpcPackage() {
- return opcPackage.get();
- }
-
- /**
- * @param opcPackage the opc package to be handled by this thread, stored as thread-local
- *
- * @deprecated in POI 5.0.0 - use {@link SignatureInfo#setOpcPackage(OPCPackage)} instead
- */
- @Deprecated
- @Removal(version = "5.0.0")
- public void setOpcPackage(OPCPackage opcPackage) {
- this.opcPackage.set(opcPackage);
- }
-
- /**
* @return the private key
*/
public PrivateKey getKey() {
@@ -1011,74 +983,6 @@ public class SignatureConfig {
}
}
-
- /**
- * @param signatureFactory the xml signature factory, saved as thread-local
- *
- * @deprecated in POI 5.0.0 - use {@link SignatureInfo#setSignatureFactory(XMLSignatureFactory)}
- */
- @Deprecated
- @Removal(version = "5.0.0")
- public void setSignatureFactory(XMLSignatureFactory signatureFactory) {
- this.signatureFactory.set(signatureFactory);
- }
-
- /**
- * @return the xml signature factory (thread-local)
- *
- * @deprecated in POI 5.0.0 - will be handled by SignatureInfo internally
- */
- @Deprecated
- @Removal(version = "5.0.0")
- public XMLSignatureFactory getSignatureFactory() {
- return signatureFactory.get();
- }
-
- /**
- * @param keyInfoFactory the key factory, saved as thread-local
- *
- * @deprecated in POI 5.0.0 - use {@link SignatureInfo#setKeyInfoFactory(KeyInfoFactory)}
- */
- @Deprecated
- @Removal(version = "5.0.0")
- public void setKeyInfoFactory(KeyInfoFactory keyInfoFactory) {
- this.keyInfoFactory.set(keyInfoFactory);
- }
-
- /**
- * @return the key factory (thread-local)
- *
- * @deprecated in POI 5.0.0 - will be handled by SignatureInfo internally
- */
- @Deprecated
- @Removal(version = "5.0.0")
- public KeyInfoFactory getKeyInfoFactory() {
- return keyInfoFactory.get();
- }
-
- /**
- * Helper method to set provider
- * @param provider the provider
- * @deprecated in POI 5.0.0 - use {@link SignatureInfo#setProvider(Provider)}
- */
- @Internal
- @Deprecated
- @Removal(version = "5.0.0")
- public void setProvider(Provider provider) {
- this.provider.set(provider);
- }
-
- /**
- * @return the cached provider or null if not set before
- *
- * @deprecated in POI 5.0.0 - will be handled by SignatureInfo internally
- */
- @Deprecated
- @Removal(version = "5.0.0")
- public Provider getProvider() {
- return provider.get();
- }
-
/**
* Determine the possible classes for XMLSEC.
* The order is
diff --git a/poi-ooxml/src/main/java/org/apache/poi/poifs/crypt/dsig/SignatureInfo.java b/poi-ooxml/src/main/java/org/apache/poi/poifs/crypt/dsig/SignatureInfo.java
index 782f72b4f3..0941621d61 100644
--- a/poi-ooxml/src/main/java/org/apache/poi/poifs/crypt/dsig/SignatureInfo.java
+++ b/poi-ooxml/src/main/java/org/apache/poi/poifs/crypt/dsig/SignatureInfo.java
@@ -626,32 +626,17 @@ public class SignatureInfo {
*/
@SuppressWarnings("deprecation")
protected void initXmlProvider() {
- if (opcPackage == null) {
- opcPackage = signatureConfig.getOpcPackage();
- }
if (provider == null) {
- provider = signatureConfig.getProvider();
- if (provider == null) {
- provider = XmlProviderInitSingleton.getInstance().findProvider();
- }
+ provider = XmlProviderInitSingleton.getInstance().findProvider();
}
if (signatureFactory == null) {
- signatureFactory = signatureConfig.getSignatureFactory();
- if (signatureFactory == null) {
- signatureFactory = XMLSignatureFactory.getInstance("DOM", provider);
- }
+ signatureFactory = XMLSignatureFactory.getInstance("DOM", provider);
}
if (keyInfoFactory == null) {
- keyInfoFactory = signatureConfig.getKeyInfoFactory();
- if (keyInfoFactory == null) {
- keyInfoFactory = KeyInfoFactory.getInstance("DOM", provider);
- }
+ keyInfoFactory = KeyInfoFactory.getInstance("DOM", provider);
}
if (uriDereferencer == null) {
- uriDereferencer = signatureConfig.getUriDereferencer();
- if (uriDereferencer == null) {
- uriDereferencer = new OOXMLURIDereferencer();
- }
+ uriDereferencer = new OOXMLURIDereferencer();
}
if (uriDereferencer instanceof OOXMLURIDereferencer) {
((OOXMLURIDereferencer)uriDereferencer).setSignatureInfo(this);