Java 是否强制SVNKit库使用当前登录用户的公钥?
在bash上,我可以运行Java 是否强制SVNKit库使用当前登录用户的公钥?,java,bash,svn,Java,Bash,Svn,在bash上,我可以运行svn add myfile或svn commit myfile,因为我用户的公钥位于svn用户的授权密钥文件中(在svn+ssh://svn-user@svn服务器上的ch/app/svn/repo/test/jars/appssvn user将是用户) 是否可以告诉SVNKit以某种方式对上述配置进行身份验证?因为无论我尝试什么,都会失败 下面是我最后一次尝试 SVNSSHAuthentication auth = new SVNSSHAuthentication("
svn add myfile
或svn commit myfile
,因为我用户的公钥位于svn用户的授权密钥
文件中(在svn+ssh://svn-user@svn服务器上的ch/app/svn/repo/test/jars/apps
svn user
将是用户)
是否可以告诉SVNKit以某种方式对上述配置进行身份验证?因为无论我尝试什么,都会失败
下面是我最后一次尝试
SVNSSHAuthentication auth = new SVNSSHAuthentication("myuser",
new File("/opt/home/myuser/.ssh/id_rsa"), null, 22, true, null, false);
log.debug("private key -> " + auth.getPrivateKeyFile().getAbsolutePath());
BasicAuthenticationManager authMgr = new BasicAuthenticationManager(
new SVNAuthentication[] { auth });
clientManager = SVNClientManager.newInstance();
clientManager.setAuthenticationManager(authMgr);
clientManager.getCommitClient()
.doCommit(new File[] { file }, false, message, null, null,
false, false, SVNDepth.INFINITY);
我得到以下例外情况
org.tmatesoft.svn.core.SVNAuthenticationException: svn: E170001:
Commit failed (details follow):
svn: E170001: Authentication required for 'svn-user@svn+ssh://svn-server.ch'
我该如何正确地做呢?我没有密码,在Linux命令行上使用公钥,希望在java中使用相同的方式。如果可能的话,我也希望避免提供SVNUrl。向下投票人您介意评论向下投票吗?您需要通过私钥。向下投票人您介意评论向下投票吗?您需要通过私钥。向下投票人您介意评论向下投票吗?您需要通过私钥。