<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def requestCertificateForAddress(self, fromAddress, sharedSecret):
 """ Connect to the authoritative server for the domain part of the given address and obtain a certificate signed by the root certificate for that domain, then store that certificate in my local certificate storage. @param fromAddress: an address that this service is authorized to use, and should store a separate private certificate for. @param sharedSecret: a str that represents a secret shared between the user of this service and their account on the server running on the domain part of the fromAddress. @return: a Deferred which fires None when the certificate has been successfully retrieved, and errbacks if it cannot be retrieved. """

        kp = KeyPair.generate()
        subject = DistinguishedName(commonName=str(fromAddress))
        reqobj = kp.requestObject(subject)
        # Create worthless, self-signed certificate for the moment, it will be
        # replaced later.
        # attemptAddress = q2q.Q2QAddress(fromAddress.domain,
        #   fromAddress.resource + '+attempt')
        #   fakeSubj = DistinguishedName(commonName=str(attemptAddress))
        fakereq = kp.requestObject(subject)
        ssigned = kp.signRequestObject(subject, fakereq, 1)
        certpair = PrivateCertificate.fromCertificateAndKeyPair
        fakecert = certpair(ssigned, kp)
        apc = self.certificateStorage.addPrivateCertificate

        gettingSecureConnection = self.getSecureConnection(
            fromAddress, fromAddress.domainAddress(), authorize=False,
            usePrivateCertificate=fakecert,
            )
        def gotSecureConnection(secured):
            return secured.callRemote(
                Sign,
                certificate_request=reqobj,
                password=sharedSecret)
        gettingSecureConnection.addCallback(gotSecureConnection)
        def gotSignResponse(signResponse):
            cert = signResponse['certificate']
            privcert = certpair(cert, kp)
            apc(str(fromAddress), privcert)
            return signResponse
        return gettingSecureConnection.addCallback(gotSignResponse)