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.
Why is this using SensitiveAttribute if it never serializes the data to a buffer ?
There was a problem hiding this comment.
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.
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