authcrypt

package
v0.1.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 31, 2020 License: Apache-2.0 Imports: 14 Imported by: 3

Documentation

Index

Constants

View Source
const (

	// ThirdPartyKeysDB is a store name containing keys of third party agents.
	ThirdPartyKeysDB = "thirdPartyKeysDB"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Packer

type Packer struct {
	// contains filtered or unexported fields
}

Packer represents an Authcrypt Pack/Unpacker that outputs/reads Aries envelopes.

func New

func New(ctx packer.Provider, encAlg jose.EncAlg) (*Packer, error)

New will create an Packer instance to 'AuthCrypt' payloads for a given sender and list of recipients keys. It will open a store (fetch cached one) that will contain third party keys. This store must be pre-populated with the sender key required by a recipient to Unpack a JWE envelope. It is not needed by the sender (as the sender packs the envelope with its own key). The returned Packer contains all the information required to pack and unpack payloads.

func (*Packer) EncodingType

func (p *Packer) EncodingType() string

EncodingType for didcomm.

func (*Packer) Pack

func (p *Packer) Pack(payload, senderID []byte, recipientsPubKeys [][]byte) ([]byte, error)

Pack will encode the payload argument Using the protocol defined by the Authcrypt message of Aries RFC 0334 with the following arguments: payload: the payload message that will be protected senderID: the key id of the sender (stored in the KMS) recipientsPubKeys: public keys.

func (*Packer) Unpack

func (p *Packer) Unpack(envelope []byte) (*transport.Envelope, error)

Unpack will decode the envelope using a standard format.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL