本文整理了Java中org.wildfly.security.x500.util.X500PrincipalUtil.containsAllAttributes()
方法的一些代码示例,展示了X500PrincipalUtil.containsAllAttributes()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。X500PrincipalUtil.containsAllAttributes()
方法的具体详情如下:
包路径:org.wildfly.security.x500.util.X500PrincipalUtil
类名称:X500PrincipalUtil
方法名:containsAllAttributes
[英]Determine if the given principal contains all of the attributes specified by the given OIDs. This includes occurrences within multi-valued RDNs.
[中]确定给定主体是否包含给定OID指定的所有属性。这包括多值RDN中的事件。
代码示例来源:origin: wildfly/wildfly
public String getName(final Principal principal) {
final X500Principal x500Principal = X500PrincipalUtil.asX500Principal(principal, convert);
if (x500Principal == null) {
return null;
}
if (requiredOids != null && requiredOids.length != 0 && ! X500PrincipalUtil.containsAllAttributes(x500Principal, requiredOids)) {
ElytronMessages.log.tracef("X500 principal [%s] was not decoded - does not contain required oids", x500Principal);
return null;
}
final String[] values = X500PrincipalUtil.getAttributeValues(x500Principal, oid, reverse);
if (values.length == 0) {
ElytronMessages.log.tracef("X500 principal [%s] was not decoded - no values of attribute [%s]", x500Principal, oid);
return null;
} else {
final String name = Arrays.stream(values).skip(startSegment).limit(maximumSegments).collect(Collectors.joining(joiner));
if (ElytronMessages.log.isTraceEnabled()) {
ElytronMessages.log.tracef("X500 principal [%s] decoded as name [%s] (attribute values: [%s])", x500Principal, name, String.join(", ", values));
}
return name;
}
}
}
代码示例来源:origin: org.jboss.eap/wildfly-client-all
public String getName(final Principal principal) {
final X500Principal x500Principal = X500PrincipalUtil.asX500Principal(principal, convert);
if (x500Principal == null) {
return null;
}
if (requiredOids != null && requiredOids.length != 0 && ! X500PrincipalUtil.containsAllAttributes(x500Principal, requiredOids)) {
ElytronMessages.log.tracef("X500 principal [%s] was not decoded - does not contain required oids", x500Principal);
return null;
}
final String[] values = X500PrincipalUtil.getAttributeValues(x500Principal, oid, reverse);
if (values.length == 0) {
ElytronMessages.log.tracef("X500 principal [%s] was not decoded - no values of attribute [%s]", x500Principal, oid);
return null;
} else {
final String name = Arrays.stream(values).skip(startSegment).limit(maximumSegments).collect(Collectors.joining(joiner));
if (ElytronMessages.log.isTraceEnabled()) {
ElytronMessages.log.tracef("X500 principal [%s] decoded as name [%s] (attribute values: [%s])", x500Principal, name, String.join(", ", values));
}
return name;
}
}
}
代码示例来源:origin: org.wildfly.security/wildfly-elytron
public String getName(final Principal principal) {
final X500Principal x500Principal = X500PrincipalUtil.asX500Principal(principal, convert);
if (x500Principal == null) {
return null;
}
if (requiredOids != null && requiredOids.length != 0 && ! X500PrincipalUtil.containsAllAttributes(x500Principal, requiredOids)) {
ElytronMessages.log.tracef("X500 principal [%s] was not decoded - does not contain required oids", x500Principal);
return null;
}
final String[] values = X500PrincipalUtil.getAttributeValues(x500Principal, oid, reverse);
if (values.length == 0) {
ElytronMessages.log.tracef("X500 principal [%s] was not decoded - no values of attribute [%s]", x500Principal, oid);
return null;
} else {
final String name = Arrays.stream(values).skip(startSegment).limit(maximumSegments).collect(Collectors.joining(joiner));
if (ElytronMessages.log.isTraceEnabled()) {
ElytronMessages.log.tracef("X500 principal [%s] decoded as name [%s] (attribute values: [%s])", x500Principal, name, String.join(", ", values));
}
return name;
}
}
}
代码示例来源:origin: org.wildfly.security/wildfly-elytron-x500-deprecated
public String getName(final Principal principal) {
final X500Principal x500Principal = X500PrincipalUtil.asX500Principal(principal, convert);
if (x500Principal == null) {
return null;
}
if (requiredOids != null && requiredOids.length != 0 && ! X500PrincipalUtil.containsAllAttributes(x500Principal, requiredOids)) {
ElytronMessages.log.tracef("X500 principal [%s] was not decoded - does not contain required oids", x500Principal);
return null;
}
final String[] values = X500PrincipalUtil.getAttributeValues(x500Principal, oid, reverse);
if (values.length == 0) {
ElytronMessages.log.tracef("X500 principal [%s] was not decoded - no values of attribute [%s]", x500Principal, oid);
return null;
} else {
final String name = Arrays.stream(values).skip(startSegment).limit(maximumSegments).collect(Collectors.joining(joiner));
if (ElytronMessages.log.isTraceEnabled()) {
ElytronMessages.log.tracef("X500 principal [%s] decoded as name [%s] (attribute values: [%s])", x500Principal, name, String.join(", ", values));
}
return name;
}
}
}
代码示例来源:origin: org.wildfly.security/wildfly-elytron-x500-principal
public String getName(final Principal principal) {
final X500Principal x500Principal = X500PrincipalUtil.asX500Principal(principal, convert);
if (x500Principal == null) {
return null;
}
if (requiredOids != null && requiredOids.length != 0 && ! X500PrincipalUtil.containsAllAttributes(x500Principal, requiredOids)) {
ElytronMessages.log.tracef("X500 principal [%s] was not decoded - does not contain required oids", x500Principal);
return null;
}
final String[] values = X500PrincipalUtil.getAttributeValues(x500Principal, oid, reverse);
if (values.length == 0) {
ElytronMessages.log.tracef("X500 principal [%s] was not decoded - no values of attribute [%s]", x500Principal, oid);
return null;
} else {
final String name = Arrays.stream(values).skip(startSegment).limit(maximumSegments).collect(Collectors.joining(joiner));
if (ElytronMessages.log.isTraceEnabled()) {
ElytronMessages.log.tracef("X500 principal [%s] decoded as name [%s] (attribute values: [%s])", x500Principal, name, String.join(", ", values));
}
return name;
}
}
}
内容来源于网络,如有侵权,请联系作者删除!