Versions in this module Expand all Collapse all v0 v0.6.0 Jun 28, 2019 Changes in this version + func Register(ca *PalletCAClient, identity *Identity, req *CARegistrationRequest) ([]byte, error) + func Revoke(ca *PalletCAClient, identity *Identity, req *CARevocationRequest) ([]byte, error) + func SaveCrl(ca *PalletCAClient, request *CARevocationRequest, result *CARevokeResult) ([]byte, error) + type BasicKeyRequest struct + Algo string + Size int + type CAGetCertResponse struct + CAName string + IntermediateCertificates []*pem.Block + RootCertificates []*x509.Certificate + Version string + func GetCertificateChain(ca *PalletCAClient, identity *Identity, caName string) (CAGetCertResponse, error) + type CAGetIdentityResponse struct + CAName string + func GetIndentity(ca *PalletCAClient, identity *Identity, id string, caName string) (CAGetIdentityResponse, error) + type CAListAllIdentitesResponse struct + CAName string + Identities []CaIdentityResponse + func GetIndentities(ca *PalletCAClient, identity *Identity) (CAListAllIdentitesResponse, error) + type CARegistrationRequest struct + Affiliation string + Attrs []CaRegisterAttribute + CAName string + EnrolmentId string + MaxEnrollments int + Secert string + Type string + type CARevocationRequest struct + AKI string + CAName string + EnrollmentId string + GenCRL bool + Reason string + Serial string + type CARevokeResult struct + CRL string + RevokedCertificates []CaRevokeResultCertificate + type CSRInfo struct + CA *csr.CAConfig + CN string + Hosts []string + KeyRequest *BasicKeyRequest + Names []csr.Name + SerialNumber string + type CaEnrollAttribute struct + Name string + Optional bool + type CaEnrollmentRequest struct + Attrs []CaEnrollAttribute + CAName string + CSR *CSRInfo + EnrollmentId string + Hosts []string + Label string + Profile string + Secret string + type CaGenInfo struct + Affiliation string + Data string + ECert bool + EnrolmentId string + Name string + Type string + func NewCaGenInfo(address string, name string, data string, ecert bool, ty string, ...) *CaGenInfo + func (c *CaGenInfo) EnrollAdmin() error + func (c *CaGenInfo) Enrolluser() ([]byte, error) + func (c *CaGenInfo) GetCaCertificateChain(caName string) (*CAGetCertResponse, error) + func (c *CaGenInfo) GetIndentities() (*CAListAllIdentitesResponse, error) + func (c *CaGenInfo) GetIndentity(enrollmentid, caname string) (*CAGetIdentityResponse, error) + func (c *CaGenInfo) Revoke(enrollmentid, reason string) ([]byte, error) + type CaIdentityResponse struct + Affiliation string + Attributes []CaRegisterAttribute + ID string + MaxEnrollments int + Type string + type CaRegisterAttribute struct + ECert bool + Name string + Value string + type CaRevokeResultCertificate struct + AKI string + Serial string + type CryptoSuite interface + CreateCertificateRequest func(enrollmentId string, key interface{}, hosts []string) ([]byte, error) + GenerateKey func() (interface{}, error) + Hash func(data []byte) []byte + Sign func(msg []byte, k interface{}) ([]byte, error) + func NewECCryptoSuiteFromConfig(conf config.CryptoConfig) (CryptoSuite, error) + type ECCryptSuite struct + func (c *ECCryptSuite) CreateCertificateRequest(enrollmentId string, key interface{}, hosts []string) ([]byte, error) + func (c *ECCryptSuite) GenerateKey() (interface{}, error) + func (c *ECCryptSuite) Hash(data []byte) []byte + func (c *ECCryptSuite) Sign(msg []byte, k interface{}) ([]byte, error) + type Identity struct + Certificate *x509.Certificate + MspId string + PrivateKey interface{} + var ID *Identity + func Enroll(ca *PalletCAClient, req CaEnrollmentRequest) (*Identity, []byte, error) + func (i *Identity) GetCertByte() []byte + func (i *Identity) SaveCert(ca *PalletCAClient, enreq *CaEnrollmentRequest, cainfo *CAGetCertResponse) error + func (i *Identity) SaveTLScert(ca *PalletCAClient, cainfo *CAGetCertResponse) error + type PalletCAClient struct + Admin string + Adminpw string + Crypto CryptoSuite + FilePath string + MspId string + ServerInfo ServerInfo + SkipTLSVerification bool + Transport *http.Transport + Url string + var CA *PalletCAClient + func InitCASDK(configPth string, configFile string) (*PalletCAClient, error) + func NewCAClient(path string, transport *http.Transport) (*PalletCAClient, error) + func NewCaClientFromConfig(conf config.CAConfig, transport *http.Transport) (*PalletCAClient, error) + func (f *PalletCAClient) Enroll(request CaEnrollmentRequest) (*Identity, []byte, error) + func (f *PalletCAClient) GetCaCertificateChain(caName string) (*CAGetCertResponse, error) + func (f *PalletCAClient) GetIdentities(identity *Identity, caName string) (*CAListAllIdentitesResponse, error) + func (f *PalletCAClient) GetIndentity(identity *Identity, id string, caName string) (*CAGetIdentityResponse, error) + func (f *PalletCAClient) Register(identity *Identity, req *CARegistrationRequest) (string, error) + func (f *PalletCAClient) Revoke(identity *Identity, request *CARevocationRequest) (*CARevokeResult, error) + type ServerInfo struct + CACert *x509.Certificate + CAName string