org.sonatype.aether.repository.Authentication.getPrivateKeyFile()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(2.1k)|赞(0)|评价(0)|浏览(99)

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

Authentication.getPrivateKeyFile介绍

[英]Gets the path to the private key file to use for authentication.
[中]获取用于身份验证的私钥文件的路径。

代码示例

代码示例来源:origin: jcabi/jcabi-aether

/**
 * Creates a new authentication with the specified properties.
 * @param auth The authentication object.
 */
@SuppressWarnings("PMD.NullAssignment")
public RepositoryAuthentication(final Authentication auth) {
  this.username = auth.getUsername();
  if (auth.getPassword() == null) {
    this.password = null;
  } else {
    this.password = auth.getPassword().toCharArray();
  }
  this.privatekeyfile = auth.getPrivateKeyFile();
  if (auth.getPassphrase() == null) {
    this.passphrase = null;
  } else {
    this.passphrase = auth.getPassphrase().toCharArray();
  }
}

代码示例来源:origin: org.sonatype.aether/aether-impl

private void appendAuth( StringBuilder buffer, Authentication auth )
{
  if ( auth != null )
  {
    SimpleDigest digest = new SimpleDigest();
    digest.update( auth.getUsername() );
    digest.update( auth.getPassword() );
    digest.update( auth.getPrivateKeyFile() );
    digest.update( auth.getPassphrase() );
    buffer.append( digest.digest() ).append( '@' );
  }
}

代码示例来源:origin: sonatype/sonatype-aether

private void appendAuth( StringBuilder buffer, Authentication auth )
{
  if ( auth != null )
  {
    SimpleDigest digest = new SimpleDigest();
    digest.update( auth.getUsername() );
    digest.update( auth.getPassword() );
    digest.update( auth.getPrivateKeyFile() );
    digest.update( auth.getPassphrase() );
    buffer.append( digest.digest() ).append( '@' );
  }
}

代码示例来源:origin: sonatype/sonatype-aether

private AuthenticationInfo getAuthenticationInfo( RemoteRepository repository )
{
  AuthenticationInfo auth = null;
  Authentication a = repository.getAuthentication();
  if ( a != null )
  {
    auth = new AuthenticationInfo();
    auth.setUserName( a.getUsername() );
    auth.setPassword( a.getPassword() );
    auth.setPrivateKey( a.getPrivateKeyFile() );
    auth.setPassphrase( a.getPassphrase() );
  }
  return auth;
}

相关文章