sun.security.x509.X500Name.getCommonName()方法的使用及代码示例

x33g5p2x  于2022-02-03 转载在 其他  
字(1.7k)|赞(0)|评价(0)|浏览(161)

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

X500Name.getCommonName介绍

暂无

代码示例

代码示例来源:origin: at.researchstudio.sat/won-core

@Override
 public String generateAlias(final X509Certificate certificate) throws CertificateException {
  String alias = null;
  try {
   X500Name dnName = new X500Name(certificate.getSubjectDN().getName());
   alias = dnName.getCommonName();
  } catch (IOException e) {
   throw new CertificateException("SubjectDN problem - cannot generate alias", e);
  }
  if (alias == null || alias.isEmpty()) {
   throw new CertificateException("CN is null - cannot accept as alias");
  }
  return alias;
 }
}

代码示例来源:origin: edu.uiuc.ncsa.security/ncsa-security-util

@Override
public String getCN() {
  if (pkcs10 == null) {
    return null;
  }
  try {
    return pkcs10.getSubjectName().getCommonName();
  } catch (IOException e) {
    throw new GeneralException("Could not get common name", e);
  }
}

代码示例来源:origin: org.glassfish.security/security

String _username = name.getCommonName();
if (_username == null && userDN != null && userDN.startsWith("uid")) {

代码示例来源:origin: com.intrbiz.bergamot/bergamot-crypto-util

@SuppressWarnings("restriction")
public NameInfo(sun.security.x509.X500Name name) throws IOException
{
  this.commonName = name.getCommonName();
  this.organisation = name.getOrganization();
  this.organisationUnit = name.getOrganizationalUnit();
  this.locality = name.getLocality();
  this.state = name.getState();
  this.country = name.getCountry();
}

代码示例来源:origin: org.glassfish.main.security/security

try {
  X500Name name = new X500Name(userDN);
  _username = name.getCommonName();
} catch (IOException e) {

相关文章