'Decode a complete DER element, and re-initializes this
object with it.
@param derEle       A complete DER element. It must start with a DER T
tag.
@param noLeftOvers  Indicate whether it is acceptable to complete the
parsing of the DER element and find that not all
bytes in derEle have been used.
@return             Index of the first unused byte in the given DER element.
Raises a ValueError exception in case of parsing errors.
Raises an IndexError exception if the DER element is too short.'

def decode(self, derEle, noLeftOvers=0):

    try:
        self.typeTag = bord(derEle[0])
        if ((self.typeTag & 31) == 31):
            raise ValueError('Unsupported    DER    tag')
        (length, idx) = self._decodeLen(1, derEle)
        if (noLeftOvers and (len(derEle) != (idx + length))):
            raise ValueError('Not    a    DER    structure')
        self.payload = derEle[idx:(idx + length)]
    except IndexError:
        raise ValueError('Not    a    valid    DER    SEQUENCE.')
    return (idx + length)
