Exemple #1
0
    def format_idp_cert_multi(self):
        """
        Formats the Multple IdP certs.
        """
        if 'x509certMulti' in self.__idp:
            if 'signing' in self.__idp['x509certMulti']:
                for idx in range(len(self.__idp['x509certMulti']['signing'])):
                    self.__idp['x509certMulti']['signing'][
                        idx] = OneLogin_Saml2_Utils.format_cert(
                            self.__idp['x509certMulti']['signing'][idx])

            if 'encryption' in self.__idp['x509certMulti']:
                for idx in range(len(
                        self.__idp['x509certMulti']['encryption'])):
                    self.__idp['x509certMulti']['encryption'][
                        idx] = OneLogin_Saml2_Utils.format_cert(
                            self.__idp['x509certMulti']['encryption'][idx])
Exemple #2
0
    def __add_x509_key_descriptors(root, cert, signing):
        key_descriptor = OneLogin_Saml2_XML.make_child(
            root, '{%s}KeyDescriptor' % OneLogin_Saml2_Constants.NS_MD)
        root.remove(key_descriptor)
        root.insert(0, key_descriptor)
        key_info = OneLogin_Saml2_XML.make_child(
            key_descriptor, '{%s}KeyInfo' % OneLogin_Saml2_Constants.NS_DS)
        key_data = OneLogin_Saml2_XML.make_child(
            key_info, '{%s}X509Data' % OneLogin_Saml2_Constants.NS_DS)

        x509_certificate = OneLogin_Saml2_XML.make_child(
            key_data, '{%s}X509Certificate' % OneLogin_Saml2_Constants.NS_DS)
        x509_certificate.text = OneLogin_Saml2_Utils.format_cert(cert, False)
        key_descriptor.set('use', ('encryption', 'signing')[signing])
Exemple #3
0
 def format_sp_cert_new(self):
     """
     Formats the SP cert.
     """
     self.__sp['x509certNew'] = OneLogin_Saml2_Utils.format_cert(
         self.__sp['x509certNew'])
Exemple #4
0
 def format_idp_cert(self):
     """
     Formats the IdP cert.
     """
     self.__idp['x509cert'] = OneLogin_Saml2_Utils.format_cert(
         self.__idp['x509cert'])