// Path: src/main/java/net/java/otr4j/OtrEngineListener.java
// public interface OtrEngineListener {
// 	void sessionStatusChanged(SessionID sessionID);
// 
// 	void multipleInstancesDetected(SessionID sessionID);
// 
// 	void outgoingSessionChanged(SessionID sessionID);
// }
// 
// Path: src/main/java/net/java/otr4j/OtrException.java
// @SuppressWarnings("serial")
// public class OtrException extends Exception {
// 	public OtrException(Exception e) {
// 		super(e);
// 	}
// }
// 
// Path: src/main/java/net/java/otr4j/OtrPolicy.java
// public interface OtrPolicy {
// 
// 	int ALLOW_V1 = 0x01;
// 	int ALLOW_V2 = 0x02;
// 	int ALLOW_V3 = 0x40; // ALLOW_V3 is set to 0x40 for compatibility with older versions
// 	int REQUIRE_ENCRYPTION = 0x04;
// 	int SEND_WHITESPACE_TAG = 0x8;
// 	int WHITESPACE_START_AKE = 0x10;
// 	int ERROR_START_AKE = 0x20;
// 	int VERSION_MASK = (ALLOW_V1 | ALLOW_V2 | ALLOW_V3);
// 
// 	// The four old version 1 policies correspond to the following combinations
// 	// of flags (adding an allowance for version 2 of the protocol):
// 
// 	int NEVER = 0x00;
// 	int OPPORTUNISTIC = (ALLOW_V1 | ALLOW_V2 | ALLOW_V3
// 			| SEND_WHITESPACE_TAG | WHITESPACE_START_AKE | ERROR_START_AKE);
// 	int OTRL_POLICY_MANUAL = (ALLOW_V1 | ALLOW_V2 | ALLOW_V3);
// 	int OTRL_POLICY_ALWAYS = (ALLOW_V1 | ALLOW_V2 | ALLOW_V3
// 			| REQUIRE_ENCRYPTION | WHITESPACE_START_AKE | ERROR_START_AKE);
// 	int OTRL_POLICY_DEFAULT = OPPORTUNISTIC;
// 
// 	boolean getAllowV1();
// 
// 	boolean getAllowV2();
// 
// 	boolean getAllowV3();
// 
// 	boolean getRequireEncryption();
// 
// 	boolean getSendWhitespaceTag();
// 
// 	boolean getWhitespaceStartAKE();
// 
// 	boolean getErrorStartAKE();
// 
// 	int getPolicy();
// 
// 	void setAllowV1(boolean value);
// 
// 	void setAllowV2(boolean value);
// 
// 	void setAllowV3(boolean value);
// 
// 	void setRequireEncryption(boolean value);
// 
// 	void setSendWhitespaceTag(boolean value);
// 
// 	void setWhitespaceStartAKE(boolean value);
// 
// 	void setErrorStartAKE(boolean value);
// 
// 	void setEnableAlways(boolean value);
// 
// 	boolean getEnableAlways();
// 
// 	void setEnableManual(boolean value);
// 
// 	boolean getEnableManual();
// }
// 
// Path: src/main/java/net/java/otr4j/io/messages/AbstractMessage.java
// public abstract class AbstractMessage {
// 
// 	// Unencoded
// 	public static final int MESSAGE_ERROR = 0xff;
// 	public static final int MESSAGE_QUERY = 0x100;
// 	public static final int MESSAGE_PLAINTEXT = 0x102;
// 
// 	public int messageType;
// 
// 	public AbstractMessage(int messageType) {
// 		this.messageType = messageType;
// 	}
// 
// 	@Override
// 	public int hashCode() {
// 		final int prime = 31;
// 		int result = 1;
// 		result = prime * result + messageType;
// 		return result;
// 	}
// 
// 	@Override
// 	public boolean equals(Object obj) {
// 		if (this == obj)
// 			return true;
// 		if (obj == null)
// 			return false;
// 		if (getClass() != obj.getClass())
// 			return false;
// 		AbstractMessage other = (AbstractMessage) obj;
// 		if (messageType != other.messageType)
// 			return false;
// 		return true;
// 	}
// }


import java.math.BigInteger;
import java.security.KeyPair;
import java.security.PublicKey;
import java.util.List;
import net.java.otr4j.OtrEngineListener;
import net.java.otr4j.OtrException;
import net.java.otr4j.OtrPolicy;
import net.java.otr4j.io.messages.AbstractMessage;
/*
 * Copyright @ 2015 Atlassian Pty Ltd
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package net.java.otr4j.session;



/**
 * @author George Politis
 */
public interface Session {

	interface OTRv {
		int ONE = 1;

		int TWO = 2;

		int THREE = 3;
	}

	SessionStatus getSessionStatus();

	SessionID getSessionID();

	void injectMessage(AbstractMessage m) throws OtrException;

	KeyPair getLocalKeyPair() throws OtrException;

	OtrPolicy getSessionPolicy();

	String transformReceiving(String content)
			throws OtrException;

	String[] transformSending(String content, List<TLV> tlvs)
			throws OtrException;

	String[] transformSending(String content)
			throws OtrException;

	void startSession() throws OtrException;

	void endSession() throws OtrException;

	void refreshSession() throws OtrException;

	PublicKey getRemotePublicKey();

	void addOtrEngineListener(OtrEngineListener l);

	void removeOtrEngineListener(OtrEngineListener l);

