Package org.wildfly.security.x500
Class X500PrincipalBuilder
java.lang.Object
org.wildfly.security.x500.X500PrincipalBuilder
A builder for X.500 principals, defined in RFC 5280 as:
Name ::= CHOICE { -- only one possibility for now --
rdnSequence RDNSequence }
RDNSequence ::= SEQUENCE OF RelativeDistinguishedName
RelativeDistinguishedName ::=
SET SIZE (1..MAX) OF AttributeTypeAndValue
AttributeTypeAndValue ::= SEQUENCE {
type AttributeType,
value AttributeValue }
AttributeType ::= OBJECT IDENTIFIER
AttributeValue ::= ANY -- DEFINED BY AttributeType
DirectoryString ::= CHOICE {
teletexString TeletexString (SIZE (1..MAX)),
printableString PrintableString (SIZE (1..MAX)),
universalString UniversalString (SIZE (1..MAX)),
utf8String UTF8String (SIZE (1..MAX)),
bmpString BMPString (SIZE (1..MAX)) }
- Author:
- David M. Lloyd
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddCompoundItem(Collection<X500AttributeTypeAndValue> attributeTypeAndValues) Add a compound item to the builder.addItem(X500AttributeTypeAndValue attributeTypeAndValue) Add a single item to the builder.build()Build the principal.
-
Constructor Details
-
X500PrincipalBuilder
public X500PrincipalBuilder()Construct a new instance.
-
-
Method Details
-
addItem
Add a single item to the builder.- Parameters:
attributeTypeAndValue- the attribute-value pair (must not benull)- Returns:
- this builder instance
-
addCompoundItem
public X500PrincipalBuilder addCompoundItem(Collection<X500AttributeTypeAndValue> attributeTypeAndValues) Add a compound item to the builder.- Parameters:
attributeTypeAndValues- the collection of attribute-value pairs (must not benull)- Returns:
- this builder instance
-
build
Build the principal. On return (with any outcome), this builder is re-set for building a new principal.- Returns:
- the constructed principal (not
null) - Throws:
IllegalArgumentException- if the principal is somehow invalid
-