I have the following Definition:
PersonalName ::= SET {
surname [0] IMPLICIT PrintableString
(SIZE (1..ub-surname-length)),
given-name [1] IMPLICIT PrintableString
(SIZE (1..ub-given-name-length)) OPTIONAL,
initials [2] IMPLICIT PrintableString
(SIZE (1..ub-initials-length)) OPTIONAL,
generation-qualifier [3] IMPLICIT PrintableString
(SIZE (1..ub-generation-qualifier-length))
OPTIONAL }
Is it allowed to have e.g. two times surname encoded with this definition?
The answer is in section 3.8.72 (definition of set types) in the T-REC-X680 specification:
Your BER or DER encoded files contains values and the above clause defines that the value which is of the "set type" shall contain one value for each component type of the set (except for optional components, which according to the Note, can be omitted).