Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
109 commits
Select commit Hold shift + click to select a range
d06cb5e
Create policy_store_dummy.cc
paritheplatypus Aug 7, 2025
17ebf8f
Create policy_store.i
paritheplatypus Aug 7, 2025
3dc96a9
Create README.md
paritheplatypus Aug 7, 2025
cd90ec6
Update README.md
paritheplatypus Aug 7, 2025
e193d60
Create javaTest.java
paritheplatypus Aug 7, 2025
1c35e42
Rename javaTest.java to test.java
paritheplatypus Aug 7, 2025
dd3b5f8
Rename SWIG/test.java to SWIG/Policy Store/test.java
paritheplatypus Aug 7, 2025
672ca45
Rename SWIG/policy_store.i to SWIG/Policy Store/policy_store.i
paritheplatypus Aug 7, 2025
63fccc1
Rename SWIG/README.md to SWIG/Policy Store/README.md
paritheplatypus Aug 7, 2025
90f0231
Rename SWIG/policy_store_dummy.cc to SWIG/Policy Store/policy_store_d…
paritheplatypus Aug 7, 2025
108a7df
Create simulated_enclave.i
paritheplatypus Aug 7, 2025
307eebd
Create test.java
paritheplatypus Aug 7, 2025
f985bb2
Create simulated_enclave_dummy.h
paritheplatypus Aug 7, 2025
8762780
Create README.md
paritheplatypus Aug 7, 2025
d72e7a7
Update README.md
paritheplatypus Aug 7, 2025
b3088b7
Update README.md
paritheplatypus Aug 7, 2025
4c88e51
Update README.md
paritheplatypus Aug 7, 2025
2290ba6
Create certifier_algorithms.h
paritheplatypus Aug 7, 2025
c725c56
Create key_wrapper.h
paritheplatypus Aug 7, 2025
0225139
Create key_wrapper.cc
paritheplatypus Aug 7, 2025
45573e9
Create key_wrapper.i
paritheplatypus Aug 7, 2025
2221cbc
Create README.md
paritheplatypus Aug 7, 2025
7b9a74d
Update README.md
paritheplatypus Aug 7, 2025
9989ca2
Create KeyWrapperTest.java
paritheplatypus Aug 7, 2025
32becfe
Update README.md
paritheplatypus Aug 7, 2025
1a0107d
Update README.md
paritheplatypus Aug 7, 2025
a88211d
Create documentation.md
paritheplatypus Aug 7, 2025
b842255
Update documentation.md
paritheplatypus Aug 7, 2025
76fe6b0
Update documentation.md
paritheplatypus Aug 7, 2025
017336d
Update documentation.md
paritheplatypus Aug 7, 2025
e2483b4
Update documentation.md
paritheplatypus Aug 7, 2025
253046e
Create claim_verifier.h
paritheplatypus Aug 14, 2025
de7fc2a
Create claim_verifier.cc
paritheplatypus Aug 14, 2025
b9c0949
Update claim_verifier.cc
paritheplatypus Aug 14, 2025
c7101b3
Create claim_verifier.i
paritheplatypus Aug 14, 2025
853f484
Create README.md
paritheplatypus Aug 14, 2025
1fc78ee
Update README.md
paritheplatypus Aug 14, 2025
bad2344
Create claimVerifierTest.java
paritheplatypus Aug 14, 2025
8e93e48
Rename documentation.md to AWS-documentation.md
paritheplatypus Aug 14, 2025
965ad88
Rename SWIG/Certifier Algorithms/KeyWrapperTest.java to src/java/Cert…
paritheplatypus Aug 18, 2025
0efcedf
Rename SWIG/Certifier Algorithms/certifier_algorithms.h to src/java/C…
paritheplatypus Aug 18, 2025
3145ae6
Rename SWIG/Certifier Algorithms/README.md to src/java/Certifier Algo…
paritheplatypus Aug 18, 2025
6b1fc0e
Rename key_wrapper.cc to key_wrapper.cc
paritheplatypus Aug 18, 2025
922f8f8
Rename src/Certifier Algorithms/key_wrapper.cc to src/java/Certifier …
paritheplatypus Aug 18, 2025
54ac7f2
Rename SWIG/Certifier Algorithms/key_wrapper.h to SWIG/java/Certifier…
paritheplatypus Aug 18, 2025
bad9fee
Rename SWIG/Certifier Algorithms/key_wrapper.i to src/java/Certifier …
paritheplatypus Aug 18, 2025
580b9e3
Rename key_wrapper.h to key_wrapper.h
paritheplatypus Aug 18, 2025
0ae6190
Rename SWIG/Claim Verifier/README.md to src/java/Claim Verifier/READM…
paritheplatypus Aug 18, 2025
8310df2
Rename SWIG/Claim Verifier/claimVerifierTest.java to src/java/Claim V…
paritheplatypus Aug 18, 2025
264a5c0
Rename SWIG/Claim Verifier/claim_verifier.cc to src/java/Claim Verifi…
paritheplatypus Aug 18, 2025
fa9564f
Rename SWIG/Claim Verifier/claim_verifier.h to src/java/Claim Verifie…
paritheplatypus Aug 18, 2025
a497f78
Rename SWIG/Claim Verifier/claim_verifier.i to src/java/Claim Verifie…
paritheplatypus Aug 18, 2025
36bfb01
Rename SWIG/Policy Store/README.md to src/java/Policy Store/README.md
paritheplatypus Aug 18, 2025
a6fde98
Rename SWIG/Policy Store/policy_store.i to src/java/Policy Store/poli…
paritheplatypus Aug 18, 2025
5f9c767
Rename SWIG/Policy Store/policy_store_dummy.cc to src/java/Policy Sto…
paritheplatypus Aug 18, 2025
a25d943
Rename SWIG/Policy Store/test.java to src/java/Policy Store/test.java
paritheplatypus Aug 18, 2025
8751bcb
Rename SWIG/Simulated Enclave/README.md to src/java/Simulated Enclave…
paritheplatypus Aug 18, 2025
386ce1c
Rename SWIG/Simulated Enclave/simulated_enclave.i to src/java/Simulat…
paritheplatypus Aug 18, 2025
c671755
Rename SWIG/Simulated Enclave/simulated_enclave_dummy.h to src/java/S…
paritheplatypus Aug 18, 2025
2de53d3
Rename SWIG/Simulated Enclave/test.java to src/java/Simulated Enclave…
paritheplatypus Aug 18, 2025
39eff17
Create instructions.md
paritheplatypus Aug 20, 2025
45d82f9
Create cf_shims.h
paritheplatypus Aug 20, 2025
b9ea6de
Create cf_shims.cc
paritheplatypus Aug 20, 2025
2cd69b7
Create trust_manager.i
paritheplatypus Aug 20, 2025
fa64077
Create secure_authenticated_channel.i
paritheplatypus Aug 20, 2025
e81d84b
Create store.i
paritheplatypus Aug 20, 2025
34e8ec6
Create TrustManager.java
paritheplatypus Aug 20, 2025
67de8db
Create SecureAuthenticatedChannel.java
paritheplatypus Aug 20, 2025
13772ad
Create Store.java
paritheplatypus Aug 20, 2025
c29ace6
Create SimpleApp.java
paritheplatypus Aug 20, 2025
9aa5f4c
Create CMakeLists.txt
paritheplatypus Aug 20, 2025
cd04cdb
Create build.gradle
paritheplatypus Aug 20, 2025
0b2d677
Update build.gradle
paritheplatypus Aug 20, 2025
b9169d5
Update CMakeLists.txt
paritheplatypus Aug 20, 2025
b44a78b
Update cf_shims.h
paritheplatypus Aug 20, 2025
cb9761c
Update instructions.md
paritheplatypus Aug 20, 2025
9ad4504
Update instructions.md
paritheplatypus Aug 20, 2025
01ab0fb
Update instructions.md
paritheplatypus Aug 20, 2025
1f01421
Update instructions.md
paritheplatypus Aug 21, 2025
adaa41d
Update instructions.md
paritheplatypus Aug 21, 2025
09db112
Update instructions.md
paritheplatypus Aug 21, 2025
18c963c
Create detect_paths.sh
paritheplatypus Aug 21, 2025
b015619
Update detect_paths.sh
paritheplatypus Aug 21, 2025
231a29b
Update detect_paths.sh
paritheplatypus Aug 26, 2025
d329c31
Update CMakeLists.txt
paritheplatypus Aug 26, 2025
9e14105
Update cf_shims.h
paritheplatypus Aug 26, 2025
9db1023
Update cf_shims.cc
paritheplatypus Aug 26, 2025
aaa7fe5
Update trust_manager.i
paritheplatypus Aug 26, 2025
32a7212
Update secure_authenticated_channel.i
paritheplatypus Aug 26, 2025
def554d
Update build.gradle
paritheplatypus Aug 26, 2025
419b29b
Update instructions.md
paritheplatypus Aug 26, 2025
357dd00
Create guide.md
paritheplatypus Aug 26, 2025
4d0ba2d
Update SimpleApp.java
paritheplatypus Sep 18, 2025
7973a2e
Create CMakeLists.txt
paritheplatypus Sep 18, 2025
ac10050
Create native-lib.cpp
paritheplatypus Sep 18, 2025
8091f2a
Create simple_core_android.cc
paritheplatypus Sep 18, 2025
91441b1
Update simple_core_android.cc
paritheplatypus Sep 18, 2025
5faff3c
Update build.gradle
paritheplatypus Sep 18, 2025
1e821be
Create settings.gradle
paritheplatypus Sep 18, 2025
dbd359a
Create build.gradle
paritheplatypus Sep 18, 2025
3d6a928
Create gradle.properties
paritheplatypus Sep 18, 2025
8305a60
Update build.gradle
paritheplatypus Sep 18, 2025
075b047
Create proguard-rules.pro
paritheplatypus Sep 18, 2025
8510b24
Create AndroidManifest.xml
paritheplatypus Sep 18, 2025
bdffffe
Create MainActivity.java
paritheplatypus Sep 18, 2025
f5c4d8b
Update SimpleApp.java
paritheplatypus Sep 18, 2025
4090c15
Update CMakeLists.txt
paritheplatypus Sep 18, 2025
d443198
Update native-lib.cpp
paritheplatypus Sep 18, 2025
4812404
Update simple_core_android.cc
paritheplatypus Sep 18, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
142 changes: 142 additions & 0 deletions Doc/AWS-documentation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
# AWS Bootcamp – Configuring an EC2 Instance

