(self)
return p12
Because for signing the XML file is needed a PKCS #12 and
        the passphrase is not available in the AEAT certificate,
        create a new one and set the certificate and its private key
        from the stored files.
        :return: A PKCS #12 archive
Because for signing the XML file is needed a PKCS #12 and
        the passphrase is not available in the AEAT certificate,
        create a new one and set the certificate and its private key
        from the stored files.
        :return: A PKCS #12 archive
Because for signing the XML file is needed a PKCS #12 and the passphrase is not available in the AEAT certificate create a new one and set the certificate and its private key from the stored files . : return : A PKCS #12 archive
def get_p12(self):
        """
        Because for signing the XML file is needed a PKCS #12 and
        the passphrase is not available in the AEAT certificate,
        create a new one and set the certificate and its private key
        from the stored files.
        :return: A PKCS #12 archive
        """
        self.ensure_one()
        with open(self.public_key, "rb") as f_crt:
            with open(self.private_key, "rb") as f_pem:
                f_crt = f_crt.read()
                f_pem = f_pem.read()
                if isinstance(f_pem, str):
                    f_pem = bytes(f_pem, "utf-8")
                pkey = serialization.load_pem_private_key(f_pem, password=None)
                cert = x509.load_pem_x509_certificate(f_crt)
                p12 = (pkey, cert, [])
        return p12
def get_p12 ( self ) : self . ensure_one ( ) with open ( self . public_key , "rb" ) as f_crt : with open ( self . private_key , "rb" ) as f_pem : f_crt = f_crt . read ( ) f_pem = f_pem . read ( ) if isinstance ( f_pem , str ) : f_pem = bytes ( f_pem , "utf-8" ) pkey = serialization . load_pem_private_key ( f_pem , password = None ) cert = x509 . load_pem_x509_certificate ( f_crt ) p12 = ( pkey , cert , [ ] ) return p12