Class IdentityUtils

java.lang.Object
org.cloudburstmc.netty.util.nethernet.IdentityUtils

public class IdentityUtils extends Object
  • Constructor Details

    • IdentityUtils

      public IdentityUtils()
  • Method Details

    • validateIdentity

      public static org.jose4j.jwt.consumer.JwtContext validateIdentity(Identity identity) throws org.jose4j.jwt.consumer.InvalidJwtException
      Validate the given identity against the known jwt signer
      Parameters:
      identity - The identity to validate
      Returns:
      The JWT context if the identity is valid
      Throws:
      org.jose4j.jwt.consumer.InvalidJwtException - If the identity is invalid
    • validateSdp

      public static org.jose4j.jwt.JwtClaims validateSdp(String sdpOffer) throws org.jose4j.lang.JoseException, org.jose4j.jwt.consumer.InvalidJwtException
      Validate the SDP offer against the embedded identity and known jwt signer This is designed into the spec to prevent MITM
      Parameters:
      sdpOffer - The SDP offer to validate
      Returns:
      The JWT claims if the SDP offer is valid
      Throws:
      org.jose4j.lang.JoseException - If there is an error processing the SDP offer
      org.jose4j.jwt.consumer.InvalidJwtException - If the SDP offer contains an invalid JWT
    • getCanonicalFingerprintJson

      public static String getCanonicalFingerprintJson(String sdpOffer)
      Get the canonical fingerprint JSON from the SDP offer
      Parameters:
      sdpOffer - The SDP offer to extract fingerprints from
      Returns:
      The canonical fingerprint JSON