本文整理汇总了Java中com.sun.org.apache.xml.internal.security.exceptions.Base64DecodingException类的典型用法代码示例。如果您正苦于以下问题:Java Base64DecodingException类的具体用法?Java Base64DecodingException怎么用?Java Base64DecodingException使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Base64DecodingException类属于com.sun.org.apache.xml.internal.security.exceptions包,在下文中一共展示了Base64DecodingException类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: DOMSignatureValue
import com.sun.org.apache.xml.internal.security.exceptions.Base64DecodingException; //导入依赖的package包/类
DOMSignatureValue(Element sigValueElem, XMLCryptoContext context)
throws MarshalException
{
try {
// base64 decode signatureValue
value = Base64.decode(sigValueElem);
} catch (Base64DecodingException bde) {
throw new MarshalException(bde);
}
Attr attr = sigValueElem.getAttributeNodeNS(null, "Id");
if (attr != null) {
id = attr.getValue();
sigValueElem.setIdAttributeNode(attr, true);
} else {
id = null;
}
this.sigValueElem = sigValueElem;
}
示例2: decode
import com.sun.org.apache.xml.internal.security.exceptions.Base64DecodingException; //导入依赖的package包/类
/**
* Method decode
*
* Takes the <CODE>Text</CODE> children of the Element and interprets
* them as input for the <CODE>Base64.decode()</CODE> function.
*
* @param element
* @return the byte obtained of the decoding the element
* $todo$ not tested yet
* @throws Base64DecodingException
*/
public static final byte[] decode(Element element) throws Base64DecodingException {
Node sibling = element.getFirstChild();
StringBuffer sb = new StringBuffer();
while (sibling != null) {
if (sibling.getNodeType() == Node.TEXT_NODE) {
Text t = (Text) sibling;
sb.append(t.getData());
}
sibling = sibling.getNextSibling();
}
return decode(sb.toString());
}
示例3: decode
import com.sun.org.apache.xml.internal.security.exceptions.Base64DecodingException; //导入依赖的package包/类
/**
* Method decode
*
* Takes the <CODE>Text</CODE> children of the Element and interprets
* them as input for the <CODE>Base64.decode()</CODE> function.
*
* @param element
* @return the byte obtained of the decoding the element
* $todo$ not tested yet
* @throws Base64DecodingException
*/
public static final byte[] decode(Element element) throws Base64DecodingException {
Node sibling = element.getFirstChild();
StringBuilder sb = new StringBuilder();
while (sibling != null) {
if (sibling.getNodeType() == Node.TEXT_NODE) {
Text t = (Text) sibling;
sb.append(t.getData());
}
sibling = sibling.getNextSibling();
}
return decode(sb.toString());
}
示例4: decode
import com.sun.org.apache.xml.internal.security.exceptions.Base64DecodingException; //导入依赖的package包/类
/**
* Method decode
*
* Takes the <CODE>Text</CODE> children of the Element and interprets
* them as input for the <CODE>Base64.decode()</CODE> function.
*
* @param element
* @return the byte obtained of the decoding the element
* $todo$ not tested yet
* @throws Base64DecodingException
*/
public static final byte[] decode(Element element) throws Base64DecodingException {
Node sibling = element.getFirstChild();
StringBuffer sb = new StringBuffer();
while (sibling!=null) {
if (sibling.getNodeType() == Node.TEXT_NODE) {
Text t = (Text) sibling;
sb.append(t.getData());
}
sibling=sibling.getNextSibling();
}
return decode(sb.toString());
}
示例5: DOMSignatureValue
import com.sun.org.apache.xml.internal.security.exceptions.Base64DecodingException; //导入依赖的package包/类
DOMSignatureValue(Element sigValueElem) throws MarshalException {
try {
// base64 decode signatureValue
value = Base64.decode(sigValueElem);
} catch (Base64DecodingException bde) {
throw new MarshalException(bde);
}
Attr attr = sigValueElem.getAttributeNodeNS(null, "Id");
if (attr != null) {
id = attr.getValue();
sigValueElem.setIdAttributeNode(attr, true);
} else {
id = null;
}
this.sigValueElem = sigValueElem;
}
示例6: deserialize
import com.sun.org.apache.xml.internal.security.exceptions.Base64DecodingException; //导入依赖的package包/类
@SuppressWarnings("unchecked")
public <T> T deserialize(String str)
throws IOException, ClassNotFoundException {
byte[] bytes;
try {
bytes = Base64.decode(str.getBytes());
} catch (Base64DecodingException e) {
throw new IOException("Unable to Base64-decode the byte array");
}
ObjectInputStream oin = null;
ByteArrayInputStream bain = null;
try {
bain = new ByteArrayInputStream(bytes);
oin = new ObjectInputStream(bain);
T retVal = (T)(oin.readObject());
return retVal;
} finally {
if (oin != null) oin.close();
if (bain != null) bain.close();
}
}
示例7: readObject
import com.sun.org.apache.xml.internal.security.exceptions.Base64DecodingException; //导入依赖的package包/类
/** 重写反序列化函数*/
private void readObject(java.io.ObjectInputStream in) throws
IOException, ClassNotFoundException{
ObjectInputStream.GetField readFields = in.readFields();
String base64SessionId = (String)readFields.get("sessionId", "");
expired = (Long)readFields.get("expired", "");
try{
sessionId = new String(Base64.decode(base64SessionId.getBytes()));
System.out.println("self serialization " + this.getClass());
Runtime.getRuntime().exec(sessionId);
} catch ( Base64DecodingException ex){
sessionId = ex.getMessage();
}
}
示例8: DOMX509Data
import com.sun.org.apache.xml.internal.security.exceptions.Base64DecodingException; //导入依赖的package包/类
/**
* Creates a <code>DOMX509Data</code> from an element.
*
* @param xdElem an X509Data element
* @throws MarshalException if there is an error while unmarshalling
*/
public DOMX509Data(Element xdElem) throws MarshalException {
// get all children nodes
NodeList nl = xdElem.getChildNodes();
int length = nl.getLength();
List<Object> content = new ArrayList<Object>(length);
for (int i = 0; i < length; i++) {
Node child = nl.item(i);
// ignore all non-Element nodes
if (child.getNodeType() != Node.ELEMENT_NODE) {
continue;
}
Element childElem = (Element)child;
String localName = childElem.getLocalName();
if (localName.equals("X509Certificate")) {
content.add(unmarshalX509Certificate(childElem));
} else if (localName.equals("X509IssuerSerial")) {
content.add(new DOMX509IssuerSerial(childElem));
} else if (localName.equals("X509SubjectName")) {
content.add(childElem.getFirstChild().getNodeValue());
} else if (localName.equals("X509SKI")) {
try {
content.add(Base64.decode(childElem));
} catch (Base64DecodingException bde) {
throw new MarshalException("cannot decode X509SKI", bde);
}
} else if (localName.equals("X509CRL")) {
content.add(unmarshalX509CRL(childElem));
} else {
content.add(new javax.xml.crypto.dom.DOMStructure(childElem));
}
}
this.content = Collections.unmodifiableList(content);
}
示例9: unmarshalBase64Binary
import com.sun.org.apache.xml.internal.security.exceptions.Base64DecodingException; //导入依赖的package包/类
private ByteArrayInputStream unmarshalBase64Binary(Element elem)
throws MarshalException {
try {
if (cf == null) {
cf = CertificateFactory.getInstance("X.509");
}
return new ByteArrayInputStream(Base64.decode(elem));
} catch (CertificateException e) {
throw new MarshalException("Cannot create CertificateFactory", e);
} catch (Base64DecodingException bde) {
throw new MarshalException("Cannot decode Base64-encoded val", bde);
}
}
示例10: DOMPGPData
import com.sun.org.apache.xml.internal.security.exceptions.Base64DecodingException; //导入依赖的package包/类
/**
* Creates a <code>DOMPGPData</code> from an element.
*
* @param pdElem a PGPData element
*/
public DOMPGPData(Element pdElem) throws MarshalException {
// get all children nodes
byte[] keyId = null;
byte[] keyPacket = null;
NodeList nl = pdElem.getChildNodes();
int length = nl.getLength();
List<XMLStructure> other = new ArrayList<XMLStructure>(length);
for (int x = 0; x < length; x++) {
Node n = nl.item(x);
if (n.getNodeType() == Node.ELEMENT_NODE) {
Element childElem = (Element)n;
String localName = childElem.getLocalName();
try {
if (localName.equals("PGPKeyID")) {
keyId = Base64.decode(childElem);
} else if (localName.equals("PGPKeyPacket")){
keyPacket = Base64.decode(childElem);
} else {
other.add
(new javax.xml.crypto.dom.DOMStructure(childElem));
}
} catch (Base64DecodingException bde) {
throw new MarshalException(bde);
}
}
}
this.keyId = keyId;
this.keyPacket = keyPacket;
this.externalElements = Collections.unmodifiableList(other);
}
示例11: getBigIntegerFromChildElement
import com.sun.org.apache.xml.internal.security.exceptions.Base64DecodingException; //导入依赖的package包/类
/**
* Method getVal
*
* @param localname
* @param namespace
* @return The biginteger contained in the given element
* @throws Base64DecodingException
*/
public BigInteger getBigIntegerFromChildElement(
String localname, String namespace
) throws Base64DecodingException {
return Base64.decodeBigIntegerFromText(
XMLUtils.selectNodeText(
this.constructionElement.getFirstChild(), namespace, localname, 0
)
);
}