private static boolean getBoolean(XMLCryptoContext xc, String name) { Boolean value = (Boolean)xc.getProperty(name); return value != null && value.booleanValue(); } }
protected Attachment attachmentRequestCallback(XMLCryptoContext context, String attachmentId) throws TransformException { CallbackHandler attachmentCallbackHandler = (CallbackHandler) context.getProperty(ATTACHMENT_CALLBACKHANDLER); if (attachmentCallbackHandler == null) { throw new TransformException("No attachment callbackhandler supplied"); } AttachmentRequestCallback attachmentRequestCallback = new AttachmentRequestCallback(); attachmentRequestCallback.setAttachmentId(attachmentId); try { attachmentCallbackHandler.handle(new Callback[]{attachmentRequestCallback}); } catch (Exception e) { throw new TransformException(e); } List<Attachment> attachments = attachmentRequestCallback.getAttachments(); if (attachments == null || attachments.isEmpty() || !attachmentId.equals(attachments.get(0).getId())) { throw new TransformException("Attachment not found"); } return attachments.get(0); }
protected void attachmentResultCallback(XMLCryptoContext context, Attachment attachment) throws TransformException { CallbackHandler attachmentCallbackHandler = (CallbackHandler) context.getProperty(ATTACHMENT_CALLBACKHANDLER); if (attachmentCallbackHandler == null) { throw new TransformException("No attachment callbackhandler supplied"); } AttachmentResultCallback attachmentResultCallback = new AttachmentResultCallback(); attachmentResultCallback.setAttachmentId(attachment.getId()); attachmentResultCallback.setAttachment(attachment); try { attachmentCallbackHandler.handle(new Callback[]{attachmentResultCallback}); } catch (Exception e) { throw new TransformException(e); } }
Object wsDocInfoObject = xc.getProperty(TRANSFORM_WS_DOC_INFO); WSDocInfo wsDocInfo = null; if (wsDocInfoObject instanceof WSDocInfo) {
Object wsDocInfoObject = xc.getProperty(TRANSFORM_WS_DOC_INFO); WSDocInfo wsDocInfo = null; if (wsDocInfoObject instanceof WSDocInfo) {
Object wsDocInfoObject = xc.getProperty(TRANSFORM_WS_DOC_INFO); WSDocInfo wsDocInfo = null; if (wsDocInfoObject instanceof WSDocInfo) {
DigesterOutputStream dos; Boolean cache = (Boolean) context.getProperty("javax.xml.crypto.dsig.cacheReference"); if (cache != null && cache) { this.derefData = copyDerefData(dereferencedData); if (context instanceof XMLSignContext) { if (!c14n11) { Boolean prop = (Boolean)context.getProperty ("org.apache.xml.security.useC14N11"); c14n11 = prop != null && prop;