Categories:
Audio (13)
Biotech (29)
Bytecode (36)
Database (77)
Framework (7)
Game (7)
General (507)
Graphics (53)
I/O (35)
IDE (2)
JAR Tools (102)
JavaBeans (21)
JDBC (121)
JDK (426)
JSP (20)
Logging (108)
Mail (58)
Messaging (8)
Network (84)
PDF (97)
Report (7)
Scripting (84)
Security (32)
Server (121)
Servlet (26)
SOAP (24)
Testing (54)
Web (15)
XML (322)
Collections:
Other Resources:
JDK 17 java.xml.crypto.jmod - XML Crypto Module
JDK 17 java.xml.crypto.jmod is the JMOD file for JDK 17 XML (eXtensible Markup Language) Crypto module.
JDK 17 XML Crypto module compiled class files are stored in \fyicenter\jdk-17.0.5\jmods\java.xml.crypto.jmod.
JDK 17 XML Crypto module compiled class files are also linked and stored in the \fyicenter\jdk-17.0.5\lib\modules JImage file.
JDK 17 XML Crypto module source code files are stored in \fyicenter\jdk-17.0.5\lib\src.zip\java.xml.crypto.
You can click and view the content of each source code file in the list below.
✍: FYIcenter
⏎ org/jcp/xml/dsig/internal/dom/DOMXMLObject.java
/*
* Copyright (c) 2007, 2022, Oracle and/or its affiliates. All rights reserved.
* ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
*/
/**
* 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.
*/
/*
* Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
*/
package org.jcp.xml.dsig.internal.dom;
import javax.xml.crypto.*;
import javax.xml.crypto.dom.DOMCryptoContext;
import javax.xml.crypto.dsig.*;
import java.security.Provider;
import java.util.*;
import org.w3c.dom.Attr;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
/**
* DOM-based implementation of XMLObject.
*
*/
public final class DOMXMLObject extends DOMStructure implements XMLObject {
private final String id;
private final String mimeType;
private final String encoding;
private final List<XMLStructure> content;
private Element objectElem;
/**
* Creates an {@code XMLObject} from the specified parameters.
*
* @param content a list of {@link XMLStructure}s. The list
* is defensively copied to protect against subsequent modification.
* May be {@code null} or empty.
* @param id the Id (may be {@code null})
* @param mimeType the mime type (may be {@code null})
* @param encoding the encoding (may be {@code null})
* @throws ClassCastException if {@code content} contains any
* entries that are not of type {@link XMLStructure}
*/
public DOMXMLObject(List<? extends XMLStructure> content, String id,
String mimeType, String encoding)
{
if (content == null || content.isEmpty()) {
this.content = Collections.emptyList();
} else {
this.content = Collections.unmodifiableList(
new ArrayList<>(content));
for (int i = 0, size = this.content.size(); i < size; i++) {
if (!(this.content.get(i) instanceof XMLStructure)) {
throw new ClassCastException
("content["+i+"] is not a valid type");
}
}
}
this.id = id;
this.mimeType = mimeType;
this.encoding = encoding;
}
/**
* Creates an {@code XMLObject} from an element.
*
* @param objElem an Object element
* @throws MarshalException if there is an error when unmarshalling
*/
public DOMXMLObject(Element objElem, XMLCryptoContext context,
Provider provider)
throws MarshalException
{
// unmarshal attributes
this.encoding = DOMUtils.getAttributeValue(objElem, "Encoding");
Attr attr = objElem.getAttributeNodeNS(null, "Id");
if (attr != null) {
this.id = attr.getValue();
objElem.setIdAttributeNode(attr, true);
} else {
this.id = null;
}
this.mimeType = DOMUtils.getAttributeValue(objElem, "MimeType");
List<XMLStructure> newContent = new ArrayList<>();
Node firstChild = objElem.getFirstChild();
while (firstChild != null) {
if (firstChild.getNodeType() == Node.ELEMENT_NODE) {
Element childElem = (Element)firstChild;
String tag = childElem.getLocalName();
String namespace = childElem.getNamespaceURI();
if ("Manifest".equals(tag) && XMLSignature.XMLNS.equals(namespace)) {
newContent.add(new DOMManifest(childElem, context, provider));
} else if ("SignatureProperties".equals(tag) && XMLSignature.XMLNS.equals(namespace)) {
newContent.add(new DOMSignatureProperties(childElem));
} else if ("X509Data".equals(tag) && XMLSignature.XMLNS.equals(namespace)) {
newContent.add(new DOMX509Data(childElem));
} else {
//@@@FIXME: check for other dsig structures
newContent.add(new javax.xml.crypto.dom.DOMStructure(firstChild));
}
} else {
newContent.add(new javax.xml.crypto.dom.DOMStructure(firstChild));
}
firstChild = firstChild.getNextSibling();
}
// Here we capture namespace declarations, so that when they're marshalled back
// out, we can make copies of them. Note that attributes are NOT captured.
NamedNodeMap nnm = objElem.getAttributes();
for (int idx = 0 ; idx < nnm.getLength() ; idx++) {
Node nsDecl = nnm.item(idx);
if (DOMUtils.isNamespace(nsDecl)) {
newContent.add(new javax.xml.crypto.dom.DOMStructure(nsDecl));
}
}
if (newContent.isEmpty()) {
this.content = Collections.emptyList();
} else {
this.content = Collections.unmodifiableList(newContent);
}
this.objectElem = objElem;
}
public List<XMLStructure> getContent() {
return content;
}
public String getId() {
return id;
}
public String getMimeType() {
return mimeType;
}
public String getEncoding() {
return encoding;
}
@Override
public void marshal(Node parent, String dsPrefix, DOMCryptoContext context)
throws MarshalException {
Document ownerDoc = DOMUtils.getOwnerDocument(parent);
Element objElem = objectElem;
if (objElem == null) {
objElem = DOMUtils.createElement(ownerDoc, "Object",
XMLSignature.XMLNS, dsPrefix);
// set attributes
DOMUtils.setAttributeID(objElem, "Id", id);
DOMUtils.setAttribute(objElem, "MimeType", mimeType);
DOMUtils.setAttribute(objElem, "Encoding", encoding);
// create and append any elements and mixed content, if necessary
for (XMLStructure object : content) {
if (object instanceof DOMStructure) {
((DOMStructure)object).marshal(objElem, dsPrefix, context);
} else {
javax.xml.crypto.dom.DOMStructure domObject =
(javax.xml.crypto.dom.DOMStructure)object;
DOMUtils.appendChild(objElem, domObject.getNode());
}
}
}
parent.appendChild(objElem);
}
@SuppressWarnings("unchecked")
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (!(o instanceof XMLObject)) {
return false;
}
XMLObject oxo = (XMLObject)o;
boolean idsEqual = id == null ? oxo.getId() == null
: id.equals(oxo.getId());
boolean encodingsEqual =
encoding == null ? oxo.getEncoding() == null
: encoding.equals(oxo.getEncoding());
boolean mimeTypesEqual =
mimeType == null ? oxo.getMimeType() == null
: mimeType.equals(oxo.getMimeType());
return idsEqual && encodingsEqual && mimeTypesEqual &&
equalsContent(content, oxo.getContent());
}
@Override
public int hashCode() {
int result = 17;
if (id != null) {
result = 31 * result + id.hashCode();
}
if (encoding != null) {
result = 31 * result + encoding.hashCode();
}
if (mimeType != null) {
result = 31 * result + mimeType.hashCode();
}
result = 31 * result + content.hashCode();
return result;
}
}
⏎ org/jcp/xml/dsig/internal/dom/DOMXMLObject.java
Or download all of them as a single archive file:
File name: java.xml.crypto-17.0.5-src.zip File size: 555559 bytes Release date: 2022-09-13 Download
⇒ JDK 17 jdk.accessibility.jmod - Accessibility Module
2023-07-01, ≈100🔥, 0💬
Popular Posts:
JDK 17 jdk.jdi.jmod is the JMOD file for JDK 17 JDI (Java Debug Interface) tool. JDK 17 JDI tool com...
What Is js.jar in Rhino JavaScript 1.7R5? js.jar in Rhino JavaScript 1.7R5 is the JAR file for Rhino...
Java Servlet 3.0 Specification API. JAR File Size and Download Location: File name: servlet-api.jar,...
JDK 17 jdk.internal.JVM Stat.jmod is the JMOD file for JDK 17 Internal Jvmstat module. JDK 17 Intern...
What Is ojdbc8.jar for Oracle 12c R2? ojdbc8.jar for Oracle 12c R2 is the JAR files of ojdbc.jar, JD...