Skip to content

phi-beta/DIACC-PCTF

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

3 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

DIACC PCTF Implementation

A comprehensive TypeScript implementation of the Digital Identity and Authentication Council of Canada (DIACC) Pan-Canadian Trust Framework (PCTF) criteria and components.

Overview

The Pan-Canadian Trust Frameworkβ„’ (PCTF) is a risk mitigation framework comprised of a set of rules, standards, specifications, regulations, and guidance that offers a high-quality and versatile defined code of practice for operating trustworthy and efficient digital identity, credential, and supporting services.

This project implements the PCTF framework structure and terminology as TypeScript classes with detailed conformance criteria and trusted processes.

Framework Components

This implementation includes the following PCTF components:

Implemented Components

  • Authentication (PCTF03) - Credential issuance, authentication, session management
  • Verified Person (PCTF05) - Identity proofing and verification processes
  • Privacy (PCTF04) - Personal information handling aligned with PIPEDA
  • Framework Orchestrator - Coordinates all PCTF components and participants

Planned Components

  • Infrastructure (PCTF08) - Technology and operations for trusted infrastructure
  • Digital Wallet (PCTF12) - Digital identity and asset management
  • Trust Registries (PCTF13) - Ecosystem participant verification
  • Credentials (PCTF07) - Credential lifecycle management
  • Verified Organization (PCTF06) - Organization identity verification
  • Notice & Consent (PCTF02) - Personal information collection and consent

Features

  • πŸ—οΈ Enterprise-grade Architecture - Modular design with clear separation of concerns
  • πŸ”’ Security-first Approach - Implements security best practices and risk mitigation
  • πŸ“‹ Comprehensive Conformance Criteria - Detailed implementation of PCTF requirements
  • πŸ”§ TypeScript Support - Full type safety and excellent developer experience
  • πŸ“š Extensive Documentation - Well-documented classes and interfaces
  • πŸ§ͺ Demonstration Examples - Complete usage examples and demos

Installation

# Clone the repository
git clone https://github.com/your-username/diacc-pctf.git
cd diacc-pctf

# Install dependencies
npm install

# Build the project
npm run build

Quick Start

import { PCTFFramework, AssuranceLevel, ParticipantType } from './src';

// Initialize the PCTF Framework
const framework = new PCTFFramework('MY-PCTF-001', '1.0.0');

// Register an authentication service provider
const participant = {
  participantId: 'ASP-001',
  name: 'My Auth Service',
  type: ParticipantType.AUTHENTICATION_SERVICE_PROVIDER,
  certificationLevel: AssuranceLevel.LOA3,
  isActive: true,
  registrationDate: new Date()
};

await framework.registerParticipant(participant);

// Get the authentication provider and issue credentials
const authProvider = framework.getAuthenticationProvider('ASP-001');
const credentialResult = await authProvider.issueCredential('USER-001', CredentialType.BIOMETRIC);

Architecture

Core Components

  • Types (src/types.ts) - Core interfaces, enums, and type definitions
  • Authentication (src/authentication.ts) - PCTF03 implementation
  • Verified Person (src/verified-person.ts) - PCTF05 implementation
  • Privacy (src/privacy.ts) - PCTF04 implementation
  • Framework (src/framework.ts) - Main orchestrator class

Key Classes

  • PCTFFramework - Main framework orchestrator
  • AuthenticationServiceProvider - Implements PCTF03 trusted processes
  • IdentityProvider - Implements PCTF05 identity proofing
  • PrivacyServiceProvider - Implements PCTF04 PIPEDA principles

Usage Examples

Authentication Service

import { AuthenticationServiceProvider, CredentialType } from './src';

const authProvider = new AuthenticationServiceProvider('ASP-001', 'SecureAuth', AssuranceLevel.LOA3);

// Issue a credential
const credential = await authProvider.issueCredential('USER-001', CredentialType.BIOMETRIC);

// Authenticate a user
const authResult = await authProvider.authenticate(credential.data.credentialId, 'auth-factor');

// Initiate a session
const session = await authProvider.initiateSession('USER-001', {
  assuranceLevel: AssuranceLevel.LOA3,
  maxDuration: 60
});

Identity Provider

import { IdentityProvider } from './src';

const idProvider = new IdentityProvider('IDP-001', 'TrustedID', AssuranceLevel.LOA3);

// Perform identity resolution
const identityInfo = {
  coreAttributes: {
    givenName: 'John',
    familyName: 'Doe',
    dateOfBirth: new Date('1990-01-01'),
    address: { /* address details */ }
  }
};

const resolution = await idProvider.performIdentityResolution(identityInfo);

// Establish identity
const identity = await idProvider.establishIdentity(
  resolution.data.personId,
  identityInfo,
  evidencePackage
);

Privacy Service

import { PrivacyServiceProvider } from './src';

const privacyProvider = new PrivacyServiceProvider('PRIV-001', 'PrivacyFirst Corp');

// Implement accountability framework
await privacyProvider.implementAccountability({
  privacyOfficer: { /* officer details */ },
  policies: [ /* privacy policies */ ],
  trainingProgram: { /* training details */ }
});

// Obtain consent
const consent = await privacyProvider.obtainConsent({
  individualId: 'USER-001',
  purposes: [ /* collection purposes */ ],
  dataCategories: [ /* data categories */ ]
});

Demo

Run the included demonstration to see the framework in action:

npm run dev

Or run the demo directly:

npx ts-node src/demo.ts

Development

Scripts

  • npm run build - Build the TypeScript project
  • npm run dev - Run the demo in development mode
  • npm start - Run the compiled demo
  • npm run clean - Clean the build directory
  • npm run rebuild - Clean and rebuild

Project Structure

src/
β”œβ”€β”€ types.ts           # Core types and interfaces
β”œβ”€β”€ authentication.ts # PCTF03 Authentication component
β”œβ”€β”€ verified-person.ts # PCTF05 Verified Person component
β”œβ”€β”€ privacy.ts         # PCTF04 Privacy component
β”œβ”€β”€ framework.ts       # Main framework orchestrator
β”œβ”€β”€ demo.ts           # Usage demonstration
└── index.ts          # Main entry point

Conformance Criteria

Each component implements detailed conformance criteria based on the PCTF specifications:

  • Risk Assessment - Each criterion includes risk level and mitigation strategies
  • Assurance Levels - Support for LOA1 through LOA4
  • Validation - Comprehensive input validation and error handling
  • Audit Trails - Logging and activity tracking for compliance

PIPEDA Compliance

The Privacy component implements all 10 PIPEDA principles:

  1. Accountability - Designated privacy officers and policies
  2. Identifying Purposes - Clear purpose specification for data collection
  3. Consent - Meaningful consent mechanisms
  4. Limiting Collection - Collection limited to necessary purposes
  5. Limiting Use/Disclosure - Use restriction controls
  6. Accuracy - Data accuracy and currency requirements
  7. Safeguards - Comprehensive security controls
  8. Openness - Transparent privacy practices
  9. Individual Access - Personal information access rights
  10. Challenging Compliance - Complaint handling mechanisms

Contributing

Contributions are welcome! Please read our contributing guidelines and ensure all tests pass before submitting a pull request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

Disclaimer

This implementation is for educational and development purposes. For production use in regulated environments, please ensure compliance with all applicable laws, regulations, and PCTF certification requirements.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published