@@ -0,0 +1,3122 @@
+/*%0A * JBoss, Home of Professional Open Source.%0A * Copyright 2016 Red Hat, Inc., and individual contributors%0A * as indicated by the @author tags.%0A *%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at%0A *%0A *     http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A */%0A%0Apackage org.wildfly.security.x500;%0A%0Aimport org.wildfly.common.Assert;%0Aimport org.wildfly.security.asn1.ASN1Encodable;%0Aimport org.wildfly.security.asn1.ASN1Encoder;%0A%0A/**%0A * An X.500 directory attribute, which is comprised of an attribute type OID and a single values, whose type is%0A * defined by the attribute type.%0A *%0A * @author %3Ca href=%22mailto:david.lloyd@redhat.com%22%3EDavid M. Lloyd%3C/a%3E%0A */%0Apublic final class X500AttributeTypeAndValue implements ASN1Encodable %7B%0A    private final String attributeType;%0A    private final ASN1Encodable value;%0A%0A    private X500AttributeTypeAndValue(final String attributeType, final ASN1Encodable value) %7B%0A        this.attributeType = attributeType;%0A        this.value = value;%0A    %7D%0A%0A    /**%0A     * Construct a new instance with the given value.%0A     *%0A     * @param attributeType the attribute type OID (must not be %7B@code null%7D)%0A     * @param value the single value (must not be %7B@code null%7D)%0A     * @return the directory attribute%0A     */%0A    public static X500AttributeTypeAndValue create(final String attributeType, ASN1Encodable value) %7B%0A        Assert.checkNotNullParam(%22attributeType%22, attributeType);%0A        Assert.checkNotNullParam(%22value%22, value);%0A        return new X500AttributeTypeAndValue(attributeType, value);%0A    %7D%0A%0A    /**%0A     * Construct a new instance with a UTF-8 value.%0A     *%0A     * @param attributeType the attribute type OID (must not be %7B@code null%7D)%0A     * @param stringValue the string value (must not be %7B@code null%7D)%0A     * @return the directory attribute%0A     */%0A    public static X500AttributeTypeAndValue createUtf8(final String attributeType, String stringValue) %7B%0A        Assert.checkNotNullParam(%22stringValue%22, stringValue);%0A        return create(attributeType, ASN1Encodable.ofUtf8String(stringValue));%0A    %7D%0A%0A    /**%0A     * Construct a new instance with an OID value.%0A     *%0A     * @param attributeType the attribute type OID (must not be %7B@code null%7D)%0A     * @param oid the OID (must not be %7B@code null%7D)%0A     * @return the directory attribute%0A     */%0A    public static X500AttributeTypeAndValue createObjectId(final String attributeType, String oid) %7B%0A        return create(attributeType, ASN1Encodable.ofOid(oid));%0A    %7D%0A%0A    public void encodeTo(final ASN1Encoder encoder) %7B%0A        encoder.startSequence();%0A        encoder.encodeObjectIdentifier(attributeType);%0A        value.encodeTo(encoder);%0A        encoder.endSequence();%0A    %7D%0A%7D%0A

Add X.500 Attribute type and value class