/** * Return the computed KeyInfo value as a DOM Element * Call this method after <code>prepare()</code> */ public Element getKeyInfoElement() throws WSSecurityException { Element parent = getDocument().createElement("temp"); DOMCryptoContext cryptoContext = new DOMCryptoContext() { }; cryptoContext.putNamespacePrefix(WSConstants.SIG_NS, WSConstants.SIG_PREFIX); try { keyInfo.marshal(new DOMStructure(parent), cryptoContext); } catch (MarshalException ex) { LOG.error(ex.getMessage(), ex); throw new WSSecurityException( WSSecurityException.ErrorCode.FAILED_SIGNATURE, ex ); } return (Element)parent.getFirstChild(); }
); keyInfo.marshal(new DOMStructure(encryptedKeyElement), null); } catch (java.security.KeyException | MarshalException ex) { LOG.error("", ex);