initialize the repository

master
Reto Cavegn 2 years ago
commit 327fa5b1c5
  1. 7
      .classpath
  2. 2
      .gitignore
  3. BIN
      .pEp/keys.db
  4. BIN
      .pEp/keys.db-shm
  5. BIN
      .pEp/keys.db-wal
  6. BIN
      .pEp/management.db
  7. BIN
      .pEp/management.db-shm
  8. BIN
      .pEp/management.db-wal
  9. 17
      .project
  10. 12
      .settings/org.eclipse.jdt.core.prefs
  11. 49
      bin/foundation/pEp/jniadapter/test/reto/example/Makefile
  12. 49
      bin/foundation/pEp/jniadapter/test/reto/firsttest/Makefile
  13. 19
      src/foundation/pEp/jniadapter/test/reto/example/HelloWorld.java
  14. 49
      src/foundation/pEp/jniadapter/test/reto/example/Makefile
  15. 57
      src/foundation/pEp/jniadapter/test/reto/firsttest/FirstTest.java
  16. 49
      src/foundation/pEp/jniadapter/test/reto/firsttest/Makefile

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="lib" path="lib/pEpJNIAdapter/lib/pEp.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>

2
.gitignore vendored

@ -0,0 +1,2 @@
/lib
*.class

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>HelloWorldEclipse</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>

@ -0,0 +1,12 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.release=disabled
org.eclipse.jdt.core.compiler.source=1.8

@ -0,0 +1,49 @@
JAVA_PKG_BASENAME=foundation.pEp.jniadapter.test.reto
JAVA_PKG_BASEPATH=foundation/pEp/jniadapter/test/reto
JAVA_CWD=../../../../../../
PRJ_ROOT=../
ADAPTER_LIB_PATH=$(PRJ_ROOT)/lib/pEpJNIAdapter/lib
PEPJAR=$(ADAPTER_LIB_PATH)/pEp.jar
JAVA_PEP_HOME_DIR=/tmp
PEP_HOME_DIR=/tmp
CLASSPATH=$(PEPJAR):.
JAVA=java -enableassertions -Xcheck:jni -cp $(CLASSPATH) -Djava.library.path=$(ADAPTER_LIB_PATH)
PLATFORM:=$(shell uname | tr A-Z a-z)
ifeq ($(PLATFORM),linux)
ifndef LD_LIBRARY_PATH
export LD_LIBRARY_PATH=$(ADAPTER_LIB_PATH)
endif
else ifeq ($(PLATFORM),darwin)
ifndef DYLD_LIBRARY_PATH
export DYLD_LIBRARY_PATH=$(ADAPTER_LIB_PATH)
endif
endif
# Change "example" to packagename of test
TEST_UNIT_NAME=example
JAVA_CLASSES = \
HelloWorld.class
.PHONY: compile test clean
all: compile test
test: compile
# Change "HelloWorld" to Classname
cd $(JAVA_CWD);pwd;HOME=$(JAVA_PEP_HOME_DIR) $(JAVA) $(JAVA_PKG_BASENAME).$(TEST_UNIT_NAME).HelloWorld
compile: $(JAVA_CLASSES)
%.class: %.java
cd $(JAVA_CWD);javac -cp $(CLASSPATH) $(JAVA_PKG_BASEPATH)/$(TEST_UNIT_NAME)/$<
clean:
rm -f $(JAVA_CLASSES)
rm -f *.class

@ -0,0 +1,49 @@
JAVA_PKG_BASENAME=foundation.pEp.jniadapter.test.reto
JAVA_PKG_BASEPATH=foundation/pEp/jniadapter/test/reto
JAVA_CWD=../../../../../../
PRJ_ROOT=../
ADAPTER_LIB_PATH=$(PRJ_ROOT)/lib/pEpJNIAdapter/lib
PEPJAR=$(ADAPTER_LIB_PATH)/pEp.jar
JAVA_PEP_HOME_DIR=/tmp
PEP_HOME_DIR=/tmp
CLASSPATH=$(PEPJAR):.
JAVA=java -enableassertions -Xcheck:jni -cp $(CLASSPATH) -Djava.library.path=$(ADAPTER_LIB_PATH)
PLATFORM:=$(shell uname | tr A-Z a-z)
ifeq ($(PLATFORM),linux)
ifndef LD_LIBRARY_PATH
export LD_LIBRARY_PATH=$(ADAPTER_LIB_PATH)
endif
else ifeq ($(PLATFORM),darwin)
ifndef DYLD_LIBRARY_PATH
export DYLD_LIBRARY_PATH=$(ADAPTER_LIB_PATH)
endif
endif
# Change "example" to packagename of test
TEST_UNIT_NAME=example
JAVA_CLASSES = \
HelloWorld.class
.PHONY: compile test clean
all: compile test
test: compile
# Change "HelloWorld" to Classname
cd $(JAVA_CWD);pwd;HOME=$(JAVA_PEP_HOME_DIR) $(JAVA) $(JAVA_PKG_BASENAME).$(TEST_UNIT_NAME).HelloWorld
compile: $(JAVA_CLASSES)
%.class: %.java
cd $(JAVA_CWD);javac -cp $(CLASSPATH) $(JAVA_PKG_BASEPATH)/$(TEST_UNIT_NAME)/$<
clean:
rm -f $(JAVA_CLASSES)
rm -f *.class

