@@ -1783,6 +1783,194 @@ export function inspectModule(source: Uint8Array | ArrayBuffer | WebAssembly.Mod
17831783 imports : WebAssembly . ModuleImportDescriptor [ ] ;
17841784} > ;
17851785
1786+ // --- Licensing ---
1787+
1788+ export class LicensingProtocolError extends Error {
1789+ code : string ;
1790+ constructor ( code : string , message : string ) ;
1791+ }
1792+
1793+ export interface LicensingChallengeMessage {
1794+ messageType : string ;
1795+ role : string ;
1796+ reqId : string ;
1797+ moduleId : string ;
1798+ moduleVersion ?: string ;
1799+ requesterPeerId ?: string ;
1800+ requesterXpub ?: string ;
1801+ requesterSigningPublicKey ?: Uint8Array ;
1802+ requesterEphemeralPublicKey ?: Uint8Array ;
1803+ requestedDomain ?: string ;
1804+ requestedTimeoutMs ?: number ;
1805+ requestedAtMs ?: number ;
1806+ challengeNonce ?: Uint8Array ;
1807+ expiresAtMs ?: number ;
1808+ providerPeerId ?: string ;
1809+ errorCode ?: string ;
1810+ errorMessage ?: string ;
1811+ rawBytes : Uint8Array ;
1812+ }
1813+
1814+ export interface LicensingProofMessage {
1815+ messageType : string ;
1816+ reqId : string ;
1817+ moduleId : string ;
1818+ moduleVersion ?: string ;
1819+ requesterPeerId ?: string ;
1820+ requesterXpub ?: string ;
1821+ requestedDomain ?: string ;
1822+ requestedTimeoutMs : number ;
1823+ requesterEphemeralPublicKey : Uint8Array ;
1824+ challengeNonce : Uint8Array ;
1825+ challengeExpiresAtMs : number ;
1826+ providerPeerId ?: string ;
1827+ signature : Uint8Array ;
1828+ requesterSigningPublicKey : Uint8Array ;
1829+ timestampMs : number ;
1830+ rejectionCode ?: string ;
1831+ rejectionMessage ?: string ;
1832+ rawBytes : Uint8Array ;
1833+ }
1834+
1835+ export interface LicensingGrantModuleDescriptor {
1836+ cid : string ;
1837+ contentHash : Uint8Array ;
1838+ sizeBytes : number ;
1839+ moduleId : string ;
1840+ moduleVersion ?: string ;
1841+ requiredScope ?: string ;
1842+ keyId ?: string ;
1843+ allowedDomains : string [ ] ;
1844+ maxGrantTimeoutMs : number ;
1845+ encrypted : boolean ;
1846+ }
1847+
1848+ export interface LicensingWrappedContentKeyHeader {
1849+ version : number ;
1850+ keyExchange : string ;
1851+ symmetric : string ;
1852+ keyDerivation : string ;
1853+ ephemeralPublicKey : Uint8Array ;
1854+ nonceStart : Uint8Array ;
1855+ recipientKeyId : Uint8Array ;
1856+ context ?: string ;
1857+ schemaHash : Uint8Array ;
1858+ rootType ?: string ;
1859+ timestamp ?: number ;
1860+ }
1861+
1862+ export interface LicensingWrappedContentKey {
1863+ wrappingAlgorithm : string ;
1864+ contentKeyId ?: string ;
1865+ contentKeyRole ?: string ;
1866+ contentKeyAlgorithm ?: string ;
1867+ contentKeyEncoding ?: string ;
1868+ keyBytes : Uint8Array ;
1869+ contentKeyVersion ?: number ;
1870+ recipientKeyId ?: string ;
1871+ requesterEphemeralPublicKey : Uint8Array ;
1872+ providerEphemeralPublicKey : Uint8Array ;
1873+ hkdfSalt : Uint8Array ;
1874+ iv : Uint8Array ;
1875+ ciphertext : Uint8Array ;
1876+ tag : Uint8Array ;
1877+ expiresAtMs : number ;
1878+ recipientPublicKey : Uint8Array ;
1879+ ephemeralPublicKey : Uint8Array ;
1880+ nonce : Uint8Array ;
1881+ header : LicensingWrappedContentKeyHeader ;
1882+ encryptedPayload : Uint8Array ;
1883+ recipientKeyIdBytes : Uint8Array ;
1884+ schemaHash : Uint8Array ;
1885+ keyMaterialRootType ?: string ;
1886+ }
1887+
1888+ export interface LicensingGrantMessage {
1889+ messageType : string ;
1890+ reqId : string ;
1891+ moduleId : string ;
1892+ moduleVersion ?: string ;
1893+ requesterPeerId ?: string ;
1894+ requesterXpub ?: string ;
1895+ requestedDomain ?: string ;
1896+ requestedTimeoutMs : number ;
1897+ grantedDomain ?: string ;
1898+ grantedTimeoutMs : number ;
1899+ expiresAtMs : number ;
1900+ requiredScope ?: string ;
1901+ grantStatus ?: string ;
1902+ denialReason ?: string ;
1903+ capabilityToken : Uint8Array ;
1904+ grantVerifierPublicKey : Uint8Array ;
1905+ providerSignature : Uint8Array ;
1906+ moduleDescriptor : LicensingGrantModuleDescriptor | null ;
1907+ wrappedContentKey : LicensingWrappedContentKey | null ;
1908+ rawBytes : Uint8Array ;
1909+ }
1910+
1911+ export function encodeLicensingChallengeRequest ( options : {
1912+ reqId : string ;
1913+ moduleId : string ;
1914+ moduleVersion ?: string ;
1915+ requesterPeerId : string ;
1916+ requesterXpub ?: string ;
1917+ requesterSigningPublicKey : Uint8Array ;
1918+ requesterEphemeralPublicKey : Uint8Array ;
1919+ requesterDomain : string ;
1920+ requestedTimeoutMs : number ;
1921+ requestedAtMs : number ;
1922+ providerPeerId : string ;
1923+ } ) : Uint8Array ;
1924+
1925+ export function decodeLicensingChallengeMessage (
1926+ bytes : Uint8Array | ArrayBuffer | ArrayBufferView ,
1927+ ) : LicensingChallengeMessage ;
1928+
1929+ export function encodeLicensingProof ( options : {
1930+ reqId : string ;
1931+ moduleId : string ;
1932+ moduleVersion ?: string ;
1933+ requesterPeerId : string ;
1934+ requesterXpub ?: string ;
1935+ requesterDomain : string ;
1936+ requestedTimeoutMs : number ;
1937+ requesterEphemeralPublicKey : Uint8Array ;
1938+ challengeNonce : Uint8Array ;
1939+ challengeExpiresAtMs : number ;
1940+ providerPeerId : string ;
1941+ signature : Uint8Array ;
1942+ requesterSigningPublicKey : Uint8Array ;
1943+ timestampMs : number ;
1944+ } ) : Uint8Array ;
1945+
1946+ export function decodeLicensingProofMessage (
1947+ bytes : Uint8Array | ArrayBuffer | ArrayBufferView ,
1948+ ) : LicensingProofMessage ;
1949+
1950+ export function decodeLicensingGrant (
1951+ bytes : Uint8Array | ArrayBuffer | ArrayBufferView ,
1952+ ) : LicensingGrantMessage ;
1953+
1954+ export function validateLicensingGrant (
1955+ grant : LicensingGrantMessage ,
1956+ options ?: {
1957+ reqId ?: string ;
1958+ moduleId ?: string ;
1959+ moduleVersion ?: string ;
1960+ expectedDomain ?: string ;
1961+ requestedTimeoutMs ?: number ;
1962+ grantVerifierPublicKeyLength ?: number ;
1963+ } ,
1964+ ) : LicensingGrantMessage ;
1965+
1966+ export function extractGrantModuleDescriptor (
1967+ grant : LicensingGrantMessage ,
1968+ ) : LicensingGrantModuleDescriptor ;
1969+
1970+ export function extractWrappedContentKey (
1971+ grant : LicensingGrantMessage ,
1972+ ) : LicensingWrappedContentKey ;
1973+
17861974// --- Runtime constants ---
17871975
17881976export const DefaultManifestExports : {
0 commit comments