> ## Documentation Index
> Fetch the complete documentation index at: https://docs.truthlocks.com/llms.txt
> Use this file to discover all available pages before exploring further.

# DID & JWKS-Erkennung

> Lösen Sie Ausstelleridentitäten und öffentliche Schlüssel mithilfe von Standard-Discovery-Protokollen auf.

Truthlocks bietet öffentliche Endpunkte zur Auflösung von Ausstelleridentitäten mithilfe von W3C Decentralized Identifiers (DIDs) und zum Abrufen von Signaturschlüsseln über JSON Web Key Sets (JWKS). Diese Endpunkte ermöglichen eine standardbasierte Schlüsselüberprüfung ohne proprietäre Integrationen.

## DID-Auflösung

Jeder Aussteller hat eine DID im Format `did:truthlock:{issuer_id}`, die zu einem W3C DID-Dokument aufgelöst wird, das seine öffentlichen Schlüsselmaterialien und Dienstendpunkte enthält. DIDs werden automatisch zugewiesen, wenn ein Aussteller erstellt wird.

### Endpunkt

```text theme={null}
GET /v1/public/did/{did}
```

Keine Authentifizierung erforderlich. Antworten werden für 1 Stunde zwischengespeichert.

### Beispielanfrage

```bash theme={null}
curl https://api.truthlocks.com/v1/public/did/did:truthlock:iss_p4q5r6
```

### Beispielantwort

```json theme={null}
{
  "@context": [
    "https://www.w3.org/ns/did/v1",
    "https://w3id.org/security/suites/jws-2020/v1"
  ],
  "id": "did:truthlock:iss_p4q5r6",
  "controller": "did:truthlock:iss_p4q5r6",
  "verificationMethod": [
    {
      "id": "did:truthlock:iss_p4q5r6#key-1",
      "type": "Ed25519VerificationKey2020",
      "controller": "did:truthlock:iss_p4q5r6",
      "publicKeyJwk": {
        "kty": "OKP",
        "crv": "Ed25519",
        "x": "base64url-encoded-public-key",
        "kid": "key-1",
        "alg": "ed25519"
      }
    }
  ],
  "authentication": ["did:truthlock:iss_p4q5r6#key-1"],
  "assertionMethod": ["did:truthlock:iss_p4q5r6#key-1"],
  "service": [
    {
      "id": "did:truthlock:iss_p4q5r6#verification",
      "type": "TruthlockVerification",
      "serviceEndpoint": "https://api.truthlocks.com/v1/verify"
    },
    {
      "id": "did:truthlock:iss_p4q5r6#portfolio",
      "type": "TruthlockPortfolio",
      "serviceEndpoint": "https://verify.truthlocks.com/portfolio"
    }
  ]
}
```

Die Antwort verwendet `Content-Type: application/did+json`.

### Typen von Verifizierungsmethoden

Der Schlüsseltyp im DID-Dokument hängt vom Signaturalgorithmus des Ausstellers ab:

| Algorithmus | Verifizierungstyp | JWK-Schlüsseltyp | Kurve |
| - | - | - | - |
| Ed25519 | `Ed25519VerificationKey2020` | `OKP` | `Ed25519` |
| ES256 | `JsonWebKey2020` | `EC` | `P-256` |
| RS256 | `JsonWebKey2020` | `RSA` | — |

## JWKS-Endpunkt

Rufen Sie alle aktiven öffentlichen Schlüssel für einen Aussteller als Standard-JSON-Web-Key-Set ab.

### Endpunkt

```text theme={null}
GET /v1/public/issuers/{issuer_id}/jwks.json
```

Keine Authentifizierung erforderlich. Antworten werden für 1 Stunde zwischengespeichert.

### Beispielanfrage

```bash theme={null}
curl https://api.truthlocks.com/v1/public/issuers/iss_p4q5r6/jwks.json
```

### Beispielantwort

```json theme={null}
{
  "keys": [
    {
      "kty": "OKP",
      "crv": "Ed25519",
      "x": "base64url-encoded-public-key",
      "kid": "key-1",
      "alg": "ed25519"
    }
  ]
}
```

## Wann welcher Endpunkt verwendet werden sollte

| Anwendungsfall | Endpunkt |
| - | - |
| Ein Proof-Bundle offline mit dem Feld `issuer_did` verifizieren | DID-Auflösung |
| JWT-Signaturen von Truthlocks-Diensten validieren | JWKS |
| Erstellen Sie Integrationen, die den W3C Verifiable Credentials Standards folgen | DID-Auflösung |
| Integration mit bestehender OIDC/JWT-Infrastruktur | JWKS |

## Verwendung von DIDs in Proof-Bundles

Das Feld `issuer_certificate.issuer_did` in einem [Proof-Bundle](https://docs.truthlocks.com/de/specification/proof-bundle.md) enthält die DID des Ausstellers. Sie können diese auflösen, um den öffentlichen Schlüssel abzurufen und die Attestierungssignatur unabhängig zu verifizieren, ohne sich auf die Truthlocks-Infrastruktur zu verlassen.

## Verwandt

* [Format des Proof-Bundles](https://docs.truthlocks.com/de/specification/proof-bundle.md) – Das kryptografische Proof-Format, das auf Aussteller-DIDs verweist.
* [API für Ausstellerschlüssel](https://docs.truthlocks.com/de/api-reference/issuers/keys.md) – Verwalten von Signaturschlüsseln des Ausstellers.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.