Producing cryptograhically secured tickets.
- javase-3.3.3
- mysql-connector-java-8.0.12
- zxing-core-3.3.0
- webcam-capture-0.3.10-dist
- Util
- Query
- Event
- Ticket
- User
- EmailBody
Handles all database queries. Constructor expects a connection object
Query query = new Query(Connection);
public boolean createUser(User) throws NoSuchAlgorithmException,SQLException
public boolean authorizeUser(int id,String pass) throws NoSuchAlgorithmException,SQLException
// True -> passwords match
// False -> password mismatch
public boolean createEvent(Event) throws SQLException
public Event[] getEvents() throws SQLException
public Event getEvent(int) throws SQLException
public boolean createTicket(Ticket) throws SQLException
public boolean getTicket(String) throws SQLException
Utility class which performs key processes which include hashing,encryption,qr generation and scanning and interpratation.
Encryption uses AES/CBC/PKCS5PADDIN
Hashing uses SHA-256
algorithim
All methods in this class are static, hence can be accessed without creating an instance of the class.
public static String encrypt(String) throws Exception
public static String decrypt(String) throws Exception
Generates a QR-Code png at the specified file path
public static void generateQR(String text,String filePath) throws WriterException,IOException
Interprates contents of the QR-Code png contained in the specified path
public static String readQRCode(String) throws IOException,NotFoundException
Takes a photo from the webcam and saves the image as ticket.png
in the current working directory
public static void takePic() throws IOException
public static String sha256(String) throws NoSuchAlgorithmException
public static void sendMail(EmailBody) throws Exception