AttestationGatedDisclosure
SIP Protocol API Reference v0.15.1
SIP Protocol API Reference / AttestationGatedDisclosure
Class: AttestationGatedDisclosure
Section titled “Class: AttestationGatedDisclosure”Defined in: @sip-protocol/sdk/dist/index-GLbkPPho.d.ts:11072
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new AttestationGatedDisclosure(
config):AttestationGatedDisclosure
Defined in: @sip-protocol/sdk/dist/index-GLbkPPho.d.ts:11081
Create a new attestation-gated disclosure manager
Parameters
Section titled “Parameters”config
Section titled “config”Configuration options
Returns
Section titled “Returns”AttestationGatedDisclosure
Methods
Section titled “Methods”deriveViewingKeyForAuditor()
Section titled “deriveViewingKeyForAuditor()”deriveViewingKeyForAuditor(
attestation,scope?):Promise<ViewingKeyDerivationResult>
Defined in: @sip-protocol/sdk/dist/index-GLbkPPho.d.ts:11101
Derive a viewing key for a verified auditor
Parameters
Section titled “Parameters”attestation
Section titled “attestation”The auditor’s Range SAS attestation
scope?
Section titled “scope?”Optional scope restrictions for the viewing key
Returns
Section titled “Returns”Promise<ViewingKeyDerivationResult>
Derivation result with viewing key if granted
Example
Section titled “Example”const result = await disclosure.deriveViewingKeyForAuditor(attestation, { startTime: Date.now() / 1000 - 30 * 24 * 60 * 60, // Last 30 days endTime: Date.now() / 1000,})
if (result.granted) { // Share result.viewingKey with auditor}verifyAttestation()
Section titled “verifyAttestation()”verifyAttestation(
attestation):Promise<AttestationVerificationResult>
Defined in: @sip-protocol/sdk/dist/index-GLbkPPho.d.ts:11108
Verify a Range SAS attestation
Parameters
Section titled “Parameters”attestation
Section titled “attestation”The attestation to verify
Returns
Section titled “Returns”Promise<AttestationVerificationResult>
Verification result
revokeViewingKey()
Section titled “revokeViewingKey()”revokeViewingKey(
attestation):boolean
Defined in: @sip-protocol/sdk/dist/index-GLbkPPho.d.ts:11115
Revoke a previously derived viewing key
Parameters
Section titled “Parameters”attestation
Section titled “attestation”The attestation whose key should be revoked
Returns
Section titled “Returns”boolean
Whether revocation was successful
hasViewingKey()
Section titled “hasViewingKey()”hasViewingKey(
attestation):boolean
Defined in: @sip-protocol/sdk/dist/index-GLbkPPho.d.ts:11122
Check if a viewing key has been derived for an attestation
Parameters
Section titled “Parameters”attestation
Section titled “attestation”The attestation to check
Returns
Section titled “Returns”boolean
Whether a key exists
getCacheSize()
Section titled “getCacheSize()”getCacheSize():
number
Defined in: @sip-protocol/sdk/dist/index-GLbkPPho.d.ts:11128
Get the current cache size
Returns
Section titled “Returns”number
Number of cached viewing keys
clearCache()
Section titled “clearCache()”clearCache():
void
Defined in: @sip-protocol/sdk/dist/index-GLbkPPho.d.ts:11132
Clear all cached viewing keys
Returns
Section titled “Returns”void