github.com/hyperledger/aries-framework-go@v0.3.2/pkg/doc/verifiable/presentation_ldp.go (about)

     1  /*
     2  Copyright SecureKey Technologies Inc. All Rights Reserved.
     3  SPDX-License-Identifier: Apache-2.0
     4  */
     5  
     6  package verifiable
     7  
     8  import (
     9  	"fmt"
    10  
    11  	"github.com/hyperledger/aries-framework-go/pkg/doc/signature/jsonld"
    12  )
    13  
    14  // AddLinkedDataProof appends proof to the Verifiable Presentation.
    15  func (vp *Presentation) AddLinkedDataProof(context *LinkedDataProofContext, jsonldOpts ...jsonld.ProcessorOpts) error {
    16  	vcBytes, err := vp.MarshalJSON()
    17  	if err != nil {
    18  		return fmt.Errorf("add linked data proof to VP: %w", err)
    19  	}
    20  
    21  	proofs, err := addLinkedDataProof(context, vcBytes, jsonldOpts...)
    22  	if err != nil {
    23  		return err
    24  	}
    25  
    26  	vp.Proofs = proofs
    27  
    28  	return nil
    29  }