org.apache.xerces.impl.dv.util.Base64.decode()方法的使用及代码示例

x33g5p2x  于2022-01-17 转载在 其他  
字(5.9k)|赞(0)|评价(0)|浏览(153)

本文整理了Java中org.apache.xerces.impl.dv.util.Base64.decode()方法的一些代码示例,展示了Base64.decode()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Base64.decode()方法的具体详情如下:
包路径:org.apache.xerces.impl.dv.util.Base64
类名称:Base64
方法名:decode

Base64.decode介绍

[英]Decodes Base64 data into octects
[中]将Base64数据解码为八位字节

代码示例

代码示例来源:origin: com.rackspace.eclipse.webtools.sourceediting/org.eclipse.wst.xml.xpath2.processor

public Object getNativeValue() {
    return Base64.decode(_value);
  }
}

代码示例来源:origin: org.opengis.cite.teamengine/teamengine-core

@Override
public void connect() throws IOException {
  in = new ByteArrayInputStream(Base64.decode(data));
}

代码示例来源:origin: deegree/deegree3

@Override
public void connect()
            throws IOException {
  in = new ByteArrayInputStream( Base64.decode( data ) );
}

代码示例来源:origin: opengeospatial/teamengine

@Override
public void connect() throws IOException {
  in = new ByteArrayInputStream(Base64.decode(data));
}

代码示例来源:origin: com.rackspace.eclipse.webtools.sourceediting/org.eclipse.wst.xml.xpath2.processor

String valToCompare = arg.getStringValue();
byte[] value1 = Base64.decode(_value);
byte[] value2 = Base64.decode(valToCompare);
if (value2 == null) {
 return false;

代码示例来源:origin: org.apache.odftoolkit/odfdom-java

/**
 * Returns a Base64Binary instance representing the specified String value
 *
 * @param stringValue
 *            a String value
 * @return return a Base64Binary instance representing stringValue
 * @throws NumberFormatException If the parameter is not a valid Base64Binary.
 */
public static Base64Binary valueOf(String stringValue)
    throws NumberFormatException {
  if (stringValue == null) {
    throw new NumberFormatException(
        "parameter can not be null for Base64Binary");
  }
  return new Base64Binary(Base64.decode(stringValue));
}

代码示例来源:origin: org.odftoolkit/odfdom-java

/**
 * Returns a Base64Binary instance representing the specified String value
 *
 * @param stringValue
 *            a String value
 * @return return a Base64Binary instance representing stringValue
 * @throws NumberFormatException If the parameter is not a valid Base64Binary.
 */
public static Base64Binary valueOf(String stringValue)
    throws NumberFormatException {
  if (stringValue == null) {
    throw new NumberFormatException(
        "parameter can not be null for Base64Binary");
  }
  return new Base64Binary(Base64.decode(stringValue));
}

代码示例来源:origin: IQSS/dataverse

public static String decrypt(String value, String password ) {
  String base64 = value.replaceAll("\\.", "+")
        .replaceAll("-", "=")
        .replaceAll("_", "/");
  
  byte[] baseBytes = Base64.decode(base64);
  try {
    Cipher aes = Cipher.getInstance("AES");
    aes.init( Cipher.DECRYPT_MODE, generateKeyFromString(password));
    byte[] decrypted = aes.doFinal(baseBytes);
    return new String(decrypted);
    
  } catch ( InvalidKeyException | NoSuchAlgorithmException | BadPaddingException
       | IllegalBlockSizeException | NoSuchPaddingException | UnsupportedEncodingException ex) {
    Logger.getLogger(OAuth2LoginBackingBean.class.getName()).log(Level.SEVERE, null, ex);
    throw new RuntimeException(ex);
  }
}

代码示例来源:origin: apache/odftoolkit

/**
 * Returns a Base64Binary instance representing the specified String value
 *
 * @param stringValue
 *            a String value
 * @return return a Base64Binary instance representing stringValue
 * @throws NumberFormatException If the parameter is not a valid Base64Binary.
 */
public static Base64Binary valueOf(String stringValue)
    throws NumberFormatException {
  if (stringValue == null) {
    throw new NumberFormatException(
        "parameter can not be null for Base64Binary");
  }
  return new Base64Binary(Base64.decode(stringValue));
}

代码示例来源:origin: com.rackspace.apache/xerces2-xsd11

public Object getActualValue(String content, ValidationContext context) throws InvalidDatatypeValueException {
  byte[] decoded = Base64.decode(content);
  if (decoded == null)
    throw new InvalidDatatypeValueException("cvc-datatype-valid.1.2.1", new Object[]{content, "base64Binary"});
  return new XBase64(decoded);
}

代码示例来源:origin: CorfuDB/CorfuDB

private X509Certificate getCertificate(String certFile) throws Exception {
    String clientCert = (new String(Files.readAllBytes(Paths.get(certFile)))).trim();
    byte [] decoded = Base64.decode(clientCert);
    CertificateFactory cf = CertificateFactory.getInstance("X.509");
    return (X509Certificate)cf.generateCertificate(new ByteArrayInputStream(decoded));
  }
}

代码示例来源:origin: org.kie.workbench/kie-wb-common-cli-forms-migration

public void loadFromXMLNode(Node node) {
  objectName = node.getNodeName();
  NamedNodeMap attributesMap = node.getAttributes();
  if (attributesMap != null) {
    for (int i = 0; i < attributesMap.getLength(); i++) {
      Node attribute = attributesMap.item(i);
      addAttribute(attribute.getNodeName(), StringEscapeUtils.unescapeXml(attribute.getNodeValue()));
    }
  }
  NodeList children = node.getChildNodes();
  for (int i = 0; i < children.getLength(); i++) {
    Node child = children.item(i);
    if (child.getNodeName().equals("#text")) {
      String content = child.getNodeValue();
      if (content != null && content.trim().length() > 0) {
        setContent(Base64.decode(child.getNodeValue().trim()));
      }
    } else {
      XMLNode childNode = new XMLNode("?", this);
      childNode.loadFromXMLNode(child);
      addChild(childNode);
    }
  }
}

代码示例来源:origin: apache/felix

return Boolean.FALSE;					
} else if (upnpType.equals("bin.base64")) {
  return Base64.decode(value);
} else if (upnpType.equals("bin.hex")) {
  return HexBin.decode(value);

代码示例来源:origin: org.apache.felix/org.apache.felix.upnp.basedriver

return Boolean.FALSE;					
} else if (upnpType.equals("bin.base64")) {
  return Base64.decode(value);
} else if (upnpType.equals("bin.hex")) {
  return HexBin.decode(value);

代码示例来源:origin: com.rackspace.eclipse.webtools.sourceediting/org.eclipse.wst.xml.xpath2.processor

byte[] decodedValue = Base64.decode(str_value);

代码示例来源:origin: com.rackspace.eclipse.webtools.sourceediting/org.eclipse.wst.xml.xpath2.processor

decodedValue = Base64.decode(str_value);
  decodedValue = HexBin.encode(decodedValue).getBytes();
} else {

代码示例来源:origin: org.apache.clerezza.ext/org.apache.jena.jena-core

switch (validatedInfo.actualValueType) {
  case XSConstants.BASE64BINARY_DT:
    byte[] decoded = Base64.decode(validatedInfo.normalizedValue);
    return (decoded);

代码示例来源:origin: org.sakaiproject/sakai-rwiki-impl

try
  content.append(new String(Base64.decode(cdnode.getData()),
      "UTF-8"));

相关文章

微信公众号

最新文章

更多