@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); }
public Negotiate(String hdr) { super(Type.NEGOTIATE); prevToken = Base64.decode(hdr); }
/** * 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); } }
AlgorithmParameters params = AlgorithmParameters .getInstance(paramsAlgo); params.init(Base64.decode(cont)); decryptCipher.init(Cipher.DECRYPT_MODE, secretKey, params);
public Negotiate(String hdr) { super(Type.NEGOTIATE); prevToken = Base64.decode(hdr); }
public Negotiate(String hdr) { super(Type.NEGOTIATE); prevToken = Base64.decode(hdr); }
/** * 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); } }
/** * 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); } }
@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]); }
@Override protected byte[] extractToken(AuthenticationChallenge input) throws Exception { String received = input.getToken(); if (received == null) { return new byte[0]; } return Base64.decode(received); }
@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)); }
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; } });
final String raw = new String(Base64.decode(authorization.substring(AUTH_BASIC.length()).trim()), StandardCharsets.UTF_8); final int separator = raw.indexOf(':'); if (separator > 0) {
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; } });
AlgorithmParameters params = AlgorithmParameters .getInstance(paramsAlgo); params.init(Base64.decode(cont)); decryptCipher.init(Cipher.DECRYPT_MODE, secretKey, params);
AlgorithmParameters params = AlgorithmParameters .getInstance(paramsAlgo); params.init(Base64.decode(cont)); decryptCipher.init(Cipher.DECRYPT_MODE, secretKey, params);
if (lower.startsWith(basicPrefix)) { String base64Credentials = authorization.substring(basicPrefix.length()).trim(); String credentials = new String(Base64.decode(base64Credentials), Charset.forName("UTF-8"));