src/net/java/otr4j/session/AuthContext.java
changeset 810 0ff0059f2ec3
equal deleted inserted replaced
797:fbd3585af53e 810:0ff0059f2ec3
       
     1 /*
       
     2  * otr4j, the open source java otr library.
       
     3  *
       
     4  * Distributable under LGPL license.
       
     5  * See terms of license at gnu.org.
       
     6  */
       
     7 package net.java.otr4j.session;
       
     8 
       
     9 import java.math.BigInteger;
       
    10 import java.security.KeyPair;
       
    11 import java.security.PublicKey;
       
    12 
       
    13 import javax.crypto.interfaces.DHPublicKey;
       
    14 
       
    15 import net.java.otr4j.OtrException;
       
    16 import net.java.otr4j.io.messages.AbstractMessage;
       
    17 
       
    18 /**
       
    19  * 
       
    20  * @author George Politis
       
    21  */
       
    22 interface AuthContext {
       
    23 
       
    24 	public static final int NONE = 0;
       
    25 	public static final int AWAITING_DHKEY = 1;
       
    26 	public static final int AWAITING_REVEALSIG = 2;
       
    27 	public static final int AWAITING_SIG = 3;
       
    28 	public static final int V1_SETUP = 4;
       
    29 	public static final byte C_START = (byte) 0x01;
       
    30 	public static final byte M1_START = (byte) 0x02;
       
    31 	public static final byte M2_START = (byte) 0x03;
       
    32 	public static final byte M1p_START = (byte) 0x04;
       
    33 	public static final byte M2p_START = (byte) 0x05;
       
    34 
       
    35 	public abstract void reset();
       
    36 
       
    37 	public abstract boolean getIsSecure();
       
    38 
       
    39 	public abstract DHPublicKey getRemoteDHPublicKey();
       
    40 
       
    41 	public abstract KeyPair getLocalDHKeyPair() throws OtrException;
       
    42 
       
    43 	public abstract BigInteger getS() throws OtrException;
       
    44 
       
    45 	public abstract void handleReceivingMessage(AbstractMessage m)
       
    46 			throws OtrException;
       
    47 
       
    48 	public abstract void startV2Auth() throws OtrException;
       
    49 
       
    50 	public abstract void respondV2Auth() throws OtrException;
       
    51 
       
    52 	public abstract PublicKey getRemoteLongTermPublicKey();
       
    53 
       
    54 	public abstract KeyPair getLocalLongTermKeyPair();
       
    55 }