diff --git a/src/share/classes/org/jcp/xml/dsig/internal/dom/DOMKeyInfoFactory.java b/src/share/classes/org/jcp/xml/dsig/internal/dom/DOMKeyInfoFactory.java index 45b5620ed5da47d1c6f1c498c2565ea6b02e5d13..356201762c06ec300d04bee5ab27ac98034cb03f 100644 --- a/src/share/classes/org/jcp/xml/dsig/internal/dom/DOMKeyInfoFactory.java +++ b/src/share/classes/org/jcp/xml/dsig/internal/dom/DOMKeyInfoFactory.java @@ -153,9 +153,15 @@ public final class DOMKeyInfoFactory extends KeyInfoFactory { "support DOM Level 2 and be namespace aware"); } if (tag.equals("KeyInfo")) { - return new DOMKeyInfo(element, new UnmarshalContext(), getProvider()); + try { + return new DOMKeyInfo(element, new UnmarshalContext(), getProvider()); + } catch (MarshalException me) { + throw me; + } catch (Exception e) { + throw new MarshalException(e); + } } else { - throw new MarshalException("invalid KeyInfo tag: " + tag); + throw new MarshalException("Invalid KeyInfo tag: " + tag); } } diff --git a/src/share/classes/org/jcp/xml/dsig/internal/dom/DOMXMLSignatureFactory.java b/src/share/classes/org/jcp/xml/dsig/internal/dom/DOMXMLSignatureFactory.java index 0e63028c777c8fe5ff0db7cbb6e8ab71720e393e..85622e1cac3bf0e456811eca5e8d3f426cf3df3b 100644 --- a/src/share/classes/org/jcp/xml/dsig/internal/dom/DOMXMLSignatureFactory.java +++ b/src/share/classes/org/jcp/xml/dsig/internal/dom/DOMXMLSignatureFactory.java @@ -190,9 +190,15 @@ public final class DOMXMLSignatureFactory extends XMLSignatureFactory { "support DOM Level 2 and be namespace aware"); } if (tag.equals("Signature")) { - return new DOMXMLSignature(element, context, getProvider()); + try { + return new DOMXMLSignature(element, context, getProvider()); + } catch (MarshalException me) { + throw me; + } catch (Exception e) { + throw new MarshalException(e); + } } else { - throw new MarshalException("invalid Signature tag: " + tag); + throw new MarshalException("Invalid Signature tag: " + tag); } }