All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.restcomm.media.ice.IceAuthenticator Maven / Gradle / Ivy

/*
 * TeleStax, Open Source Cloud Communications
 * Copyright 2011-2014, Telestax Inc and individual contributors
 * by the @authors tag.
 *
 * This program is free software: you can redistribute it and/or modify
 * under the terms of the GNU Affero General Public License as
 * published by the Free Software Foundation; either version 3 of
 * the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with this program.  If not, see 
 *
 */

package org.restcomm.media.ice;

/**
 * Authenticator that verifies the integrity of incoming messages.
 * 
 * @author Henrique Rosa
 * 
 */
public interface IceAuthenticator {

	/**
	 * Gets the password assigned to a local user.
	 * 
	 * @param ufrag
	 *            the fragment of the local user
	 * @return The password of the specified user.
* If the user has no password associated, returns an empty key.
* If the user does not exist, returns null. */ public byte[] getLocalKey(String ufrag); /** * Gets the password assigned to a remote user. * * @param ufrag * the fragment of the remote user * @param media * the name of the target media stream * @return The password of the specified user.
* If the user has no password associated, returns an empty key.
* If the user or media stream do not exist, returns null. */ public byte[] getRemoteKey(String ufrag, String media); /** * Verifies whether a local user is registered. * * @param ufrag * the fragment of the local user * @return true if the user exists, false otherwise. */ boolean isUserRegistered(String ufrag); /** * Validates the autenticity of a STUN USERNAME attribute.
* The agent MUST consider the username to be valid if it consists of two * values separated by a colon, where the first value is equal to the * username fragment generated by the agent in an offer or answer for a * session in-progress. * * @param username The username to be validated * @return Whether the username is valid or not. */ boolean validateUsername(String username); }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy