github.com/anjalikarhana/fabric@v2.1.1+incompatible/internal/pkg/identity/identity.go (about)

     1  /*
     2  Copyright IBM Corp. All Rights Reserved.
     3  
     4  SPDX-License-Identifier: Apache-2.0
     5  */
     6  
     7  // Package identity provides a set of interfaces for identity-related operations.
     8  
     9  package identity
    10  
    11  // Signer is an interface which wraps the Sign method.
    12  //
    13  // Sign signs message bytes and returns the signature or an error on failure.
    14  type Signer interface {
    15  	Sign(message []byte) ([]byte, error)
    16  }
    17  
    18  // Serializer is an interface which wraps the Serialize function.
    19  //
    20  // Serialize converts an identity to bytes.  It returns an error on failure.
    21  type Serializer interface {
    22  	Serialize() ([]byte, error)
    23  }
    24  
    25  // SignerSerializer groups the Sign and Serialize methods.
    26  type SignerSerializer interface {
    27  	Signer
    28  	Serializer
    29  }