'Ensures that the class and tag specified exist as an alternative
:param class_:
The integer class_ from the encoded value header
:param tag:
The integer tag from the encoded value header
:param contents:
A byte string of the contents of the value - used when the object
is explicitly tagged
:raises:
ValueError - when value is not a valid alternative'

def validate(self, class_, tag, contents):

    id_ = (class_, tag)
    if (self.tag_type == u'explicit'):
        if ((self.explicit_class, self.explicit_tag) != id_):
            raise ValueError(unwrap(u'\n                                                                                %s    was    explicitly    tagged,    but    the    value    provided    does    not\n                                                                                match    the    class    and    tag\n                                                                                ', type_name(self)))
        ((class_, _, tag, _, _, _), _) = _parse(contents, len(contents))
        id_ = (class_, tag)
    if (id_ in self._id_map):
        self._choice = self._id_map[id_]
        return
    if ((self.class_ is not None) and (self.tag is not None)):
        if (len(self._alternatives) > 1):
            raise ValueError(unwrap(u'\n                                                                                %s    was    implicitly    tagged,    but    more    than    one    alternative\n                                                                                exists\n                                                                                ', type_name(self)))
        if (id_ == (self.class_, self.tag)):
            self._choice = 0
            return
    asn1 = self._format_class_tag(class_, tag)
    asn1s = [self._format_class_tag(pair[0], pair[1]) for pair in self._id_map]
    raise ValueError(unwrap(u'\n                                                Value    %s    did    not    match    the    class    and    tag    of    any    of    the    alternatives\n                                                in    %s:    %s\n                                                ', asn1, type_name(self), u',    '.join(asn1s)))
