Skip to content

Commit 3d602ad

Browse files
CCR-3144: Expose loadTDFStream on Client. (#364)
1 parent 9637022 commit 3d602ad

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

lib/tdf3/src/client/index.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import {
1414
buildKeyAccess,
1515
EncryptConfiguration,
1616
fetchKasPublicKey,
17+
loadTDFStream,
1718
unwrapHtml,
1819
validatePolicyObject,
1920
readStream,
@@ -614,6 +615,11 @@ export class Client {
614615
const policyJson = base64.decode(manifest.encryptionInformation.policy);
615616
return JSON.parse(policyJson).uuid;
616617
}
618+
619+
async loadTDFStream({ source }: { source: DecryptSource }) {
620+
const chunker = await makeChunkable(source);
621+
return loadTDFStream(chunker);
622+
}
617623
}
618624

619625
export type { AuthProvider };

lib/tdf3/src/tdf.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -876,7 +876,7 @@ export async function writeStream(cfg: EncryptConfiguration): Promise<DecoratedR
876876
}
877877

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

0 commit comments

Comments
 (0)