-
Notifications
You must be signed in to change notification settings - Fork 0
Feature: PII Encapsulation #138
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
| import type * as KeetaNetClient from '@keetanetwork/keetanet-client'; | ||
| import { CertificateAttributeOIDDB, type CertificateAttributeValueMap, type CertificateAttributeValue } from '../../services/kyc/iso20022.generated.js'; | ||
| import type { CertificateBuilder, Certificate } from '../certificates.js'; | ||
| import { SensitiveAttribute, SensitiveAttributeBuilder } from '../certificates.js'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this using SensitiveAttribute if it never serializes the data to a buffer ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure what you mean? For known attributes it uses the builder. We can just not allow unknown attributes to be handled with toSensitiveAttribute unless you have a different idea.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mean the SensitiveAttribute mechanism is for encrypting data to be validated (via proof later), it doesn't really make sense to encrypt data and then never use the encrypted data...
|



Overview
Adds encapsulation for transport of PII information. In
footprint-kyc-anchor, instead of:We can now do:
PIIStore(src/lib/utils/pii.ts)toString(),toJSON(),util.inspect())setAttribute(name, value)- type-safe storage for known + external attributestoSensitiveAttribute(name, subjectKey)- encrypts and returnsSensitiveAttributerun(get)- scoped callback with gettertoCertificateBuilder(builder)- applies all known attributes to certificatePIIStore.fromCertificate(cert)- extracts attributes from existing certificatePIIErrorwith codes:PII_ATTRIBUTE_NOT_FOUND,PII_KNOWN_ATTRIBUTE_EXPOSURE_DENIEDSensitiveAttribute(src/lib/sensitive-attribute.ts)certificates.tsinto dedicated moduleSensitiveAttributeBuilder.build()now returnsSensitiveAttribute<T>directlyset(name, value)- schema-aware encoding for known attributesset(bytes)- raw bytes for external attributespublicKeygetter - returns encryption target public keytoDER()- returns raw encrypted bytesisInstance()- static type guardCertificateBuildersetSensitiveAttribute(name, attr)- accepts pre-builtSensitiveAttributeinstances