1 Star 0 Fork 0

Hyperledger Fabric 国密/fabric-sdk-go

Create your Gitee Account
Explore and code with more than 12 million developers,Free private repositories !:)
Sign up
Clone or Download
credential.go 1.45 KB
Copy Edit Raw Blame History
Jtyoui authored 2021-07-22 20:40 . 改造国密sdk
/*
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 credential
import (
"gitee.com/hyperledger-fabric-gm/fabric-sdk-go/internal/github.com/hyperledger/fabric-ca/sdkinternal/pkg/api"
"github.com/tw-bc-group/net-go-gm/http"
)
// Credential represents an credential of an identity
type Credential interface {
// Type returns type of this credential
Type() string
// EnrollmentID returns enrollment ID associated with this credential
// Returns an error if the credential value is not set (SetVal is not called)
// or not loaded from the disk (Load is not called)
EnrollmentID() (string, error)
// Val returns credential value.
// Returns an error if the credential value is not set (SetVal is not called)
// or not loaded from the disk (Load is not called)
Val() (interface{}, error)
// Sets the credential value
SetVal(val interface{}) error
// Stores the credential value to disk
Store() error
// Loads the credential value from disk and sets the value of this credential
Load() error
// CreateToken returns authorization token for the specified request with
// specified body
CreateToken(req *http.Request, reqBody []byte) (string, error)
// Submits revoke request to the Fabric CA server to revoke this credential
RevokeSelf() (*api.RevocationResponse, error)
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/hyperledger-fabric-gm/fabric-sdk-go.git
git@gitee.com:hyperledger-fabric-gm/fabric-sdk-go.git
hyperledger-fabric-gm
fabric-sdk-go
fabric-sdk-go
3287af796e9e

Search