DIDComm.packDIDCommMessage() method

This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

Packs a IDIDCommMessage using one of the DIDCommMessagePacking options.

packDIDCommMessage(args: IPackDIDCommMessageArgs, context: IAgentContext<IDIDManager & IKeyManager & IResolver>): Promise<IPackedDIDCommMessage>;


argsIPackDIDCommMessageArgsan IPackDIDCommMessageArgs object. * args.message - IDIDCommMessage - the message to be packed * args.packing - DIDCommMessagePacking - the packing method * args.keyRef - Optional - string - either an id of a kid of a IKey that will be used when packing is jws or authcrypt.
contextIAgentContext <IDIDManager & IKeyManager & IResolver>This method requires an agent that also has IDIDManager, IKeyManager and IResolver plugins in use. When calling this method, the context is supplied automatically by the framework.

Promise<IPackedDIDCommMessage >

a Promise that resolves to an object containing the serialized packed message string