package model.x501; import model.asn1.ASN1Object; import model.asn1.Encodable; import model.asn1.Tag; import model.asn1.exceptions.ParseException; import model.asn1.parsing.BytesReader; import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.stream.Collectors; import java.util.stream.Stream; /** * Represents a DN item. *
* RelativeDistinguishedName ::= SET SIZE (1..MAX) OF AttributeTypeAndValue ** For more information on DN, see {@link Name}. */ public class RelativeDistinguishedName extends ASN1Object { private final AttributeTypeAndValue[] array; /** * EFFECT: Initialize the list with the given tag, parentTag, and array. For tag and parentTag, consult * {@link ASN1Object}. * REQUIRES: Array items should have UNIVERSAL SEQUENCE tag. */ public RelativeDistinguishedName(Tag tag, Tag parentTag, AttributeTypeAndValue[] array) { super(tag, parentTag); this.array = array; } /** * EFFECT: Parse the list from input DER bytes. For details on parsing, refer to {@link ASN1Object}. * Throws {@link ParseException} for invalid input. * MODIFIES: this, encoded */ public RelativeDistinguishedName(BytesReader encoded, boolean hasParentTag) throws ParseException { super(encoded, hasParentTag); final List