1.0.1 • Published 6 months ago

@cef-ebsi/vcdm1.1-dc4eu-european-student-card v1.0.1

Weekly downloads
-
License
EUPL-1.2
Repository
-
Last release
6 months ago

EBSI Logo

@cef-ebsi/vcdm1.1-dc4eu-european-student-card

European Student Card Credential

Schema for a European Student Card as a Verifiable Credential

The schema is published to the Trusted Schemas Registry with the IDs:

  • 0x0e46f9509c52e649d8b461216b66836bd8398b8779469a571404264ea02c3bd9 (hexadecimal)
  • zxjUh5zwbUAY4XLhMsXUVa9BhswQqvYPT4JuNzu3QQoz (multibase base58btc)

Table of Contents

JSON Schema

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "European Student Card Credential",
  "description": "Schema for a European Student Card as a Verifiable Credential",
  "type": "object",
  "allOf": [
    {
      "$ref": "./node_modules/@cef-ebsi/vcdm1.1-attestation-schema/schema.json"
    },
    {
      "required": [
        "@context",
        "type",
        "issuer",
        "issuanceDate",
        "credentialSubject",
        "proof"
      ],
      "properties": {
        "@context": {
          "type": "array",
          "items": {
            "type": "string",
            "format": "uri"
          },
          "description": "Context URIs defining the vocabulary used in the VC"
        },
        "id": {
          "type": "string",
          "format": "uri",
          "description": "Unique identifier for the credential (e.g., UUID URI)"
        },
        "type": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "List of credential types"
        },
        "issuer": {
          "type": "string",
          "format": "uri",
          "description": "DID or URI identifying the issuer (e.g., HEI)"
        },
        "issuanceDate": {
          "type": "string",
          "format": "date-time",
          "description": "Date the credential was issued"
        },
        "expirationDate": {
          "type": "string",
          "format": "date-time",
          "description": "Date the credential expires (optional)"
        },
        "credentialSubject": {
          "type": "object",
          "description": "Claims about the student",
          "required": [
            "id",
            "givenName",
            "familyName",
            "email",
            "esi",
            "escn",
            "institutionPIC",
            "academicLevel"
          ],
          "properties": {
            "id": {
              "type": "string",
              "format": "uri",
              "description": "DID of the student holder"
            },
            "givenName": {
              "type": "string",
              "description": "Student's given name"
            },
            "familyName": {
              "type": "string",
              "description": "Student's family name"
            },
            "email": {
              "type": "string",
              "format": "email",
              "description": "Student email address"
            },
            "esi": {
              "type": "string",
              "description": "European Student Identifier"
            },
            "escn": {
              "type": "string",
              "description": "European Student Card Number (UUID format)"
            },
            "institutionPIC": {
              "type": "string",
              "description": "Participant Identification Code of the issuing institution"
            },
            "academicLevel": {
              "type": "string",
              "enum": ["Bachelor", "Master", "PhD", "Other"],
              "description": "Academic level of the student"
            },
            "cardType": {
              "type": "string",
              "enum": ["Physical", "Digital"],
              "description": "Format of the ESC"
            }
          }
        },
        "credentialStatus": {
          "type": "object",
          "description": "Status list configuration for revocation/suspension",
          "required": [
            "id",
            "type",
            "statusPurpose",
            "statusListIndex",
            "statusListCredential"
          ],
          "properties": {
            "id": {
              "type": "string",
              "format": "uri",
              "description": "URI to this credential’s status entry"
            },
            "type": {
              "type": "string",
              "enum": ["StatusList2021Entry"],
              "description": "Status type"
            },
            "statusPurpose": {
              "type": "string",
              "enum": ["revocation", "suspension"],
              "description": "Purpose of status tracking"
            },
            "statusListIndex": {
              "type": "string",
              "description": "Index in the status list"
            },
            "statusListCredential": {
              "type": "string",
              "format": "uri",
              "description": "URI of the status list credential document"
            }
          }
        },
        "proof": {
          "type": "object",
          "description": "Cryptographic proof",
          "required": [
            "type",
            "created",
            "proofPurpose",
            "verificationMethod",
            "jws"
          ],
          "properties": {
            "type": {
              "type": "string",
              "description": "Signature type (e.g., Ed25519Signature2020)"
            },
            "created": {
              "type": "string",
              "format": "date-time",
              "description": "When the proof was created"
            },
            "proofPurpose": {
              "type": "string",
              "enum": ["assertionMethod"],
              "description": "Purpose of the proof"
            },
            "verificationMethod": {
              "type": "string",
              "description": "URI to the verification method (e.g., public key)"
            },
            "jws": {
              "type": "string",
              "description": "JWS signature value"
            }
          }
        }
      }
    }
  ]
}

Installation

# with npm
npm add @cef-ebsi/vcdm1.1-dc4eu-european-student-card@1.0.1

# with Yarn
yarn add @cef-ebsi/vcdm1.1-dc4eu-european-student-card@1.0.1

# with pnpm
pnpm add @cef-ebsi/vcdm1.1-dc4eu-european-student-card@1.0.1

Usage

The package exports the schema and its metadata as JavaScript objects:

import {
  schema,
  metadata,
} from "@cef-ebsi/vcdm1.1-dc4eu-european-student-card";

// you can now use the schema and metadata

In addition, the package exports a TypeScript type corresponding to the schema:

import type { EuropeanStudentCardCredential } from "@cef-ebsi/vcdm1.1-dc4eu-european-student-card";

License

Copyright (C) 2024 European Union

This program is free software: you can redistribute it and/or modify it under the terms of the EUROPEAN UNION PUBLIC LICENCE v. 1.2 as published by the European Union.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the EUROPEAN UNION PUBLIC LICENCE v. 1.2 for further details.

You should have received a copy of the EUROPEAN UNION PUBLIC LICENCE v. 1.2. along with this program. If not, see https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12.

1.0.1

6 months ago

1.0.0

6 months ago