github.com/hechain20/hechain@v0.0.0-20220316014945-b544036ba106/core/handlers/endorsement/api/identities/identities.go (about)

     1  /*
     2  Copyright hechain. All Rights Reserved.
     3  
     4  SPDX-License-Identifier: Apache-2.0
     5  */
     6  
     7  package endorsement
     8  
     9  import (
    10  	endorsement "github.com/hechain20/hechain/core/handlers/endorsement/api"
    11  	"github.com/hyperledger/fabric-protos-go/peer"
    12  )
    13  
    14  // SigningIdentity signs messages and serializes its public identity to bytes
    15  type SigningIdentity interface {
    16  	// Serialize returns a byte representation of this identity which is used to verify
    17  	// messages signed by this SigningIdentity
    18  	Serialize() ([]byte, error)
    19  
    20  	// Sign signs the given payload and returns a signature
    21  	Sign([]byte) ([]byte, error)
    22  }
    23  
    24  // SigningIdentityFetcher fetches a signing identity based on the proposal
    25  type SigningIdentityFetcher interface {
    26  	endorsement.Dependency
    27  	// SigningIdentityForRequest returns a signing identity for the given proposal
    28  	SigningIdentityForRequest(*peer.SignedProposal) (SigningIdentity, error)
    29  }