本文整理了Java中org.xipki.util.Base64.decode()
方法的一些代码示例,展示了Base64.decode()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Base64.decode()
方法的具体详情如下:
包路径:org.xipki.util.Base64
类名称:Base64
方法名:decode
[英]Decodes a BASE64 encoded String
. All illegal characters will be ignored and can handle both strings with and without line separators.
Note! It can be up to about 2x the speed to call decode(str.toCharArray())
instead. That will create a temporary array though. This version will use str.charAt(i)
to iterate the string.
[中]解码BASE64编码的String
。所有非法字符都将被忽略,并且可以处理带或不带行分隔符的字符串。
笔记而打decode(str.toCharArray())
电话的速度可能高达2倍左右。这将创建一个临时数组。此版本将使用str.charAt(i)
迭代字符串。
代码示例来源:origin: org.xipki/ca-server
IssuerEntry(int id, String b64Cert) {
this.id = id;
this.cert = Base64.decode(b64Cert);
}
代码示例来源:origin: org.xipki/ca-server
CertBasedIdentityEntry(int id, String subject, String b64Sha1Fp, String b64Cert) {
this.id = id;
this.subject = subject;
this.sha1Fp = Base64.decode(Args.notBlank(b64Sha1Fp, "b64Sha1Fp"));
this.cert = Base64.decode(Args.notBlank(b64Cert, "b64Cert"));
}
代码示例来源:origin: org.xipki/ca-dbtool
protected FileOrBinaryType buildFileOrBase64Binary(String base64Content, String fileName)
throws IOException {
if (base64Content == null) {
return null;
}
return buildFileOrBinary(Base64.decode(base64Content), fileName);
}
代码示例来源:origin: org.xipki/ca-mgmt-client
protected FileOrBinary buildFileOrBase64Binary(String base64Content, String fileName)
throws IOException {
if (base64Content == null) {
return null;
}
return buildFileOrBinary(Base64.decode(base64Content), fileName);
}
代码示例来源:origin: org.xipki/ca-server
private static FileOrBinary createFileOrBase64Value(ZipOutputStream zipStream,
String b64Content, String fileName) throws IOException {
if (StringUtil.isBlank(b64Content)) {
return null;
}
return createFileOrBinary(zipStream, Base64.decode(b64Content), fileName);
}
代码示例来源:origin: org.xipki/ca-server
private X509Certificate generateCert(String b64Cert) throws CaMgmtException {
if (b64Cert == null) {
return null;
}
byte[] encodedCert = Base64.decode(b64Cert);
try {
return X509Util.parseCert(encodedCert);
} catch (CertificateException ex) {
throw new CaMgmtException(ex);
}
} // method generateCert
代码示例来源:origin: org.xipki/ca-server
private static byte[] getTransactionIdBytes(String tid) throws OperationException {
byte[] bytes = null;
final int n = tid.length();
if (n % 2 != 0) { // neither hex nor base64 encoded
bytes = tid.getBytes();
} else {
try {
bytes = Hex.decode(tid);
} catch (Exception ex) {
if (n % 4 == 0) {
try {
bytes = Base64.decode(tid);
} catch (Exception ex2) {
LOG.error("could not decode (hex or base64) '{}': {}", tid, ex2.getMessage());
}
}
}
}
if (bytes == null) {
bytes = tid.getBytes();
}
if (bytes.length > 20) {
throw new OperationException(ErrorCode.BAD_REQUEST, "transactionID too long");
}
return bytes;
} // method getTransactionIdBytes
代码示例来源:origin: org.xipki/security
return Base64.decode(base64Bytes);
return Base64.decode(bytes);
代码示例来源:origin: xipki/xipki
Args.notNull(passwordHint, "passwordHint");
byte[] bytes = Base64.decode(passwordHint.substring("PBE:".length()));
int len = bytes.length;
if (len <= 16 && len != 0) {
代码示例来源:origin: org.xipki/ca-dbtool
String certFilename = issuer.getCertFile();
String b64Cert = new String(IoUtil.read(new File(baseDir, certFilename)));
byte[] encodedCert = Base64.decode(b64Cert);
代码示例来源:origin: org.xipki/ca-mgmt-client
String certFilename = issuer.getCertFile();
String b64Cert = new String(IoUtil.read(new File(baseDir, certFilename)));
byte[] encodedCert = Base64.decode(b64Cert);
代码示例来源:origin: org.xipki.shell/ca-mgmt-shell
keystoreBytes = IoUtil.read(keystoreFile);
} else if (StringUtil.startsWithIgnoreCase(keystoreConf, "base64:")) {
keystoreBytes = Base64.decode(keystoreConf.substring("base64:".length()));
} else {
return signerConf;
代码示例来源:origin: org.xipki/ca-api
public SignerEntryWrapper(MgmtEntry.Signer signerEntry) {
this.name = signerEntry.getName();
this.type = signerEntry.getType();
this.conf = signerEntry.getConf();
this.faulty = signerEntry.isFaulty();
if (signerEntry.getBase64Cert() != null) {
this.encodedCert = Base64.decode(signerEntry.getBase64Cert());
}
}
代码示例来源:origin: org.xipki/ca-server
ksBytes = Base64.decode(keystoreConf.substring("base64:".length()));
} else {
return signerConf;
代码示例来源:origin: org.xipki/security
if (StringUtil.startsWithIgnoreCase(str, "base64:")) {
keystoreStream = new ByteArrayInputStream(
Base64.decode(str.substring("base64:".length())));
} else if (StringUtil.startsWithIgnoreCase(str, "file:")) {
String fn = str.substring("file:".length());
代码示例来源:origin: org.xipki/ca-server
Base64.decode(entry.getConf()), concat("files/requestor-", name, ".der"));
type.setBinaryConf(fob);
} else {
代码示例来源:origin: org.xipki/ca-server
encodedCert = Base64.decode(rs.getString("CERT"));
内容来源于网络,如有侵权,请联系作者删除!