code: def authenticate_peer(self, auth_data, peer_id, message):
          
          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.")
docs: Verifies the peers authentication.