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

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

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

Authentication.getPassphrase介绍

[英]Gets the passphrase for the private key.
[中]获取私钥的密码短语。

代码示例

代码示例来源: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;
}

相关文章