本文整理了Java中org.eclipse.jgit.util.Base64.decode()
方法的一些代码示例,展示了Base64.decode()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Base64.decode()
方法的具体详情如下:
包路径:org.eclipse.jgit.util.Base64
类名称:Base64
方法名:decode
[英]Decodes data from Base64 notation.
[中]从Base64符号解码数据。
代码示例来源:origin: spring-cloud/spring-cloud-config
@Override
protected Session createSession(Host hc, String user, String host, int port, FS fs) throws JSchException {
if (sshKeysByHostname.containsKey(host)) {
JGitEnvironmentProperties sshUriProperties = sshKeysByHostname.get(host);
jSch.addIdentity(host, sshUriProperties.getPrivateKey().getBytes(), null, null);
if (sshUriProperties.getKnownHostsFile() != null) {
jSch.setKnownHosts(sshUriProperties.getKnownHostsFile());
}
if (sshUriProperties.getHostKey() != null) {
HostKey hostkey = new HostKey(host, Base64.decode(sshUriProperties.getHostKey()));
jSch.getHostKeyRepository().add(hostkey, null);
}
return jSch.getSession(user, host, port);
}
throw new JSchException("no keys configured for hostname " + host);
}
代码示例来源:origin: org.eclipse.jgit/org.eclipse.jgit
public Negotiate(String hdr) {
super(Type.NEGOTIATE);
prevToken = Base64.decode(hdr);
}
代码示例来源:origin: org.eclipse.jgit/org.eclipse.jgit
/**
* Decodes data from Base64 notation.
*
* @param s
* the string to decode
* @return the decoded data
*/
public static byte[] decode(String s) {
byte[] bytes = s.getBytes(UTF_8);
return decode(bytes, 0, bytes.length);
}
}
代码示例来源:origin: org.eclipse.jgit/org.eclipse.jgit
AlgorithmParameters params = AlgorithmParameters
.getInstance(paramsAlgo);
params.init(Base64.decode(cont));
decryptCipher.init(Cipher.DECRYPT_MODE, secretKey, params);
代码示例来源:origin: berlam/github-bucket
public Negotiate(String hdr) {
super(Type.NEGOTIATE);
prevToken = Base64.decode(hdr);
}
代码示例来源:origin: sonia.jgit/org.eclipse.jgit
public Negotiate(String hdr) {
super(Type.NEGOTIATE);
prevToken = Base64.decode(hdr);
}
代码示例来源:origin: berlam/github-bucket
/**
* Decodes data from Base64 notation.
*
* @param s
* the string to decode
* @return the decoded data
*/
public static byte[] decode(String s) {
byte[] bytes = s.getBytes(UTF_8);
return decode(bytes, 0, bytes.length);
}
}
代码示例来源:origin: sonia.jgit/org.eclipse.jgit
/**
* Decodes data from Base64 notation.
*
* @param s
* the string to decode
* @return the decoded data
*/
public static byte[] decode(String s) {
byte[] bytes;
try {
bytes = s.getBytes(UTF_8);
} catch (UnsupportedEncodingException uee) {
bytes = s.getBytes();
}
return decode(bytes, 0, bytes.length);
}
}
代码示例来源:origin: bozaro/git-as-svn
@NotNull
private static byte[] parseDERFromPEM(@NotNull byte[] pem, @NotNull String beginDelimiter, @NotNull String endDelimiter) throws GeneralSecurityException {
final String data = new String(pem, StandardCharsets.ISO_8859_1);
String[] tokens = data.split(beginDelimiter);
if (tokens.length != 2) {
throw new GeneralSecurityException("Invalid PEM certificate data. Delimiter not found: " + beginDelimiter);
}
tokens = tokens[1].split(endDelimiter);
if (tokens.length != 2) {
throw new GeneralSecurityException("Invalid PEM certificate data. Delimiter not found: " + endDelimiter);
}
return Base64.decode(tokens[0]);
}
代码示例来源:origin: org.eclipse.jgit/org.eclipse.jgit.ssh.apache
@Override
protected byte[] extractToken(AuthenticationChallenge input)
throws Exception {
String received = input.getToken();
if (received == null) {
return new byte[0];
}
return Base64.decode(received);
}
代码示例来源:origin: io.hawt/hawtio-git
@Override
public CommitInfo writeBase64(String branch, String path, String commitMessage, String authorName, String authorEmail, String contentsBase64) {
return write(branch, path, commitMessage, authorName, authorEmail, Base64.decode(contentsBase64));
}
代码示例来源:origin: io.fabric8/fabric-git-hawtio
public CommitInfo call(Git git, GitContext context) throws Exception {
checkoutBranch(git, branch);
File rootDir = getRootGitDirectory(git);
byte[] data = Base64.decode(contents);
CommitInfo answer = doWrite(git, rootDir, branch, path, data, personIdent, commitMessage);
context.commitMessage(commitMessage);
return answer;
}
});
代码示例来源:origin: bozaro/git-as-svn
final String raw = new String(Base64.decode(authorization.substring(AUTH_BASIC.length()).trim()), StandardCharsets.UTF_8);
final int separator = raw.indexOf(':');
if (separator > 0) {
代码示例来源:origin: jboss-fuse/fabric8
public CommitInfo call(Git git, GitContext context) throws Exception {
checkoutBranch(git, branch);
File rootDir = getRootGitDirectory(git);
byte[] data = Base64.decode(contents);
CommitInfo answer = doWrite(git, rootDir, branch, path, data, personIdent, commitMessage);
context.commitMessage(commitMessage);
return answer;
}
});
代码示例来源:origin: sonia.jgit/org.eclipse.jgit
AlgorithmParameters params = AlgorithmParameters
.getInstance(paramsAlgo);
params.init(Base64.decode(cont));
decryptCipher.init(Cipher.DECRYPT_MODE, secretKey, params);
代码示例来源:origin: berlam/github-bucket
AlgorithmParameters params = AlgorithmParameters
.getInstance(paramsAlgo);
params.init(Base64.decode(cont));
decryptCipher.init(Cipher.DECRYPT_MODE, secretKey, params);
代码示例来源:origin: io.fabric8.forge/fabric8-forge-core
if (lower.startsWith(basicPrefix)) {
String base64Credentials = authorization.substring(basicPrefix.length()).trim();
String credentials = new String(Base64.decode(base64Credentials),
Charset.forName("UTF-8"));
内容来源于网络,如有侵权,请联系作者删除!