Documentation ¶
Index ¶
- func BytesToX509Cert(bytes []byte) (*x509.Certificate, error)
- func GetCertID(bytes []byte) (string, string, error)
- func NormalizeURL(addr string) (*url.URL, error)
- type CAConfig
- type CertificateStatus
- type Client
- func (c *Client) Enroll(req *api.EnrollmentRequest) (*EnrollmentResponse, error)
- func (c *Client) GenCSR(req *api.CSRInfo, id string) ([]byte, core.Key, error)
- func (c *Client) Init() error
- func (c *Client) NewIdentity(key core.Key, cert []byte) (*Identity, error)
- func (c *Client) SendReq(req *http.Request, result interface{}) (err error)
- type ClientConfig
- type EnrollmentResponse
- type GetServerInfoResponse
- type Identity
- func (i *Identity) GetECert() *Signer
- func (i *Identity) GetName() string
- func (i *Identity) Post(endpoint string, reqBody []byte, result interface{}, ...) error
- func (i *Identity) Reenroll(req *api.ReenrollmentRequest) (*EnrollmentResponse, error)
- func (i *Identity) Register(req *api.RegistrationRequest) (rr *api.RegistrationResponse, err error)
- func (i *Identity) Revoke(req *api.RevocationRequest) (*api.RevocationResponse, error)
- type ServerConfig
- type Signer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BytesToX509Cert ¶
func BytesToX509Cert(bytes []byte) (*x509.Certificate, error)
BytesToX509Cert converts bytes (PEM or DER) to an X509 certificate
Types ¶
type CertificateStatus ¶
type CertificateStatus string
CertificateStatus represents status of an enrollment certificate
const ( // Revoked is the status of a revoked certificate Revoked CertificateStatus = "revoked" // Good is the status of a active certificate Good = "good" )
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
func (*Client) NewIdentity ¶
NewIdentity creates a new identity
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 core.CryptoSuite `mapstructure:"bccsp"` }
ClientConfig is the fabric-ca client's config
type EnrollmentResponse ¶
type EnrollmentResponse struct { Identity *Identity ServerInfo GetServerInfoResponse }
EnrollmentResponse is the response from Client.Enroll and Identity.Reenroll
type GetServerInfoResponse ¶
type GetServerInfoResponse 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 // Version of the server Version string }
GetServerInfoResponse is the response from the GetServerInfo call
type Identity ¶
type Identity struct { CSP core.CryptoSuite // contains filtered or unexported fields }
Identity is fabric-ca's implementation of an identity
func (*Identity) Post ¶
func (i *Identity) Post(endpoint string, reqBody []byte, result interface{}, queryParam map[string]string) error
Post sends arbitrary request body (reqBody) to an endpoint. This adds an authorization header which contains the signature of this identity over the body and non-signature part of the authorization header. The return value is the body of the response.
func (*Identity) Reenroll ¶
func (i *Identity) Reenroll(req *api.ReenrollmentRequest) (*EnrollmentResponse, error)
Reenroll reenrolls an existing Identity and returns a new Identity @param req The reenrollment request
func (*Identity) Register ¶
func (i *Identity) Register(req *api.RegistrationRequest) (rr *api.RegistrationResponse, err error)
Register registers a new identity @param req The registration request
func (*Identity) Revoke ¶
func (i *Identity) Revoke(req *api.RevocationRequest) (*api.RevocationResponse, error)
Revoke the identity associated with 'id'