package com.youcruit.billogram.objects.response.billogram;

import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
import com.youcruit.billogram.objects.response.event.CallbackEvent;

public class Callback {
    @Expose
    private CallbackBillogram billogram;
    @Expose
    private CallbackEvent event;
    @Expose
    private String url;
    @SerializedName("sign_key")
    @Expose
    private String signKey;
    @Expose
    private String custom;
    @Expose
    @SerializedName("callback_id")
    private String callbackId;

    public String getUrl() {
	return url;

    }
    public void setUrl(String url) {
	this.url = url;
    }

    public String getSignKey() {
	return signKey;
    }

    
    public void setSignKey(String signKey) {
	this.signKey = signKey;
    }

    public String getCustom() {
	return custom;
    }

    
    public void setCustom(String custom) {
	this.custom = custom;
    }

    public void verifySignature(String key) {

    }

    public CallbackBillogram getBillogram() {
        return billogram;
    }

    public void setBillogram(CallbackBillogram billogram) {
        this.billogram = billogram;
    }

    public CallbackEvent getEvent() {
        return event;
    }

    public void setEvent(CallbackEvent event) {
        this.event = event;
    }

    public String getCallbackId() {
        return callbackId;
    }

    public void setCallbackId(String callbackId) {
        this.callbackId = callbackId;
    }

}

@@ -53,16 +53,187 @@
 ogram;%0A%0A
+import java.io.UnsupportedEncodingException;%0Aimport java.security.MessageDigest;%0Aimport java.security.NoSuchAlgorithmException;%0A%0Aimport javax.xml.bind.DatatypeConverter;%0A%0A
 import c
@@ -1669,10 +1669,520 @@
 %0A    %7D%0A%0A
+    public boolean verifySignature(byte%5B%5D key) %7B%0A        try %7B%0A            MessageDigest digest = MessageDigest.getInstance(%22MD5%22);%0A            digest.update(callbackId.getBytes(%22UTF-8%22));%0A            final String md5Digest = DatatypeConverter.printHexBinary(digest.digest(key));%0A            return md5Digest.equals(signKey);%0A        %7D catch (UnsupportedEncodingException%7CNoSuchAlgorithmException e) %7B%0A            // If UTF-8 or MD5 doesn't exist, JVM is broken%0A            throw new Error(e);%0A        %7D%0A    %7D%0A
 %7D%0A

Add method to verify signature