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
⏎ com/sun/org/apache/xml/internal/security/transforms/implementations/TransformBase64Decode.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.
*/
package com.sun.org.apache.xml.internal.security.transforms.implementations;
import java.io.IOException;
import java.io.OutputStream;
import com.sun.org.apache.xml.internal.security.c14n.CanonicalizationException;
import com.sun.org.apache.xml.internal.security.signature.XMLSignatureInput;
import com.sun.org.apache.xml.internal.security.transforms.TransformSpi;
import com.sun.org.apache.xml.internal.security.transforms.TransformationException;
import com.sun.org.apache.xml.internal.security.transforms.Transforms;
import com.sun.org.apache.xml.internal.security.utils.XMLUtils;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.Text;
import com.sun.org.apache.xml.internal.security.utils.JavaUtils;
/**
* Implements the {@code http://www.w3.org/2000/09/xmldsig#base64} decoding
* transform.
*
* <p>The normative specification for base64 decoding transforms is
* <A HREF="http://www.w3.org/TR/2001/CR-xmldsig-core-20010419/#ref-MIME">[MIME]</A>.
* The base64 Transform element has no content. The input
* is decoded by the algorithms. This transform is useful if an
* application needs to sign the raw data associated with the encoded
* content of an element. </p>
*
* <p>This transform requires an octet stream for input.
* If an XPath node-set (or sufficiently functional alternative) is
* given as input, then it is converted to an octet stream by
* performing operations LOGically equivalent to 1) applying an XPath
* transform with expression self::text(), then 2) taking the string-value
* of the node-set. Thus, if an XML element is identified by a barename
* XPointer in the Reference URI, and its content consists solely of base64
* encoded character data, then this transform automatically strips away the
* start and end tags of the identified element and any of its descendant
* elements as well as any descendant comments and processing instructions.
* The output of this transform is an octet stream.</p>
*
*/
public class TransformBase64Decode extends TransformSpi {
/**
* {@inheritDoc}
*/
@Override
protected String engineGetURI() {
return Transforms.TRANSFORM_BASE64_DECODE;
}
/**
* {@inheritDoc}
*/
@Override
protected XMLSignatureInput enginePerformTransform(
XMLSignatureInput input, OutputStream os, Element transformElement,
String baseURI, boolean secureValidation
) throws IOException, CanonicalizationException, TransformationException {
if (input.isElement()) {
Node el = input.getSubNode();
if (input.getSubNode().getNodeType() == Node.TEXT_NODE) {
el = el.getParentNode();
}
StringBuilder sb = new StringBuilder();
traverseElement((Element)el, sb);
if (os == null) {
byte[] decodedBytes = XMLUtils.decode(sb.toString());
XMLSignatureInput output = new XMLSignatureInput(decodedBytes);
output.setSecureValidation(secureValidation);
return output;
}
byte[] bytes = XMLUtils.decode(sb.toString());
os.write(bytes);
XMLSignatureInput output = new XMLSignatureInput((byte[])null);
output.setSecureValidation(secureValidation);
output.setOutputStream(os);
return output;
} else if (input.isOctetStream() || input.isNodeSet()) {
if (os == null) {
byte[] base64Bytes = input.getBytes();
byte[] decodedBytes = XMLUtils.decode(base64Bytes);
XMLSignatureInput output = new XMLSignatureInput(decodedBytes);
output.setSecureValidation(secureValidation);
return output;
}
if (input.isByteArray() || input.isNodeSet()) {
byte[] bytes = XMLUtils.decode(input.getBytes());
os.write(bytes);
} else {
byte[] inputBytes = JavaUtils.getBytesFromStream(input.getOctetStreamReal());
byte[] bytes = XMLUtils.decode(inputBytes);
os.write(bytes);
}
XMLSignatureInput output = new XMLSignatureInput((byte[])null);
output.setSecureValidation(secureValidation);
output.setOutputStream(os);
return output;
}
throw new TransformationException("empty", new Object[] {"Unrecognized XMLSignatureInput state"});
}
private void traverseElement(Element node, StringBuilder sb) {
Node sibling = node.getFirstChild();
while (sibling != null) {
if (Node.ELEMENT_NODE == sibling.getNodeType()) {
traverseElement((Element)sibling, sb);
} else if (Node.TEXT_NODE == sibling.getNodeType()) {
sb.append(((Text)sibling).getData());
}
sibling = sibling.getNextSibling();
}
}
}
⏎ com/sun/org/apache/xml/internal/security/transforms/implementations/TransformBase64Decode.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, ≈47🔥, 0💬
Popular Posts:
JDK 17 jdk.charsets.jmod is the JMOD file for JDK 17 Charsets module. JDK 17 Charsets module compile...
Jackson is "the Java JSON library" or "the best JSON parser for Java". Or simply as "JSON for Java"....
JDK 1.1 source code directory contains Java source code for JDK 1.1 core classes: "C:\fyicenter\jdk-...
What Is commons-io-2.11.jar? commons-io-2.11.jar is the JAR file for Commons IO 2.5, which is a libr...
kernel.jar is a component in iText Java library to provide low-level functionalities. iText Java lib...