	void initSmp(String question, String secret) throws OtrException;

// Path: src/main/java/net/java/otr4j/OtrEngineListener.java
// public interface OtrEngineListener {
// 	void sessionStatusChanged(SessionID sessionID);
// 
// 	void multipleInstancesDetected(SessionID sessionID);
// 
// 	void outgoingSessionChanged(SessionID sessionID);
// }
// 
// Path: src/main/java/net/java/otr4j/OtrException.java
// @SuppressWarnings("serial")
// public class OtrException extends Exception {
// 	public OtrException(Exception e) {
// 		super(e);
// 	}
// }
// 
// Path: src/main/java/net/java/otr4j/OtrPolicy.java
// public interface OtrPolicy {
// 
// 	int ALLOW_V1 = 0x01;
// 	int ALLOW_V2 = 0x02;
// 	int ALLOW_V3 = 0x40; // ALLOW_V3 is set to 0x40 for compatibility with older versions
// 	int REQUIRE_ENCRYPTION = 0x04;
// 	int SEND_WHITESPACE_TAG = 0x8;
// 	int WHITESPACE_START_AKE = 0x10;
// 	int ERROR_START_AKE = 0x20;
// 	int VERSION_MASK = (ALLOW_V1 | ALLOW_V2 | ALLOW_V3);
// 
// 	// The four old version 1 policies correspond to the following combinations
// 	// of flags (adding an allowance for version 2 of the protocol):
// 
// 	int NEVER = 0x00;
// 	int OPPORTUNISTIC = (ALLOW_V1 | ALLOW_V2 | ALLOW_V3
// 			| SEND_WHITESPACE_TAG | WHITESPACE_START_AKE | ERROR_START_AKE);
// 	int OTRL_POLICY_MANUAL = (ALLOW_V1 | ALLOW_V2 | ALLOW_V3);
// 	int OTRL_POLICY_ALWAYS = (ALLOW_V1 | ALLOW_V2 | ALLOW_V3
// 			| REQUIRE_ENCRYPTION | WHITESPACE_START_AKE | ERROR_START_AKE);
// 	int OTRL_POLICY_DEFAULT = OPPORTUNISTIC;
// 
// 	boolean getAllowV1();
// 
// 	boolean getAllowV2();
// 
// 	boolean getAllowV3();
// 
// 	boolean getRequireEncryption();
// 
// 	boolean getSendWhitespaceTag();
// 
// 	boolean getWhitespaceStartAKE();
// 
// 	boolean getErrorStartAKE();
// 
// 	int getPolicy();
// 
// 	void setAllowV1(boolean value);
// 
// 	void setAllowV2(boolean value);
// 
// 	void setAllowV3(boolean value);
// 
// 	void setRequireEncryption(boolean value);
// 
// 	void setSendWhitespaceTag(boolean value);
// 
// 	void setWhitespaceStartAKE(boolean value);
// 
// 	void setErrorStartAKE(boolean value);
// 
// 	void setEnableAlways(boolean value);
// 
// 	boolean getEnableAlways();
// 
// 	void setEnableManual(boolean value);
// 
// 	boolean getEnableManual();
// }
// 
// Path: src/main/java/net/java/otr4j/io/messages/AbstractMessage.java
// public abstract class AbstractMessage {
// 
// 	// Unencoded
// 	public static final int MESSAGE_ERROR = 0xff;
// 	public static final int MESSAGE_QUERY = 0x100;
// 	public static final int MESSAGE_PLAINTEXT = 0x102;
// 
// 	public int messageType;
// 
// 	public AbstractMessage(int messageType) {
// 		this.messageType = messageType;
// 	}
// 
// 	@Override
// 	public int hashCode() {
// 		final int prime = 31;
// 		int result = 1;
// 		result = prime * result + messageType;
// 		return result;
// 	}
// 
// 	@Override
// 	public boolean equals(Object obj) {
// 		if (this == obj)
// 			return true;
// 		if (obj == null)
// 			return false;
// 		if (getClass() != obj.getClass())
// 			return false;
// 		AbstractMessage other = (AbstractMessage) obj;
// 		if (messageType != other.messageType)
// 			return false;
// 		return true;
// 	}
// }


// Path: src/main/java/net/java/otr4j/session/Session.java
import java.math.BigInteger;
import java.security.KeyPair;
import java.security.PublicKey;
import java.util.List;
import net.java.otr4j.OtrEngineListener;
import net.java.otr4j.OtrException;
import net.java.otr4j.OtrPolicy;
import net.java.otr4j.io.messages.AbstractMessage;

/*
 * Copyright @ 2015 Atlassian Pty Ltd
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package net.java.otr4j.session;



/**
 * @author George Politis
 */
public interface Session {

	interface OTRv {
		int ONE = 1;

		int TWO = 2;

		int THREE = 3;
	}

	SessionStatus getSessionStatus();

	SessionID getSessionID();

	void injectMessage(AbstractMessage m) throws OtrException;

	KeyPair getLocalKeyPair() throws OtrException;

	OtrPolicy getSessionPolicy();

	String transformReceiving(String content)
			throws OtrException;

	String[] transformSending(String content, List<TLV> tlvs)
			throws OtrException;

	String[] transformSending(String content)
			throws OtrException;

	void startSession() throws OtrException;

	void endSession() throws OtrException;

	void refreshSession() throws OtrException;

	PublicKey getRemotePublicKey();

	void addOtrEngineListener(OtrEngineListener l);

	void removeOtrEngineListener(OtrEngineListener l);

	void initSmp(String question, String secret) throws OtrException;

	void respondSmp(String question, String secret) throws OtrException;