@@ -0,0 +1,1588 @@
+package de.uni.trier.infsec.functionalities.pki.real;%0A%0Aimport static de.uni.trier.infsec.utils.MessageTools.copyOf;%0Aimport de.uni.trier.infsec.lib.crypto.CryptoLib;%0Aimport de.uni.trier.infsec.lib.crypto.KeyPair;%0A%0A/**%0A * Real functionality for digital signatures with PKI (Public Key Infrastructure).%0A *%0A * For intended usage see class ...ideal.PKISig.%0A */%0Apublic class PKISig %7B%0A%0A%09/**%0A%09 * An object encapsulating the verification key and allowing a user to verify%0A%09 * a signature.%0A%09 */%0A%09static public class Verifier %7B%0A%09%09private byte%5B%5D verifKey;%0A%0A%09%09private Verifier(byte%5B%5D verifKey) %7B%0A%09%09%09this.verifKey = verifKey;%0A%09%09%7D%0A%0A%09%09public boolean verify(byte%5B%5D signature, byte%5B%5D message) %7B%0A%09%09%09return CryptoLib.verify(message, signature, verifKey);%0A%09%09%7D%0A%0A%09%09public byte%5B%5D getVerifKey() %7B%0A%09%09%09return copyOf(verifKey);%0A%09%09%7D%0A%09%7D%0A%0A%09/**%0A%09 * An object encapsulating a signing/verification key pair and allowing a user to%0A%09 * create signatures.%0A%09 */%0A%09static public class Signer %7B%0A%09%09private byte%5B%5D verifKey;%0A%09%09private byte%5B%5D signKey;%0A%0A%09%09private Signer() %7B%0A%09%09%09KeyPair keypair = CryptoLib.generateSignatureKeyPair();%0A%09%09%09this.signKey = copyOf(keypair.privateKey);%0A%09%09%09this.verifKey = copyOf(keypair.publicKey);%0A%09%09%7D%0A%0A%09%09public byte%5B%5D sign(byte%5B%5D message) %7B%0A%09%09%09byte%5B%5D signature = CryptoLib.sign(copyOf(message), copyOf(signKey));%0A%09%09%09return copyOf(copyOf(signature));%0A%09%09%7D%0A%0A%09%09public Verifier getVerifier() %7B%0A%09%09%09return new Verifier(verifKey);%0A%09%09%7D%0A%09%7D%0A%0A%09public static Signer register(byte%5B%5D id) %7B%0A%09%09// TODO: implement%0A%09%09return null;%0A%09%7D%0A%0A%09public static Verifier getVerifier(byte%5B%5D id) %7B%0A%09%09// TODO: implement%0A%09%09return null;%0A%09%7D%0A%7D%0A

add real funcionality for PKISig