You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@santuario.apache.org by co...@apache.org on 2020/05/18 15:28:23 UTC
[santuario-xml-security-java] branch master updated: Removing some
deprecated utils
This is an automated email from the ASF dual-hosted git repository.
coheigea pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/santuario-xml-security-java.git
The following commit(s) were added to refs/heads/master by this push:
new bd7c1d0 Removing some deprecated utils
bd7c1d0 is described below
commit bd7c1d0dd1fc4221e01a5c517a4c72d6f8b6aa00
Author: Colm O hEigeartaigh <co...@apache.org>
AuthorDate: Mon May 18 16:28:04 2020 +0100
Removing some deprecated utils
---
.../keyresolver/InvalidKeyResolverException.java | 87 -------------------
.../security/stax/impl/algorithms/DSAUtils.java | 53 ------------
.../security/stax/impl/algorithms/ECDSAUtils.java | 98 ----------------------
.../impl/algorithms/HMACSignatureAlgorithm.java | 4 +-
4 files changed, 1 insertion(+), 241 deletions(-)
diff --git a/src/main/java/org/apache/xml/security/keys/keyresolver/InvalidKeyResolverException.java b/src/main/java/org/apache/xml/security/keys/keyresolver/InvalidKeyResolverException.java
deleted file mode 100644
index 5a9f856..0000000
--- a/src/main/java/org/apache/xml/security/keys/keyresolver/InvalidKeyResolverException.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.xml.security.keys.keyresolver;
-
-import org.apache.xml.security.exceptions.XMLSecurityException;
-
-public class InvalidKeyResolverException extends XMLSecurityException {
-
- /**
- *
- */
- private static final long serialVersionUID = 1L;
-
- /**
- * Constructor InvalidKeyResolverException
- *
- */
- public InvalidKeyResolverException() {
- super();
- }
-
- /**
- * Constructor InvalidKeyResolverException
- *
- * @param msgID
- */
- public InvalidKeyResolverException(String msgID) {
- super(msgID);
- }
-
- /**
- * Constructor InvalidKeyResolverException
- *
- * @param msgID
- * @param exArgs
- */
- public InvalidKeyResolverException(String msgID, Object[] exArgs) {
- super(msgID, exArgs);
- }
-
- /**
- * Constructor InvalidKeyResolverException
- *
- * @param originalException
- * @param msgID
- */
- public InvalidKeyResolverException(Exception originalException, String msgID) {
- super(originalException, msgID);
- }
-
- @Deprecated
- public InvalidKeyResolverException(String msgID, Exception originalException) {
- this(originalException, msgID);
- }
-
- /**
- * Constructor InvalidKeyResolverException
- *
- * @param originalException
- * @param msgID
- * @param exArgs
- */
- public InvalidKeyResolverException(Exception originalException, String msgID, Object[] exArgs) {
- super(originalException, msgID, exArgs);
- }
-
- @Deprecated
- public InvalidKeyResolverException(String msgID, Object[] exArgs, Exception originalException) {
- this(originalException, msgID, exArgs);
- }
-}
diff --git a/src/main/java/org/apache/xml/security/stax/impl/algorithms/DSAUtils.java b/src/main/java/org/apache/xml/security/stax/impl/algorithms/DSAUtils.java
deleted file mode 100644
index cf88666..0000000
--- a/src/main/java/org/apache/xml/security/stax/impl/algorithms/DSAUtils.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.xml.security.stax.impl.algorithms;
-
-import java.io.IOException;
-
-@Deprecated
-public class DSAUtils {
-
- /**
- * Converts an ASN.1 DSA value to a XML Signature DSA Value.
- * <p></p>
- * The JAVA JCE DSA Signature algorithm creates ASN.1 encoded (r, s) value
- * pairs; the XML Signature requires the core BigInteger values.
- *
- * @param asn1Bytes
- * @throws java.io.IOException
- * @see <A HREF="http://www.w3.org/TR/xmldsig-core/#dsa-sha1">6.4.1 DSA</A>
- */
- public static byte[] convertASN1toXMLDSIG(byte[] asn1Bytes) throws IOException {
- return org.apache.xml.security.algorithms.implementations.ECDSAUtils.convertASN1toXMLDSIG(asn1Bytes);
- }
-
- /**
- * Converts a XML Signature DSA Value to an ASN.1 DSA value.
- * <p></p>
- * The JAVA JCE DSA Signature algorithm creates ASN.1 encoded (r, s) value
- * pairs; the XML Signature requires the core BigInteger values.
- *
- * @param xmldsigBytes
- * @throws IOException
- * @see <A HREF="http://www.w3.org/TR/xmldsig-core/#dsa-sha1">6.4.1 DSA</A>
- */
- public static byte[] convertXMLDSIGtoASN1(byte[] xmldsigBytes) throws IOException {
- return org.apache.xml.security.algorithms.implementations.ECDSAUtils.convertXMLDSIGtoASN1(xmldsigBytes);
- }
-}
\ No newline at end of file
diff --git a/src/main/java/org/apache/xml/security/stax/impl/algorithms/ECDSAUtils.java b/src/main/java/org/apache/xml/security/stax/impl/algorithms/ECDSAUtils.java
deleted file mode 100644
index dcc0f6b..0000000
--- a/src/main/java/org/apache/xml/security/stax/impl/algorithms/ECDSAUtils.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.xml.security.stax.impl.algorithms;
-
-import java.io.IOException;
-import java.security.interfaces.ECPublicKey;
-import java.security.spec.*;
-
-@Deprecated
-public final class ECDSAUtils {
-
- private ECDSAUtils() {
- // complete
- }
-
- /**
- * Converts an ASN.1 ECDSA value to a XML Signature ECDSA Value.
- * <p></p>
- * The JAVA JCE ECDSA Signature algorithm creates ASN.1 encoded (r, s) value
- * pairs; the XML Signature requires the core BigInteger values.
- *
- * @param asn1Bytes
- * @return the decode bytes
- * @throws IOException
- * @see <A HREF="http://www.w3.org/TR/xmldsig-core/#dsa-sha1">6.4.1 DSA</A>
- * @see <A HREF="ftp://ftp.rfc-editor.org/in-notes/rfc4050.txt">3.3. ECDSA Signatures</A>
- */
- public static byte[] convertASN1toXMLDSIG(byte[] asn1Bytes) throws IOException {
- return org.apache.xml.security.algorithms.implementations.ECDSAUtils.convertASN1toXMLDSIG(asn1Bytes);
- }
-
- /**
- * Converts a XML Signature ECDSA Value to an ASN.1 DSA value.
- * <p></p>
- * The JAVA JCE ECDSA Signature algorithm creates ASN.1 encoded (r, s) value
- * pairs; the XML Signature requires the core BigInteger values.
- *
- * @param xmldsigBytes
- * @return the encoded ASN.1 bytes
- * @throws IOException
- * @see <A HREF="http://www.w3.org/TR/xmldsig-core/#dsa-sha1">6.4.1 DSA</A>
- * @see <A HREF="ftp://ftp.rfc-editor.org/in-notes/rfc4050.txt">3.3. ECDSA Signatures</A>
- */
- public static byte[] convertXMLDSIGtoASN1(byte[] xmldsigBytes) throws IOException {
- return org.apache.xml.security.algorithms.implementations.ECDSAUtils.convertXMLDSIGtoASN1(xmldsigBytes);
- }
-
- public static String getOIDFromPublicKey(ECPublicKey ecPublicKey) {
- return org.apache.xml.security.algorithms.implementations.ECDSAUtils.getOIDFromPublicKey(ecPublicKey);
- }
-
- public static ECCurveDefinition getECCurveDefinition(String oid) {
- org.apache.xml.security.algorithms.implementations.ECDSAUtils.ECCurveDefinition curveDef =
- org.apache.xml.security.algorithms.implementations.ECDSAUtils.getECCurveDefinition(oid);
- if (curveDef != null) {
- return new ECCurveDefinition(curveDef.getName(), curveDef.getOid(), curveDef.getField(), curveDef.getA(),
- curveDef.getB(), curveDef.getX(), curveDef.getY(), curveDef.getN(),
- curveDef.getH());
- }
- return null;
- }
-
- public static class ECCurveDefinition
- extends org.apache.xml.security.algorithms.implementations.ECDSAUtils.ECCurveDefinition {
-
- public ECCurveDefinition(String name, String oid, String field, String a, String b, String x, String y, String n, int h) {
- super(name, oid, field, a, b, x, y, n, h);
- }
- }
-
- public static byte[] encodePoint(ECPoint ecPoint, EllipticCurve ellipticCurve) {
- return org.apache.xml.security.algorithms.implementations.ECDSAUtils.encodePoint(ecPoint, ellipticCurve);
- }
-
- public static ECPoint decodePoint(byte[] encodedBytes, EllipticCurve ellipticCurve) {
- return org.apache.xml.security.algorithms.implementations.ECDSAUtils.decodePoint(encodedBytes, ellipticCurve);
- }
-
- public static byte[] stripLeadingZeros(byte[] bytes) {
- return org.apache.xml.security.algorithms.implementations.ECDSAUtils.stripLeadingZeros(bytes);
- }
-}
diff --git a/src/main/java/org/apache/xml/security/stax/impl/algorithms/HMACSignatureAlgorithm.java b/src/main/java/org/apache/xml/security/stax/impl/algorithms/HMACSignatureAlgorithm.java
index 7d1240c..dc109f2 100644
--- a/src/main/java/org/apache/xml/security/stax/impl/algorithms/HMACSignatureAlgorithm.java
+++ b/src/main/java/org/apache/xml/security/stax/impl/algorithms/HMACSignatureAlgorithm.java
@@ -75,9 +75,7 @@ public class HMACSignatureAlgorithm implements SignatureAlgorithm {
public void engineInitSign(Key signingKey, AlgorithmParameterSpec algorithmParameterSpec) throws XMLSecurityException {
try {
mac.init(signingKey, algorithmParameterSpec);
- } catch (InvalidKeyException e) {
- throw new XMLSecurityException(e);
- } catch (InvalidAlgorithmParameterException e) {
+ } catch (InvalidKeyException | InvalidAlgorithmParameterException e) {
throw new XMLSecurityException(e);
}
}