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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

}<br />

certRequestFile.delete();<br />

Debugger.debug(getClass(), 1, err);<br />

throw new Exception(err);<br />

Thread.sleep(300);<br />

Debugger.debug(Cryptotools.class, 3, "Waiting for certificate to be<br />

generated");<br />

checks++;<br />

}<br />

}<br />

}<br />

Debugger.debug(getClass(), 3, "Certificate generated");<br />

Certificate cert = FileHandler.importCertificate(generatedCert);<br />

Debugger.debug(getClass(), 1, "Certificate imported successfully from file");<br />

//generatedCert.delete();<br />

certRequestFile.delete();<br />

return;<br />

public void shutdown() throws Exception<br />

{<br />

}<br />

10.4.7 VS<br />

10.4.7.a VerificationServer<br />

package <strong>Spam</strong>Cash.Servers.VS;<br />

import <strong>Spam</strong>Cash.NetworkPackets.*;<br />

import <strong>Spam</strong>Cash.Utilities.Config;<br />

import <strong>Spam</strong>Cash.Utilities.Debugger;<br />

import java.io.FileInputStream;<br />

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

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

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

import java.io.FileNotFoundException;<br />

import java.util.Random;<br />

import <strong>Spam</strong>Cash.Utilities.Cryptotools;<br />

import java.security.interfaces.*;<br />

import java.io.*;<br />

import <strong>Spam</strong>Cash.Utilities.FileHandler;<br />

import <strong>Spam</strong>Cash.Servers.AbstractServer;<br />

import <strong>Spam</strong>Cash.NetworkPackets.StatusPacket;<br />

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

import <strong>Spam</strong>Cash.Utilities.FileHandler;<br />

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

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

public class VerificationServer extends AbstractServer<br />

{<br />

private Certificate CESCertificate, RSCertificate;<br />

public VerificationServer() throws Exception<br />

{<br />

super(Config.BLSCertificateName, Config.BLSPrivateKeyName, Config.VSPort);<br />

CESCertificate = FileHandler.importCertificate(new<br />

File(Config.CESCertificateName));<br />

RSCertificate = FileHandler.importCertificate(new<br />

File(Config.RSCertificateName));<br />

360

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

Saved successfully!

Ooh no, something went wrong!