-
Notifications
You must be signed in to change notification settings - Fork 0
/
identity.go
33 lines (27 loc) · 892 Bytes
/
identity.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
/*
Copyright IBM Corp. All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
*/
/*
Notice: This file has been modified for Hyperledger Fabric SDK Go usage.
Please review third_party pinning scripts and patches for more details.
*/
// Package identity provides a set of interfaces for identity-related operations.
package identity
// Signer is an interface which wraps the Sign method.
//
// Sign signs message bytes and returns the signature or an error on failure.
type Signer interface {
Sign(message []byte) ([]byte, error)
}
// Serializer is an interface which wraps the Serialize function.
//
// Serialize converts an identity to bytes. It returns an error on failure.
type Serializer interface {
Serialize() ([]byte, error)
}
// SignerSerializer groups the Sign and Serialize methods.
type SignerSerializer interface {
Signer
Serializer
}