A comprehensive TypeScript implementation of the Digital Identity and Authentication Council of Canada (DIACC) Pan-Canadian Trust Framework (PCTF) criteria and components.
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.
This implementation includes the following PCTF 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
- 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
- ποΈ 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
# 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 buildimport { 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);- 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
PCTFFramework- Main framework orchestratorAuthenticationServiceProvider- Implements PCTF03 trusted processesIdentityProvider- Implements PCTF05 identity proofingPrivacyServiceProvider- Implements PCTF04 PIPEDA principles
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
});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
);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 */ ]
});Run the included demonstration to see the framework in action:
npm run devOr run the demo directly:
npx ts-node src/demo.tsnpm run build- Build the TypeScript projectnpm run dev- Run the demo in development modenpm start- Run the compiled demonpm run clean- Clean the build directorynpm run rebuild- Clean and rebuild
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
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
The Privacy component implements all 10 PIPEDA principles:
- Accountability - Designated privacy officers and policies
- Identifying Purposes - Clear purpose specification for data collection
- Consent - Meaningful consent mechanisms
- Limiting Collection - Collection limited to necessary purposes
- Limiting Use/Disclosure - Use restriction controls
- Accuracy - Data accuracy and currency requirements
- Safeguards - Comprehensive security controls
- Openness - Transparent privacy practices
- Individual Access - Personal information access rights
- Challenging Compliance - Complaint handling mechanisms
Contributions are welcome! Please read our contributing guidelines and ensure all tests pass before submitting a pull request.
This project is licensed under the MIT License - see the LICENSE file for details.
- Digital Identity and Authentication Council of Canada (DIACC)
- Pan-Canadian Trust Framework
- PCTF development community and contributors
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.