Giter Club home page Giter Club logo

ticketier's Introduction

Ticketier API

Producing cryptograhically secured tickets.

Depandancies (libraries)

  1. javase-3.3.3
  2. mysql-connector-java-8.0.12
  3. zxing-core-3.3.0
  4. webcam-capture-0.3.10-dist

Classes

  1. Util
  2. Query
  3. Event
  4. Ticket
  5. User
  6. EmailBody

1. Query

Handles all database queries. Constructor expects a connection object

Query query = new Query(Connection);

Methods

Register a new user

public boolean createUser(User) throws NoSuchAlgorithmException,SQLException

User Login

public boolean authorizeUser(int id,String pass) throws NoSuchAlgorithmException,SQLException
// True -> passwords match
// False -> password mismatch

Event Creation

public boolean createEvent(Event) throws SQLException

Fetch all Events

public Event[] getEvents() throws SQLException

Fetch an event by id

public Event getEvent(int) throws SQLException

Ticket Creation

public boolean createTicket(Ticket) throws SQLException

Find Ticket by digest

public boolean getTicket(String) throws SQLException

2. Util

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.

Methods

Encrypt

public static String encrypt(String) throws Exception

Decrypt

public static String decrypt(String) throws Exception

Generate QR code

Generates a QR-Code png at the specified file path

  public static void generateQR(String text,String filePath) throws WriterException,IOException

Read QR code

Interprates contents of the QR-Code png contained in the specified path

  public static String readQRCode(String) throws IOException,NotFoundException

Take Picture

Takes a photo from the webcam and saves the image as ticket.png in the current working directory

 public static void takePic() throws IOException

SHA-256 Hash function

public static String sha256(String) throws NoSuchAlgorithmException

Send Email

public static void sendMail(EmailBody) throws Exception

ticketier's People

Contributors

alexhawi avatar davidkiai avatar edwinwalela avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.