1 Star 0 Fork 0

dcharles/fabric-ca

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
net.go 3.75 KB
一键复制 编辑 原始数据 按行查看 历史
/*
Copyright IBM Corp. 2016 All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package api
import (
"github.com/cloudflare/cfssl/signer"
"github.com/hyperledger/fabric/idemix"
)
/*
* This file contains the structure definitions for the request
* and responses which flow over the network between a fabric-ca client
* and the fabric-ca server.
*/
// RegistrationRequestNet is the registration request for a new identity
type RegistrationRequestNet struct {
RegistrationRequest
}
// RegistrationResponseNet is a registration response
type RegistrationResponseNet struct {
RegistrationResponse
}
// EnrollmentRequestNet is a request to enroll an identity
type EnrollmentRequestNet struct {
signer.SignRequest
CAName string
AttrReqs []*AttributeRequest `json:"attr_reqs,omitempty"`
}
// IdemixEnrollmentRequestNet is a request to enroll an identity and get idemix credential
type IdemixEnrollmentRequestNet struct {
*idemix.CredRequest `json:"request"`
CAName string `json:"caname"`
}
// ReenrollmentRequestNet is a request to reenroll an identity.
// This is useful to renew a certificate before it has expired.
type ReenrollmentRequestNet struct {
signer.SignRequest
CAName string
AttrReqs []*AttributeRequest `json:"attr_reqs,omitempty"`
}
// RevocationRequestNet is a revocation request which flows over the network
// to the fabric-ca server.
// To revoke a single certificate, both the Serial and AKI fields must be set;
// otherwise, to revoke all certificates and the identity associated with an enrollment ID,
// the Name field must be set to an existing enrollment ID.
// A RevocationRequest can only be performed by a user with the "hf.Revoker" attribute.
type RevocationRequestNet struct {
RevocationRequest
}
// GetTCertBatchRequestNet is a network request for a batch of transaction certificates
type GetTCertBatchRequestNet struct {
GetTCertBatchRequest
// KeySigs is an optional array of public keys and corresponding signatures.
// If not set, the server generates it's own keys based on a key derivation function
// which cryptographically relates the TCerts to an ECert.
KeySigs []KeySig `json:"key_sigs,omitempty"`
}
// GetTCertBatchResponseNet is the network response for a batch of transaction certificates
type GetTCertBatchResponseNet struct {
GetTCertBatchResponse
}
// AddIdentityRequestNet is a network request for adding a new identity
type AddIdentityRequestNet struct {
AddIdentityRequest
}
// ModifyIdentityRequestNet is a network request for modifying an existing identity
type ModifyIdentityRequestNet struct {
ModifyIdentityRequest
}
// AddAffiliationRequestNet is a network request for adding a new affiliation
type AddAffiliationRequestNet struct {
AddAffiliationRequest
}
// ModifyAffiliationRequestNet is a network request for modifying an existing affiliation
type ModifyAffiliationRequestNet struct {
ModifyAffiliationRequest
}
// GetCertificatesRequestNet is a network request for getting certificates
type GetCertificatesRequestNet struct {
GetCertificatesRequest
}
// KeySig is a public key, signature, and signature algorithm tuple
type KeySig struct {
// Key is a public key
Key []byte `json:"key"`
// Sig is a signature over the PublicKey
Sig []byte `json:"sig"`
// Alg is the signature algorithm
Alg string `json:"alg"`
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/dcharles/fabric-ca-official.git
git@gitee.com:dcharles/fabric-ca-official.git
dcharles
fabric-ca-official
fabric-ca
v1.4.7

搜索帮助