public class ComImpl extends javax.rmi.PortableRemoteObject implements ComInterface
| Constructor and Description |
|---|
ComImpl()
Constructor - invoke rmi linking and remote object initialization.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addUser(java.lang.String un,
java.math.BigInteger vk)
Adds new user.
|
boolean |
createChallenge(java.math.BigInteger xe,
java.math.BigInteger ff,
byte[] cm,
byte[] ck,
java.lang.String info,
java.lang.String hash,
java.lang.String cip)
Creates challenge and crypted message on the server.
|
byte[] |
digToKey(byte[] dig)
Transfers key from length of hash to length of cipher.
|
java.util.Collection<Challenge> |
getChallenges()
Gets list of challenges.
|
int |
getID(java.lang.String un)
Gets user identification from username.
|
java.util.LinkedList<User> |
getListOfUsers()
Gets list of usernames.
|
boolean |
checkConnection()
Checks connection to server.
|
boolean |
checkUsername(java.lang.String un)
Checks identical usernames.
|
java.math.BigInteger[] |
receivePGQ()
Gets public parameters 'p', 'q' and 'g'.
|
void |
removeUser(java.lang.String un)
Removes user.
|
byte[] |
verification(int id,
byte[] oo)
Verifications of user - computes Kmac key and creates response which is compared with client's response.
|
public ComImpl()
throws java.rmi.RemoteException
java.rmi.RemoteExceptionpublic int getID(java.lang.String un)
un - usernamepublic boolean checkConnection()
throws java.rmi.RemoteException
checkConnection in interface ComInterfacejava.rmi.RemoteExceptionpublic boolean checkUsername(java.lang.String un)
throws java.rmi.RemoteException
checkUsername in interface ComInterfaceun - username to checkjava.rmi.RemoteExceptionpublic java.math.BigInteger[] receivePGQ()
throws java.rmi.RemoteException
receivePGQ in interface ComInterfacejava.rmi.RemoteExceptionpublic void addUser(java.lang.String un,
java.math.BigInteger vk)
throws java.rmi.RemoteException,
java.security.NoSuchAlgorithmException
addUser in interface ComInterfaceun - usernamevk - public keyjava.rmi.RemoteExceptionjava.security.NoSuchAlgorithmExceptionpublic java.util.LinkedList<User> getListOfUsers() throws java.rmi.RemoteException
getListOfUsers in interface ComInterfacejava.rmi.RemoteExceptionpublic boolean createChallenge(java.math.BigInteger xe,
java.math.BigInteger ff,
byte[] cm,
byte[] ck,
java.lang.String info,
java.lang.String hash,
java.lang.String cip)
throws java.rmi.RemoteException,
java.security.NoSuchAlgorithmException
createChallenge in interface ComInterfacexe - xe parameterff - ff parametercm - crypted messageck - crypted keyinfo - string infohash - type of hashs functioncip - type of ciphers functionjava.rmi.RemoteExceptionjava.security.NoSuchAlgorithmExceptionpublic java.util.Collection<Challenge> getChallenges() throws java.rmi.RemoteException
getChallenges in interface ComInterfacejava.rmi.RemoteExceptionpublic byte[] verification(int id,
byte[] oo)
throws java.security.NoSuchAlgorithmException,
javax.crypto.NoSuchPaddingException,
java.security.InvalidKeyException,
javax.crypto.IllegalBlockSizeException,
javax.crypto.BadPaddingException
verification in interface ComInterfaceid - identification of challengeoo - responsejava.security.NoSuchAlgorithmExceptionjavax.crypto.NoSuchPaddingExceptionjava.security.InvalidKeyExceptionjavax.crypto.IllegalBlockSizeExceptionjavax.crypto.BadPaddingExceptionpublic void removeUser(java.lang.String un)
throws java.rmi.RemoteException
removeUser in interface ComInterfaceun - usernamejava.rmi.RemoteExceptionpublic byte[] digToKey(byte[] dig)