authcrypt

package
v0.1.8 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2022 License: Apache-2.0 Imports: 13 Imported by: 3

Documentation

Index

Constants

This section is empty.

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 a Packer instance to 'AuthCrypt' payloads for a given sender and list of recipients keys using DIDComm typ V2 value (default envelope 'typ' protected header). It opens thirdPartyKS store (or fetch cached one) that contains 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(
	contentType string, payload, senderID []byte, recipientsPubKeys [][]byte) ([]byte, error)

Pack will encode the payload argument with contentType 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. Using either did:key KID resolver or the DIDDoc.KeyAgreement[].VerificationMethod.ID resolver which are set in p.resolvers.

Jump to

Keyboard shortcuts

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