<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def authenticate_peer(self, auth_data, peer_id, message):
 """ Verifies the peers authentication. """

        logger.debug('message: {}'.format(dump(message)))
        signed_octets = message + self.Ni + prf(self.SK_pr, peer_id._data)
        auth_type = const.AuthenticationType(struct.unpack(const.AUTH_HEADER, auth_data[:4])[0])
        assert auth_type == const.AuthenticationType.RSA
        logger.debug(dump(auth_data))
        try:
            return pubkey.verify(signed_octets, auth_data[4:], 'tests/peer.pem')
        except pubkey.VerifyError:
            raise IkeError("Remote peer authentication failed.")