---

## 1. Introduction to AWS

### What is AWS?
Amazon Web Services (AWS) is a comprehensive cloud computing platform offering a wide range of services, including computing power, storage, networking, databases, analytics, and machine learning. AWS enables organizations and individuals to deploy applications and services without the need for physical hardware.

### Why Use AWS?
- **Cost Efficiency** – Pay only for the resources you use.
- **Scalability** – Easily scale resources up or down to meet demand.
- **Global Reach** – Deploy resources in multiple geographic regions.
- **Security** – Enterprise-grade security with compliance certifications.

---

## 2. Key AWS Concepts

- **Region** – A geographical area containing AWS data centers. Selecting the correct region can optimize performance, reduce costs, and ensure compliance with data regulations.
- **Availability Zone (AZ)** – One or more isolated data centers within a region, providing redundancy and fault tolerance.
- **Service** – An AWS feature or capability (e.g., EC2 for compute, S3 for storage).
- **EC2 (Elastic Compute Cloud)** – A service that provides resizable virtual servers.
- **Instance** – A single virtual server running on AWS EC2.
- **AMI (Amazon Machine Image)** – A pre-configured template containing an operating system and optional software, used to launch an EC2 instance.

---

## 3. Prerequisites

- An active AWS account ([Create one here](https://aws.amazon.com))
- A laptop or desktop computer with internet access
- For connection via terminal: basic familiarity with command-line tools (optional)

---

## 4. Step-by-Step: Launching a Standard EC2 Instance

**Objective:** Deploy a virtual server on AWS.

### Step 1: Log in to the AWS Management Console
1. Navigate to [AWS Console](https://aws.amazon.com/console)
2. Sign in using your AWS credentials.

### Step 2: Access the EC2 Service
1. In the search bar at the top of the AWS Console, type `EC2`.
2. Select **EC2** from the search results to access the EC2 dashboard.

### Step 3: Launch a New Instance
1. Click **Launch Instance**.
2. Under **Name and tags**, provide a descriptive name for your instance (e.g., `myCertifierServer`).

### Step 4: Select an AMI (Operating System)
- Recommended: **Amazon Linux 2 AMI** or **Ubuntu 20.04 LTS**.

### Step 5: Choose an Instance Type
- For initial testing and free-tier eligibility, select **t2.micro**.

### Step 6: Create a Key Pair (For Secure Login)
1. Under **Key pair (login)**, select **Create new key pair**.
2. Provide a name (e.g., `mykeypair`).
3. Choose file format:
- **PEM** for macOS/Linux
- **PPK** for Windows (PuTTY)
4. Download the file and store it securely — this is required for SSH access.

### Step 7: Configure Network Settings (Security Group)
1. Allow **SSH (port 22)** access from your IP address for secure terminal access.
2. If hosting a website, also allow **HTTP (port 80)** and **HTTPS (port 443)**.

### Step 8: Launch the Instance
- Review all configurations and click **Launch Instance**.
- Wait until the **Instance state** changes to **Running**.

---

## 5. Connecting to Your Instance

### Locate the Public IP Address
1. From the EC2 dashboard, select your instance.
2. Under **Details**, locate the **Public IPv4 address**.

### macOS/Linux Connection
```bash
chmod 400 mykeypair.pem
ssh -i mykeypair.pem ec2-user@<YourPublicIP>
```
*(Replace `<YourPublicIP>` with your instance’s public IP address)*

### Windows Connection
- Convert `.pem` to `.ppk` using PuTTYgen.
- Open PuTTY, enter your instance’s public IP, and configure the private key in the **SSH > Auth** section.
- Click **Open** to initiate the connection.

---

## 6. Managing Your Instance
- **Stop** – Powers off the instance without deleting it (no compute charges while stopped).
- **Start** – Powers the instance back on.
- **Terminate** – Permanently deletes the instance.

---

## 7. Advanced Topic: Secure Encrypted Virtualization (SEV)

### Overview
SEV (Secure Encrypted Virtualization) is an AMD technology that encrypts the memory of an EC2 instance, ensuring that even the hypervisor cannot access it. This feature is part of AWS’s Confidential Computing offerings.

### Benefits of SEV
- Enhanced data security during processing
- Protection against unauthorized access, even from privileged system components
- Ideal for industries with strict compliance requirements, such as finance and healthcare

### Launching an SEV-Enabled Instance
1. Follow the same procedure as launching a standard EC2 instance.
2. In **Step 5 (Choose Instance Type)**, select an AMD SEV-compatible instance type:
- General Purpose: `m6a`
- Compute Optimized: `c6a`
- Memory Optimized: `r6a`

### Verifying SEV in Your Instance
Once connected via SSH, run:
```bash
dmesg | grep -i sev
lscpu | grep -i sev
```
If SEV is enabled, references to SEV will appear in the output.

---

## 8. Best Practices
- Choose the AWS Region closest to your users for optimal latency and compliance.
- Secure AWS credentials and enable MFA.
- Stop or terminate unused instances to avoid unnecessary charges.
- Use IAM roles rather than embedding credentials in applications.

---

## 9. References
- [AWS EC2 Documentation](https://docs.aws.amazon.com/ec2/)
- [AWS Free Tier Information](https://aws.amazon.com/free)
- [AWS AMD SEV Overview](https://aws.amazon.com/ec2/amd/)
57 changes: 57 additions & 0 deletions sample_apps/simple_app_java/app/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
plugins {
id 'com.android.application'
}

android {
namespace 'com.example.certifier'
compileSdk 35

defaultConfig {
applicationId "com.example.certifier"
minSdk 24
targetSdk 35
versionCode 1
versionName "1.0"

// NDK ABIs
ndk { abiFilters "arm64-v8a" } // add "x86_64" if you want emulator

// CMake/NDK config
externalNativeBuild {
cmake {
cppFlags "-std=c++17 -fexceptions -frtti"
// When you want to link the real Certifier repo directly:
// arguments "-DCERTIFIER_ROOT=/absolute/path/to/certifier-framework-for-confidential-computing"
}
}
}

buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'),
'proguard-rules.pro'
}
debug { minifyEnabled false }
}

// Point to CMakeLists.txt
externalNativeBuild {
cmake { path "src/main/cpp/CMakeLists.txt" }
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}

buildFeatures {
buildConfig true
}
}

dependencies {
implementation 'androidx.appcompat:appcompat:1.7.0'
implementation 'com.google.android.material:material:1.12.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
}
1 change: 1 addition & 0 deletions sample_apps/simple_app_java/app/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# will remain empty for now
20 changes: 20 additions & 0 deletions sample_apps/simple_app_java/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.certifier">

<!-- Uncomment if you do networking (client/server) -->
<!-- <uses-permission android:name="android.permission.INTERNET" /> -->

<application
android:label="Certifier Demo"
android:supportsRtl="true"
android:allowBackup="true">
<activity
android:name=".MainActivity"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
</application>
</manifest>
16 changes: 16 additions & 0 deletions sample_apps/simple_app_java/app/src/main/cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
cmake_minimum_required(VERSION 3.18)
project(certifier_android LANGUAGES C CXX)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)

add_library(certifier_native SHARED
native-lib.cpp
simple_core_android.cc
# Later: add Certifier framework sources here or via CERTIFIER_ROOT
)

find_library(log-lib log)
target_link_libraries(certifier_native ${log-lib})
target_compile_options(certifier_native PRIVATE -fexceptions -frtti)
30 changes: 30 additions & 0 deletions sample_apps/simple_app_java/app/src/main/cpp/native-lib.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#include <jni.h>
#include <string>

std::string run_certifier_simple(const std::string& workDir,
const std::string& mode,
const std::string& host,
int port);

extern "C"
JNIEXPORT jstring JNICALL
Java_org_certifier_examples_SimpleApp_runCertifierNative(
JNIEnv* env, jclass /*clazz*/,
jstring jWorkDir, jstring jMode, jstring jHost, jint jPort) {

const char* w = env->GetStringUTFChars(jWorkDir, nullptr);
const char* m = env->GetStringUTFChars(jMode, nullptr);
const char* h = env->GetStringUTFChars(jHost, nullptr);

std::string work = w ? w : "";
std::string mode = m ? m : "";
std::string host = h ? h : "";
int port = static_cast<int>(jPort);

if (w) env->ReleaseStringUTFChars(jWorkDir, w);
if (m) env->ReleaseStringUTFChars(jMode, m);
if (h) env->ReleaseStringUTFChars(jHost, h);

std::string result = run_certifier_simple(work, mode, host, port);
return env->NewStringUTF(result.c_str());
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#include <string>
#include <sstream>
#include <android/log.h>

#define LOGI(...) __android_log_print(ANDROID_LOG_INFO, "CertifierJNI", __VA_ARGS__)
#define LOGE(...) __android_log_print(ANDROID_LOG_ERROR, "CertifierJNI", __VA_ARGS__)

// Later you'll include Certifier headers and call its API.
// #include "..." // from your local copy or from CERTIFIER_ROOT/include

std::string run_certifier_simple(const std::string& workDir,
const std::string& mode,
const std::string& host,
int port) {
LOGI("run_certifier_simple(workDir=%s, mode=%s, host=%s, port=%d)",
workDir.c_str(), mode.c_str(), host.c_str(), port);

// TODO: Copy assets to workDir (policy/keys), then call TrustManager, etc.
std::ostringstream out;
out << "Certifier native OK\n"
<< "mode=" << mode << " host=" << host << " port=" << port << "\n"
<< "workDir=" << workDir;
return out.str();
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package com.example.certifier;

import android.os.Bundle;
import android.widget.TextView;
import androidx.appcompat.app.AppCompatActivity;
import org.certifier.examples.SimpleApp;

public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);

String workDir = getFilesDir().getAbsolutePath(); // place assets here later if needed
String result = SimpleApp.runCertifier(workDir); // default client 127.0.0.1:8080

TextView tv = new TextView(this);
tv.setTextSize(16f);
tv.setPadding(32, 64, 32, 32);
tv.setText(result);
setContentView(tv);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
package org.certifier;

import java.nio.charset.StandardCharsets;

public class SecureAuthenticatedChannel {
static {
System.loadLibrary("certifier_jni");
}

public SecureAuthenticatedChannel() {}

public native void close();
public native int read(byte[] buffer); // returns bytes read
public native int write(byte[] data); // returns bytes written
public native boolean init_client_ssl(String serverAddr, int port);

private static native int cf_channel_peer_id(long nativePtr, byte[] out, int outLen);
private static native int cf_channel_peer_cert(long nativePtr, byte[] out, int outLen);

private transient long swigCPtr;

public String getPeerId() {
byte[] buf = new byte[256];
int n = cf_channel_peer_id(this.swigCPtr, buf, buf.length);
if (n <= 0) return "";
return new String(buf, 0, n, StandardCharsets.UTF_8);
}

public byte[] getPeerCert() {
byte[] buf = new byte[4096];
int n = cf_channel_peer_cert(this.swigCPtr, buf, buf.length);
if (n <= 0) return new byte[0];
byte[] out = new byte[n];
System.arraycopy(buf, 0, out, 0, n);
return out;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package org.certifier;

public class Store {
static {
System.loadLibrary("certifier_jni");
}

public Store() {}

public native long get_num_entries();
public native int find_entry(String tag, String type);
public native String tag(long ent);
public native String type(long ent);
public native long get_entry(long ent);
public native boolean delete_entry(long ent);
public native boolean update_or_insert(String tag, String type, String value);
public native void print();
}
Loading