本文整理了Java中sun.security.x509.X500Name.getCommonName()
方法的一些代码示例,展示了X500Name.getCommonName()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。X500Name.getCommonName()
方法的具体详情如下:
包路径:sun.security.x509.X500Name
类名称: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) {
内容来源于网络,如有侵权,请联系作者删除!