This repository has been archived by the owner on Mar 27, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 162
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Packager now holds multiple packers, indexed by
Typ
field.
Packager can select Packer for decryption based on the Typ field of the input message. Fixes #273 Signed-off-by: Filip Burlacu <[email protected]>
- Loading branch information
Filip Burlacu
committed
Nov 8, 2019
1 parent
ef1983c
commit a352bb4
Showing
38 changed files
with
972 additions
and
592 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
/* | ||
Copyright SecureKey Technologies Inc. All Rights Reserved. | ||
SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package transport | ||
|
||
// Envelope contain msg, FromVerKey and ToVerKeys | ||
type Envelope struct { | ||
Message []byte | ||
FromVerKey string | ||
ToVerKeys []string | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
/* | ||
Copyright SecureKey Technologies Inc. All Rights Reserved. | ||
SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package transport | ||
|
||
// Packager manages the handling, building and parsing of DIDComm raw messages in JSON envelopes. | ||
// | ||
// These envelopes are used as wire-level wrappers of messages sent in Aries agent-agent communication. | ||
type Packager interface { | ||
// PackMessage Pack a message for one or more recipients. | ||
// | ||
// Args: | ||
// | ||
// envelope: The message to pack | ||
// | ||
// Returns: | ||
// | ||
// []byte: The packed message | ||
// | ||
// error: error | ||
PackMessage(envelope *Envelope) ([]byte, error) | ||
|
||
// UnpackMessage Unpack a message. | ||
// | ||
// Args: | ||
// | ||
// encMessage: The encrypted message | ||
// | ||
// Returns: | ||
// | ||
// envelope: unpack message | ||
// | ||
// error: error | ||
UnpackMessage(encMessage []byte) (*Envelope, error) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.