---
# System prepended metadata

title: Verifiable Credential for Identity
tags: [im4dec]

---

# Verifiable Credential for RegAPI Identity

### Context
* an identity plugin creates a VC upon confirming the identity
  * SMS Plugin
  * ID Austria Plugin
* the VC is provided together with SIP credentials at the end of the onboarding to the client (encrypted with the public key of the user)
* the client creates a Verifiable Presentation from the VC and stores it locally (e.g., on the phone together with SIP credentials)
* the VP is provided in an emergency communication
    * [ETSI Standard](https://www.etsi.org/deliver/etsi_ts/103600_103699/103698/01.01.01_60/ts_103698v010101p.pdf) (section 6.1.2.11)
    * Issuer: DEC112
    * Holder: User
    * Verifier: Control Room

## SMS Plugin

#### Payload
```json=
{
  "timestamp-code-sent-to-user": integer,
  "sms-provider": string,
  "phone-number: string,
  "timestamp-code-received-from-user": integer,
  "tsr-hash": string,
  "tsr-base64": string
}
```

## ID Austria Plugin

#### Payload
```json=
{
  "timestamp-id-austria-initiated": integer,
  "id-austria-url": string,
  "timestamp-id-austria-issued": integer,
  "id-austria-attributes": {
    "Vorname": string,
    "Nachname": string,
    "Geburtsdatum": string,
    "Meldeadresse": {
      "Gemeindekennziffer": string,
      "Gemeindebezeichnung": string,
      "Postleitzahl": string,
      "Ortschaft": string,
      "Strasse": string,
      "Hausnummer": string,
      "Stiege": string,
      "Tuer": string
    },
    "Signaturzertifikat:" string
  },
  "tsr-hash": string,
  "tsr-base64": string
}
```

## Helper

### Timestamping Service FreeTSA.org

Note: ensure input hash is normalized JSON according to [RFC8785](https://datatracker.ietf.org/doc/html/rfc8785) (JSON Canonicalization Scheme)

```bash=
# input is a sha256 hex-encoded hash, example:
# 6a47c31b7b7c3b9a1dbc960669f4674ce088c8fc9d9a4f7e9fcc3f6a81f7b86c
echo '{"hello":"world"}' | openssl dgst -sha256

# create TSR (TimeStampResponse) for given hash and base64 encode
openssl ts -query -data \
  <(echo -n "6a47c31b7b7c3b9a1dbc960669f4674ce088c8fc9d9a4f7e9fcc3f6a81f7b86c") \
  -no_nonce -sha512 -cert 2>/dev/null | \
curl -s -H "Content-Type: application/timestamp-query" \
  --data-binary @- https://freetsa.org/tsr | \
base64 -w 0

# human-readable output (assume base64 encoded data in file.tsr.enc)
openssl ts -reply -in <(cat file.tsr.enc | base64 --decode) -text 2>/dev/null

# validate TimeStampeResponse with original data (assume data in file.tsr.enc)
openssl ts -verify -in <(cat file.tsr.enc | base64 --decode) \
  -queryfile <(openssl ts -query -data \
  <(echo -n "6a47c31b7b7c3b9a1dbc960669f4674ce088c8fc9d9a4f7e9fcc3f6a81f7b86c") \
  -no_nonce -sha512 -cert 2>/dev/null) \
  -CAfile cacert.pem -untrusted tsa.crt 2>/dev/null
  
# get cacert.pem and tsa.crt from freetsa.org
wget https://freetsa.org/files/tsa.crt
wget https://freetsa.org/files/cacert.pem
```

### Create Verifiable Credential
```bash=
echo payload.json |
oydid vc-push \
    --issuer did:oyd:zQmefAYBcTqEizzQ1k4F7NYDjyPVqhmKWC1JBUqy5XEjKnQ \
    --doc-pwd decpwd \
    --holder did:oyd:**user**
```

### Example Verifiable Credential
```jsonld=
{
  "@context": [
    "https://www.w3.org/ns/credentials/v2"
  ],
  "type": [
    "VerifiableCredential"
  ],
  "issuer": "did:oyd:zQmefAYBcTqEizzQ1k4F7NYDjyPVqhmKWC1JBUqy5XEjKnQ",
  "issuanceDate": "2023-10-18T23:03:17Z",
  "credentialSubject": {
    "id": "did:oyd:zQmWwtUAbJHtd2wRU5GnR3wYWrt7vBQQ7U1GPK12tEvvKtU",
    "timestamp-code-sent-to-user": 1697668448,
    "sms-provider": "https://www.firmensms.at/gateway/senden.php",
    "phone-number": "004366412345678",
    "timestamp-code-received-from-user": 1697668476,
    "tsr_hash": "f530d4f6473fc5089795d72c68974f102f626d01ab707846d5199b4ab64d6a37",
    "tsr_base64": "MIIVcjADAgEAMIIVaQYJKoZIhvcNAQcCoIIVWjCCFVYCAQMxDzANBglghkgBZQMEAgMFADCCAaQGCyqGSIb3DQEJEAEEoIIBkwSCAY8wggGLAgEBBgQqAwQBMFEwDQYJYIZIAWU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PGuLe+5mdswDNNO0muNPXJ2Lh64l9VuiRpGJa+UylCc12HwYZpqXZF+7/62z4hWsYHrcp6QhlHOofEYDANBgkqhkiG9w0BAQEFAASCAgBpFJQi+kBs2c2wjNzugkQNyCbku6FmzxQfO8jcXfgIoSif3vK0iPAUtQGfglinn5Ryg27eex9TceLar4emuWvZCwtWe0jp+zuBg+drYX0bdFNK55z6QPYe6ENfk+2oZKe/x/9YJ5ukI6Eu+B7NLCY6h8/SOpCj6CAnLJ9Jh5nHcgH9XKTPknY5K0BvPAlV7B6eEaBJO4cNx8CDMwZ18eAAUh+I/0IXiqFkNa24mA/drBWE7kmNgvdefacvV4Sa3/8fhozGPPVHTXFbut93bp7fPCZc7ATblYB/XJwVi32bidkZdCOJd7zElTrcwcUVqp4Bthu2UdLcIir6YXraX4xdhsE2bvZubywDUIlGzIfugZ5PQ/TCXlSDkLo5GyXuPO6C45n+3gzYUCX+4riKmuO2/NGb/gd28wthptByP4I3COGz9bkDWrjnqfdFyn/1w8ahEwFo7Ep1vJKSRLWoVDDulfx3SgHyv3SVkGFswnMDarwcEJur9CsPlr0E4ZVN7FTX8ZckSZWgewtk8gjvvJv0XLkfoJbD7xJyMN4WuUcD5H1cdY3uiAdj0OGYf1dYUg0reMzMTT7MxZbWQ4nx1RgMpXKbyoity8MiehwW0oaARpGCBvgiNeZXcuuX1SoX2rhrdQO5U8AGQx1ReCXkzveVnPH3zAyr23i3YgaylkjHsw=="
  },
  "proof": {
    "type": "Ed25519Signature2020",
    "verificationMethod": "did:oyd:zQmefAYBcTqEizzQ1k4F7NYDjyPVqhmKWC1JBUqy5XEjKnQ",
    "proofPurpose": "assertionMethod",
    "proofValue": "z36TofCnRia1BtaTnpYFnApDCpy85PfhJKx1vCgRsfyDQA3t7YYgX6pmtJ8Kj2teAFD8Aa3ewUNB4Uqw1ho9RS4SG"
  },
  "identifier": "zQmXbX8R5GrA6HUp4qzyZbtgoKFoX5NEWAjN3XHi1SkB1Um"
}
```