Skip to content

Commit

Permalink
Update remote_attachment_codec.dart
Browse files Browse the repository at this point in the history
  • Loading branch information
giovas17 committed Dec 19, 2023
1 parent 9f43738 commit 6eed5dd
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions lib/src/content/remote_attachment_codec.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,6 @@ class EncryptedEncodedContent {

EncryptedEncodedContent(this.contentDigest, this.secret, this.salt,
this.nonce, this.payload, this.contentLength, this.fileName);

EncodedContent decryptEncoded(EncryptedEncodedContent encrypted) {
var hashPayload = sha256.convert(encrypted.payload);
if (hashPayload.toString() != encrypted.contentDigest) {
throw Exception("content digest does not match");
}


return EncodedContent.create();
}
}

class RemoteAttachment {
Expand All @@ -41,6 +31,16 @@ class RemoteAttachment {

RemoteAttachment(this.url, this.contentDigest, this.secret, this.salt,
this.nonce, this.scheme, this.contentLength, this.fileName);

EncodedContent decryptEncoded(EncryptedEncodedContent encrypted) {
var hashPayload = sha256.convert(encrypted.payload);
if (hashPayload.toString() != encrypted.contentDigest) {
throw Exception("content digest does not match");
}


return EncodedContent.create();
}
}

abstract class Fetcher {
Expand Down

0 comments on commit 6eed5dd

Please sign in to comment.