Anforderungen  |   Konzepte  |   Entwurf  |   Entwicklung  |   Qualitätssicherung  |   Lebenszyklus  |   Steuerung
 
 
 
 


Quelle  PeerIdentity.h   Sprache: C

 
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
 * vim: sw=2 ts=2 sts=2 expandtab
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */


#ifndef PeerIdentity_h
#define PeerIdentity_h

#include "nsISupportsImpl.h"
#include "nsString.h"

namespace mozilla {

/**
 * This class implements the identifier used in WebRTC identity.  Peers are
 * identified using a string in the form [<user>@]<domain>, for instance,
 * "user@example.com'. The (optional) user portion is a site-controlled string
 * containing any character other than '@'.  The domain portion is a valid IDN
 * domain name and is compared accordingly.
 *
 * See:
 * http://tools.ietf.org/html/draft-ietf-rtcweb-security-arch-09#section-5.6.5.3.3.1
 */

class PeerIdentity final {
 public:
  NS_INLINE_DECL_REFCOUNTING(PeerIdentity)

  explicit PeerIdentity(const nsAString& aPeerIdentity)
      : mPeerIdentity(aPeerIdentity) {}

  bool Equals(const PeerIdentity& aOther) const;
  bool Equals(const nsAString& aOtherString) const;
  const nsString& ToString() const { return mPeerIdentity; }

 private:
  ~PeerIdentity() = default;
  static void GetUser(const nsAString& aPeerIdentity, nsAString& aUser);
  static void GetHost(const nsAString& aPeerIdentity, nsAString& aHost);

  static void GetNormalizedHost(const nsAString& aHost,
                                nsACString& aNormalizedHost);

  nsString mPeerIdentity;
};

inline bool operator==(const PeerIdentity& aOne, const PeerIdentity& aTwo) {
  return aOne.Equals(aTwo);
}

inline bool operator==(const PeerIdentity& aOne, const nsAString& aString) {
  return aOne.Equals(aString);
}

inline bool operator!=(const PeerIdentity& aOne, const PeerIdentity& aTwo) {
  return !aOne.Equals(aTwo);
}

inline bool operator!=(const PeerIdentity& aOne, const nsAString& aString) {
  return !aOne.Equals(aString);
}

/* namespace mozilla */

#endif /* PeerIdentity_h */

Messung V0.5
C=96 H=92 G=93

¤ Dauer der Verarbeitung: 0.12 Sekunden  (vorverarbeitet)  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.






                                                                                                                                                                                                                                                                                                                                                                                                     


Neuigkeiten

     Aktuelles
     Motto des Tages

Software

     Produkte
     Quellcodebibliothek

Aktivitäten

     Artikel über Sicherheit
     Anleitung zur Aktivierung von SSL

Muße

     Gedichte
     Musik
     Bilder

Jenseits des Üblichen ....
    

Besucherstatistik

Besucherstatistik

Monitoring

Montastic status badge