Documentation ¶
Overview ¶
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.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Client ¶
type Client struct { // The client's home directory HomeDir string `json:"homeDir,omitempty"` // The client's configuration Config *ClientConfig // contains filtered or unexported fields }
Client is the fabric-ca client object
func (*Client) Enroll ¶
func (c *Client) Enroll(req *api.EnrollmentRequest) (*EnrollmentResponse, error)
Enroll enrolls a new identity @param req The enrollment request
type ClientConfig ¶
type ClientConfig struct { URL string `def:"http://localhost:7054" opt:"u" help:"URL of fabric-ca-server"` MSPDir string `def:"msp" opt:"M" help:"Membership Service Provider directory"` TLS tls.ClientTLSConfig Enrollment api.EnrollmentRequest CSR api.CSRInfo ID api.RegistrationRequest Revoke api.RevocationRequest CAInfo api.GetCAInfoRequest CAName string `help:"Name of CA"` CSP *factory.FactoryOpts `mapstructure:"bccsp" hide:"true"` Debug bool `opt:"d" help:"Enable debug level logging" hide:"true"` LogLevel string `help:"Set logging level (info, warning, debug, error, fatal, critical)"` Idemix api.Idemix PK crypto.PublicKey }
ClientConfig is the fabric-ca client's config
func (*ClientConfig) Enroll ¶
func (c *ClientConfig) Enroll(rawurl, home string) (*EnrollmentResponse, error)
Enroll a client given the server's URL and the client's home directory. The URL may be of the form: http://user:pass@host:port where user and pass are the enrollment ID and secret, respectively.
func (*ClientConfig) FrostSign ¶
func (c *ClientConfig) FrostSign(message []byte) []byte
type EnrollmentResponse ¶
type EnrollmentResponse struct { Identity *Identity CAInfo GetCAInfoResponse }
EnrollmentResponse is the response from Client.Enroll and Identity.Reenroll
type GetCAInfoResponse ¶
type GetCAInfoResponse struct { // CAName is the name of the CA CAName string // CAChain is the PEM-encoded bytes of the fabric-ca-server's CA chain. // The 1st element of the chain is the root CA cert CAChain []byte // Idemix issuer public key of the CA IssuerPublicKey []byte // Idemix issuer revocation public key of the CA IssuerRevocationPublicKey []byte // Version of the server Version string }
GetCAInfoResponse is the response from the GetCAInfo call
type Identity ¶
type Identity struct {
// contains filtered or unexported fields
}
Identity is fabric-ca's implementation of an identity
type KeyRequest ¶
type KeyRequest struct { Algo string `json:"algo" yaml:"algo" help:"Specify key algorithm"` Size int `json:"size" yaml:"size" help:"Specify key size"` ReuseKey bool `json:"reusekey" yaml:"reusekey" help:"Reuse existing key during reenrollment"` }
KeyRequest encapsulates size and algorithm for the key to be generated. If ReuseKey is set, reenrollment requests will reuse the existing private key.