Skip to content

Commit

Permalink
CCR-3144: Expose loadTDFStream on Client. (#364)
Browse files Browse the repository at this point in the history
  • Loading branch information
ntrevino-virtru authored Oct 18, 2024
1 parent 9637022 commit 3d602ad
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions lib/tdf3/src/client/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {
buildKeyAccess,
EncryptConfiguration,
fetchKasPublicKey,
loadTDFStream,
unwrapHtml,
validatePolicyObject,
readStream,
Expand Down Expand Up @@ -614,6 +615,11 @@ export class Client {
const policyJson = base64.decode(manifest.encryptionInformation.policy);
return JSON.parse(policyJson).uuid;
}

async loadTDFStream({ source }: { source: DecryptSource }) {
const chunker = await makeChunkable(source);
return loadTDFStream(chunker);
}
}

export type { AuthProvider };
Expand Down
2 changes: 1 addition & 1 deletion lib/tdf3/src/tdf.ts
Original file line number Diff line number Diff line change
Expand Up @@ -876,7 +876,7 @@ export async function writeStream(cfg: EncryptConfiguration): Promise<DecoratedR
}

// load the TDF as a stream in memory, for further use in reading and key syncing
async function loadTDFStream(
export async function loadTDFStream(
chunker: Chunker
): Promise<{ manifest: Manifest; zipReader: ZipReader; centralDirectory: CentralDirectory[] }> {
const zipReader = new ZipReader(chunker);
Expand Down

0 comments on commit 3d602ad

Please sign in to comment.