@ -0,0 +1,19 @@
package foundation.pEp.jniadapter.test.reto.example;
import foundation.pEp.jniadapter.*;
class HelloWorld {
public static void main(String[] args) {
System.out.println("hello world");
Engine engine = new Engine();
System.out.println("Version: "+engine.getVersion());
System.out.println("UserDirectory: "+engine.getUserDirectory());
System.out.println("MachineDirectory"+engine.getMachineDirectory());
System.out.println("ProtocolVersion"+engine.getProtocolVersion());
System.out.println("\n\n");
engine.close();
}
}

@ -0,0 +1,49 @@
JAVA_PKG_BASENAME=foundation.pEp.jniadapter.test.reto
JAVA_PKG_BASEPATH=foundation/pEp/jniadapter/test/reto
JAVA_CWD=../../../../../../
PRJ_ROOT=../
ADAPTER_LIB_PATH=$(PRJ_ROOT)/lib/pEpJNIAdapter/lib
PEPJAR=$(ADAPTER_LIB_PATH)/pEp.jar
JAVA_PEP_HOME_DIR=/tmp
PEP_HOME_DIR=/tmp
CLASSPATH=$(PEPJAR):.
JAVA=java -enableassertions -Xcheck:jni -cp $(CLASSPATH) -Djava.library.path=$(ADAPTER_LIB_PATH)
PLATFORM:=$(shell uname | tr A-Z a-z)
ifeq ($(PLATFORM),linux)
ifndef LD_LIBRARY_PATH
export LD_LIBRARY_PATH=$(ADAPTER_LIB_PATH)
endif
else ifeq ($(PLATFORM),darwin)
ifndef DYLD_LIBRARY_PATH
export DYLD_LIBRARY_PATH=$(ADAPTER_LIB_PATH)
endif
endif
# Change "example" to packagename of test
TEST_UNIT_NAME=example
JAVA_CLASSES = \
HelloWorld.class
.PHONY: compile test clean
all: compile test
test: compile
# Change "HelloWorld" to Classname
cd $(JAVA_CWD);pwd;HOME=$(JAVA_PEP_HOME_DIR) $(JAVA) $(JAVA_PKG_BASENAME).$(TEST_UNIT_NAME).HelloWorld
compile: $(JAVA_CLASSES)
%.class: %.java
cd $(JAVA_CWD);javac -cp $(CLASSPATH) $(JAVA_PKG_BASEPATH)/$(TEST_UNIT_NAME)/$<
clean:
rm -f $(JAVA_CLASSES)
rm -f *.class

@ -0,0 +1,57 @@
package foundation.pEp.jniadapter.test.reto.firsttest;
import java.util.Vector;
import foundation.pEp.jniadapter.*;
import foundation.pEp.jniadapter.Message.Direction;
import foundation.pEp.jniadapter.Message.EncFormat;
class FirstTest {
public static void main(String[] args) {
System.out.println("firsttest");
Engine engine = new Engine();
System.out.println(engine.getUserDirectory());
Identity alice = new Identity();
alice.address = "alice@peptest.ch";
alice.username = "Alice";
alice.user_id = "23";
System.out.println(alice.fpr);
alice = engine.myself(alice);
System.out.println(alice.fpr);
String trw = engine.trustwords(alice);
System.out.print(trw);
Identity bob = new Identity();
bob.address = "bob@peptest.ch";
bob.username = "Bob";
bob.user_id = "37";
bob = engine.myself(bob);
Vector<Identity> vID = new Vector();
vID.add(bob);
Message msg = new Message();
msg.setFrom(alice);
msg.setTo(vID);
msg.setLongmsg("Hallo Firsttest");
msg.setDir(Direction.Outgoing);
Message enc = engine.encrypt_message(msg,null,EncFormat.PEP);
System.out.println(enc.getLongmsg());
engine.decrypt_message(enc, null, 0);
System.out.println(enc.getLongmsg());
}
}

@ -0,0 +1,49 @@
JAVA_PKG_BASENAME=foundation.pEp.jniadapter.test.reto
JAVA_PKG_BASEPATH=foundation/pEp/jniadapter/test/reto
JAVA_CWD=../../../../../../
PRJ_ROOT=../
ADAPTER_LIB_PATH=$(PRJ_ROOT)/lib/pEpJNIAdapter/lib
PEPJAR=$(ADAPTER_LIB_PATH)/pEp.jar
JAVA_PEP_HOME_DIR=/tmp
PEP_HOME_DIR=/tmp
CLASSPATH=$(PEPJAR):.
JAVA=java -enableassertions -Xcheck:jni -cp $(CLASSPATH) -Djava.library.path=$(ADAPTER_LIB_PATH)
PLATFORM:=$(shell uname | tr A-Z a-z)
ifeq ($(PLATFORM),linux)
ifndef LD_LIBRARY_PATH
export LD_LIBRARY_PATH=$(ADAPTER_LIB_PATH)
endif
else ifeq ($(PLATFORM),darwin)
ifndef DYLD_LIBRARY_PATH
export DYLD_LIBRARY_PATH=$(ADAPTER_LIB_PATH)
endif
endif
# Change "example" to packagename of test
TEST_UNIT_NAME=example
JAVA_CLASSES = \
HelloWorld.class
.PHONY: compile test clean
all: compile test
test: compile
# Change "HelloWorld" to Classname
cd $(JAVA_CWD);pwd;HOME=$(JAVA_PEP_HOME_DIR) $(JAVA) $(JAVA_PKG_BASENAME).$(TEST_UNIT_NAME).HelloWorld
compile: $(JAVA_CLASSES)
%.class: %.java
cd $(JAVA_CWD);javac -cp $(CLASSPATH) $(JAVA_PKG_BASEPATH)/$(TEST_UNIT_NAME)/$<
clean:
rm -f $(JAVA_CLASSES)
rm -f *.class
Loading…
Cancel
Save