29.07.2013 Views

Master of Science thesis Fighting Spam

Master of Science thesis Fighting Spam

Master of Science thesis Fighting Spam

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

}<br />

{<br />

}<br />

if(amountPanel.getText().length() == 0)<br />

return "Please fill in the field \"" + labels[0] + "\"";<br />

if(logonInformationPanel.textFields[0].getText().length() == 0)<br />

return "Please fill in the field \"" + labels[1] + "\"";<br />

if(logonInformationPanel.textFields[1].getText().length() == 0)<br />

return "Please fill in the field \"" + labels[2] + "\"";<br />

return "";<br />

private class textFieldListener implements ActionListener<br />

{<br />

public void actionPerformed(ActionEvent e)<br />

{<br />

try<br />

{<br />

//Filled in correctly?<br />

String check = checkFields();<br />

if(check.length() != 0)<br />

{<br />

frame.showError(check);<br />

return;<br />

}<br />

}<br />

}<br />

frame.withdraw(Double.parseDouble(amountPanel.getText()),<br />

logonInformationPanel.textFields[0].getText(),<br />

logonInformationPanel.textFields[1].getText());<br />

}<br />

catch(Exception ex)<br />

{<br />

Debugger.debug(className, 3, "Could not withdraw.", ex);<br />

}<br />

10.1.5 MailHandler<br />

10.1.5.a CoinHeader<br />

package <strong>Spam</strong>Cash.Client.MailHandler;<br />

import org.logi.crypto.sign.Signature;<br />

import java.security.cert.Certificate;<br />

import <strong>Spam</strong>Cash.Currency.Coin;<br />

import java.io.IOException;<br />

import java.security.cert.CertificateEncodingException;<br />

public class CoinHeader implements java.io.Serializable<br />

{<br />

//Signatures<br />

private byte[] s1, s2;<br />

private String hashFunc;<br />

public Coin coin;<br />

public Certificate cert;<br />

public CoinHeader(Signature s1,Signature s2,Coin coin,Certificate cert) throws<br />

IOException<br />

{<br />

this.s1 = s1.getBytes();<br />

this.s2 = s2.getBytes();<br />

this.hashFunc = s1.getHashFunc();<br />

this.coin = coin;<br />

this.cert = cert;<br />

262

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!