def parse_x509_cert(self, key_desc_node):
    xpath_from_node = 'ds:KeyInfo/ds:X509Data/ds:X509Certificate'
    try:
        x509_node = key_desc_node.xpath(xpath_from_node, namespaces=MetadataExtractor.NAMESPACES)[0]
        self.x509_cert = x509_node.text
        if (not self.x509_cert):
            raise MissingValue
    except (IndexError, MissingValue):
        raise MissingValue('Unable to parse x509 certificate')
def parse_x509_cert(self, key_desc_node):
    xpath_from_node = 'ds:KeyInfo/ds:X509Data/ds:X509Certificate'
    try:
        x509_node = key_desc_node.xpath(xpath_from_node, namespaces=MetadataExtractor.NAMESPACES)[0]
        self.x509_cert = x509_node.text
        if (not self.x509_cert):
            raise MissingValue
    except (IndexError, MissingValue):
        raise MissingValue('Unable to parse x509 certificate')