github.com/kaituanwang/hyperledger@v2.0.1+incompatible/core/handlers/endorsement/api/identities/identities.go (about)

     1  /*
     2  Copyright IBM Corp. All Rights Reserved.
     3  
     4  SPDX-License-Identifier: Apache-2.0
     5  */
     6  
     7  package endorsement
     8  
     9  import (
    10  	"github.com/hyperledger/fabric-protos-go/peer"
    11  	endorsement "github.com/hyperledger/fabric/core/handlers/endorsement/api"
    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  }