Skip to content

Unable to decrypt readableStreamBody from Azure Blob Storage - Misformed Armored Text #1714

Closed Answered by ed-whittle
ed-whittle asked this question in Q&A
Discussion options

You must be logged in to vote

Fixed, the issue was to set the encoding as utf8

The working example is

    const downloadBlobResponse = await inboundBlobClient.download();
    downloadBlobResponse.readableStreamBody.setEncoding('utf8')

    const message = await openpgp.readMessage({
      armoredMessage: downloadBlobResponse.readableStreamBody as any
    });

    console.log('Decrypting');
    const { data } = await openpgp.decrypt({
      message,
      decryptionKeys: [privateKey], // for decryption,
    });

    console.log('Starting Upload');
    outboundBlockBlobClient.uploadStream(data as any);

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by ed-whittle
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant