ShieldCam
REST API v1

API-Dokumentation

Integrieren Sie faelschungssichere Foto-Dokumentation in Ihre Anwendung. Ankern, verifizieren und pruefen Sie Beweisketten ueber unsere REST-API.

Base URL
https://ki-shield.de/shieldcam/api/v1

Authentifizierung

Geschuetzte Endpoints erfordern einen API-Key im X-API-Key Header. API-Keys werden serverseitig als SHA-256-Hash gespeichert.

Beispiel
# API-Key im Header mitsenden
curl -H "X-API-Key: IHR_API_KEY" \
  https://ki-shield.de/shieldcam/api/v1/health

Endpoints

POST /api/v1/chain/anchor API Key

Verankert ein Foto als Beweis in der Kette. Erstellt PQ-Signatur, RFC-3161-Zeitstempel und Blockchain-Transaktion.

Request Body

{
  "image_hash": "a3f8c2d1e5b74f8a...64 hex chars",
  "signature_hex": "ed25519_signature_hex",
  "public_key_hex": "device_public_key_hex",
  "chain_hash": "combined_chain_hash",
  "chain_index": 33,
  "previous_hash": "previous_chain_hash",
  "device_id": "iPhone-15-Pro-ABC"
}

Response (201)

{
  "id": 33,
  "image_hash": "a3f8c2d1...",
  "chain_index": 33,
  "pq_signature": "base64...",
  "timestamp_token": "base64...",
  "tx_hash": "0x7a2f...",
  "tx_status": "confirmed",
  "anchored_at": "2026-03-22T15:30:00Z"
}
GET /api/v1/chain/verify/{image_hash} Oeffentlich

Verifiziert die Authentizitaet eines Fotos. Prueft PQ-Signatur, Chain-Integritaet und Blockchain-Verankerung. Keine Authentifizierung erforderlich.

Response (200)

{
  "found": true,
  "chain_index": 32,
  "chain_hash": "a7f2c8...",
  "pq_verified": true,
  "tx_hash": "0x7a2f...",
  "tx_status": "confirmed",
  "anchored_at": "2026-03-20T10:15:00Z",
  "public_key_hex": "device_key..."
}
POST /api/v1/timestamp API Key

Erstellt einen RFC 3161 Zeitstempel fuer einen SHA-256 Hash.

Request

{ "hash": "sha256..." }

Response

{ "timestamp_token": "base64..." }

Weitere oeffentliche Endpoints

GET /api/v1/chain/all/{public_key_hex} Gesamte Kette eines Geraets
GET /api/v1/pq/info Post-Quantum Algorithmus-Info
GET /api/v1/pq/verify/{image_hash} PQ-Signatur pruefen
GET /api/v1/pq/registration PQ-Key On-Chain Status
GET /api/v1/polygon/status Wallet-Balance und Status
GET /api/v1/polygon/verify/{image_hash} Blockchain-Verankerung pruefen
GET /api/v1/stats Statistiken
GET /api/v1/health Health Check

Code-Beispiele

Foto anchoren

curl -X POST \
  https://ki-shield.de/shieldcam/api/v1/chain/anchor \
  -H "Content-Type: application/json" \
  -H "X-API-Key: IHR_API_KEY" \
  -d '{
    "image_hash": "a3f8c2d1...",
    "signature_hex": "ed25519_sig...",
    "public_key_hex": "device_key...",
    "chain_hash": "chain_hash...",
    "chain_index": 33,
    "previous_hash": "prev_hash...",
    "device_id": "iPhone-15-Pro"
  }'

Foto verifizieren

curl https://ki-shield.de/shieldcam/api/v1/chain/verify/a3f8c2d1...
import requests
import hashlib

# Foto-Hash berechnen
with open("foto.jpg", "rb") as f:
    image_hash = hashlib.sha256(f.read()).hexdigest()

# Anchoren
resp = requests.post(
    "https://ki-shield.de/shieldcam/api/v1/chain/anchor",
    headers={"X-API-Key": "IHR_API_KEY"},
    json={
        "image_hash": image_hash,
        "signature_hex": sign(image_hash),
        "public_key_hex": public_key,
        "chain_hash": compute_chain_hash(),
        "chain_index": next_index,
        "previous_hash": prev_hash,
    }
)
print(resp.json())

# Verifizieren (kein API-Key noetig)
verify = requests.get(
    f"https://ki-shield.de/shieldcam/api/v1/chain/verify/{image_hash}"
)
print(verify.json())
// Foto verifizieren
const hash = "a3f8c2d1...";
const res = await fetch(
  `https://ki-shield.de/shieldcam/api/v1/chain/verify/${hash}`
);
const data = await res.json();
console.log(data.pq_verified); // true
console.log(data.tx_hash);      // "0x7a2f..."

// Foto anchoren
const anchor = await fetch(
  "https://ki-shield.de/shieldcam/api/v1/chain/anchor",
  {
    method: "POST",
    headers: {
      "Content-Type": "application/json",
      "X-API-Key": "IHR_API_KEY",
    },
    body: JSON.stringify({
      image_hash, signature_hex, public_key_hex,
      chain_hash, chain_index, previous_hash,
    }),
  }
);
console.log(await anchor.json());

Integrations-Leitfaden

1

API-Key anfordern

Registrieren Sie sich bei kishieldcam.de oder ueber die iOS-App.

2

SHA-256 berechnen

Berechnen Sie den SHA-256-Hash der Fotodatei auf dem Client.

3

Ed25519 signieren

Signieren Sie den Hash mit dem Geraete-Schlussel (Ed25519).

4

POST /chain/anchor

Senden Sie Hash, Signatur und Chain-Daten an den Anchor-Endpoint.

5

TX-Hash speichern

Speichern Sie den zurueckgegebenen Polygon TX-Hash fuer spaetere Verifikation.

Rate Limits

Starter10 / Tag
Professional500 / Tag
EnterpriseCustom

Fehlercodes

400Ungueltiger Request
401Kein/ungueltiger API-Key
404Hash nicht gefunden
409Hash bereits registriert
429Rate Limit erreicht
500Server-Fehler