{"modulePath":"github.com/eric-erki/https-hyperledger.org","version":"v0.6.1-preview","isLatest":false,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package ca\n\n## Variables\n\n```go\nvar (\n\t// TCertEncTCertIndex is the ASN1 object identifier of the TCert index.\n\tTCertEncTCertIndex = asn1.ObjectIdentifier{1, 2, 3, 4, 5, 6, 7}\n\n\t// TCertEncEnrollmentID is the ASN1 object identifier of the enrollment id.\n\tTCertEncEnrollmentID = asn1.ObjectIdentifier{1, 2, 3, 4, 5, 6, 8}\n\n\t// TCertAttributesHeaders is the ASN1 object identifier of attributes header.\n\tTCertAttributesHeaders = asn1.ObjectIdentifier{1, 2, 3, 4, 5, 6, 9}\n\n\t// Padding for encryption.\n\tPadding = []byte{255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255}\n\n\t// RootPreKeySize for attribute encryption keys derivation\n\tRootPreKeySize = 48\n)\n```\n\n```go\nvar (\n\t//ACAAttribute is the base OID to the attributes extensions.\n\tACAAttribute = asn1.ObjectIdentifier{1, 2, 3, 4, 5, 6, 10}\n)\n```\n\n```go\nvar (\n\t// ECertSubjectRole is the ASN1 object identifier of the subject's role.\n\t//\n\tECertSubjectRole = asn1.ObjectIdentifier{2, 1, 3, 4, 5, 6, 7}\n)\n```\n\n## Functions\n\n```go\nfunc CacheConfiguration()\n```\nCacheConfiguration caches the viper configuration\n\n```go\nfunc GetACAClient() (*grpc.ClientConn, pb.ACAPClient, error)\n```\nGetACAClient returns a client to Attribute Certificate Authority.\n\n```go\nfunc GetClientConn(address string, serverName string) (*grpc.ClientConn, error)\n```\nGetClientConn returns a connection to the server located on \\*address\\*.\n\n```go\nfunc IsAttributeOID(oid asn1.ObjectIdentifier) bool\n```\nIsAttributeOID returns if the oid passed as parameter is or not linked with an attribute\n\n```go\nfunc MemberRoleToString(role pb.Role) (string, error)\n```\nMemberRoleToString converts a member role representation from int32 to a string, according to the Role enum defined in ca.proto.\n\n```go\nfunc NewClientTLSFromFile(certFile, serverNameOverride string) (credentials.TransportCredentials, error)\n```\nNewClientTLSFromFile creates Client TLS connection credentials @certFile : TLS Server Certificate in PEM format @serverNameOverride : Common Name (CN) of the TLS Server Certificate returns Secure Transport Credentials\n\n## Types\n\n```go\ntype ACA struct {\n\t*CA\n\t// contains filtered or unexported fields\n}\n```\nACA is the attribute certificate authority.\n\n```go\nfunc NewACA() *ACA\n```\nNewACA sets up a new ACA.\n\n```go\nfunc (aca *ACA) PopulateAttributes(attrs []*AttributePair) error\n```\n\n```go\nfunc (aca *ACA) Start(srv *grpc.Server)\n```\nStart starts the ACA.\n\n```go\nfunc (aca *ACA) Stop() error\n```\nStop stops the ACA\n\n```go\ntype ACAA struct {\n\t// contains filtered or unexported fields\n}\n```\nACAA serves the administrator GRPC interface of the ACA.\n\n```go\ntype ACAP struct {\n\t// contains filtered or unexported fields\n}\n```\nACAP serves the public GRPC interface of the ACA.\n\n```go\nfunc (acap *ACAP) FetchAttributes(ctx context.Context, in *pb.ACAFetchAttrReq) (*pb.ACAFetchAttrResp, error)\n```\nFetchAttributes fetchs the attributes from the outside world and populate them into the database.\n\n```go\nfunc (acap *ACAP) ReadCACertificate(ctx context.Context, in *pb.Empty) (*pb.Cert, error)\n```\nReadCACertificate reads the certificate of the ACA.\n\n```go\nfunc (acap *ACAP) RequestAttributes(ctx context.Context, in *pb.ACAAttrReq) (*pb.ACAAttrResp, error)\n```\nRequestAttributes lookups the atributes in the database and return a certificate with attributes included in the request and found in the database.\n\n```go\ntype AffiliationGroup struct {\n\t// contains filtered or unexported fields\n}\n```\nAffiliationGroup struct\n\n```go\ntype AttributeOwner struct {\n\t// contains filtered or unexported fields\n}\n```\nAttributeOwner is the struct that contains the data related with the user who owns the attribute.\n\n```go\nfunc (attrOwner *AttributeOwner) GetAffiliation() string\n```\nGetAffiliation returns the affiliation related with the owner.\n\n```go\nfunc (attrOwner *AttributeOwner) GetID() string\n```\nGetID returns the id of the attributeOwner.\n\n```go\ntype AttributePair struct {\n\t// contains filtered or unexported fields\n}\n```\nAttributePair is an struct that store the relation between an owner (user who owns the attribute), attributeName (name of the attribute), attributeValue (value of the attribute), validFrom (time since the attribute is valid) and validTo (time until the attribute will be valid).\n\n```go\nfunc NewAttributePair(attributeVals []string, attrOwner *AttributeOwner) (*AttributePair, error)\n```\nNewAttributePair creates a new attribute pair associated with \\\u003cattrOwner\u003e.\n\n```go\nfunc (attrPair *AttributePair) GetAffiliation() string\n```\nGetAffiliation gets the affilition of the attribute pair.\n\n```go\nfunc (attrPair *AttributePair) GetAttributeName() string\n```\nGetAttributeName gets the attribute name related with the attribute pair.\n\n```go\nfunc (attrPair *AttributePair) GetAttributeValue() []byte\n```\nGetAttributeValue returns the value of the pair.\n\n```go\nfunc (attrPair *AttributePair) GetID() string\n```\nGetID returns the id of the attributePair.\n\n```go\nfunc (attrPair *AttributePair) GetOwner() *AttributeOwner\n```\nGetOwner returns the owner of the attribute pair.\n\n```go\nfunc (attrPair *AttributePair) GetValidFrom() time.Time\n```\nGetValidFrom returns time which is valid from the pair.\n\n```go\nfunc (attrPair *AttributePair) GetValidTo() time.Time\n```\nGetValidTo returns time which is valid to the pair.\n\n```go\nfunc (attrPair *AttributePair) IsValidFor(date time.Time) bool\n```\nIsValidFor returns if the pair is valid for date.\n\n```go\nfunc (attrPair *AttributePair) SetAttributeName(name string)\n```\nSetAttributeName sets the name related with the attribute pair.\n\n```go\nfunc (attrPair *AttributePair) SetAttributeValue(val []byte)\n```\nSetAttributeValue sets the value of the pair.\n\n```go\nfunc (attrPair *AttributePair) SetOwner(owner *AttributeOwner)\n```\nSetOwner sets the owner of the attributes.\n\n```go\nfunc (attrPair *AttributePair) SetValidFrom(date time.Time)\n```\nSetValidFrom returns time which is valid from the pair.\n\n```go\nfunc (attrPair *AttributePair) SetValidTo(date time.Time)\n```\nSetValidTo returns time which is valid to the pair.\n\n```go\nfunc (attrPair *AttributePair) ToACAAttribute() *pb.ACAAttribute\n```\nToACAAttribute converts the receiver to the protobuf format.\n\n```go\ntype CA struct {\n\t// contains filtered or unexported fields\n}\n```\nCA is the base certificate authority.\n\n```go\nfunc NewCA(name string, initTables TableInitializer) *CA\n```\nNewCA sets up a new CA.\n\n```go\nfunc (ca *CA) Stop() error\n```\nStop Close closes down the CA.\n\n```go\ntype CertificateSpec struct {\n\tNotBefore *time.Time\n\tNotAfter  *time.Time\n\t// contains filtered or unexported fields\n}\n```\nCertificateSpec defines the parameter used to create a new certificate.\n\n```go\nfunc NewCertificateSpec(id string, commonName string, serialNumber *big.Int, pub interface{}, usage x509.KeyUsage, notBefore *time.Time, notAfter *time.Time, opt ...pkix.Extension) *CertificateSpec\n```\nNewCertificateSpec creates a new certificate spec\n\n```go\nfunc NewDefaultCertificateSpec(id string, pub interface{}, usage x509.KeyUsage, opt ...pkix.Extension) *CertificateSpec\n```\nNewDefaultCertificateSpec creates a new certificate spec with serialNumber = 1, notBefore a minute ago and not after 90 days from notBefore.\n\n```go\nfunc NewDefaultCertificateSpecWithCommonName(id string, commonName string, pub interface{}, usage x509.KeyUsage, opt ...pkix.Extension) *CertificateSpec\n```\nNewDefaultCertificateSpecWithCommonName creates a new certificate spec with serialNumber = 1, notBefore a minute ago and not after 90 days from notBefore and a specific commonName.\n\n```go\nfunc NewDefaultPeriodCertificateSpec(id string, serialNumber *big.Int, pub interface{}, usage x509.KeyUsage, opt ...pkix.Extension) *CertificateSpec\n```\nNewDefaultPeriodCertificateSpec creates a new certificate spec with notBefore a minute ago and not after 90 days from notBefore.\n\n```go\nfunc NewDefaultPeriodCertificateSpecWithCommonName(id string, commonName string, serialNumber *big.Int, pub interface{}, usage x509.KeyUsage, opt ...pkix.Extension) *CertificateSpec\n```\nNewDefaultPeriodCertificateSpecWithCommonName creates a new certificate spec with notBefore a minute ago and not after 90 days from notBefore and a specifc commonName.\n\n```go\nfunc (spec *CertificateSpec) GetCommonName() string\n```\nGetCommonName returns the spec's Common Name field/value\n\n```go\nfunc (spec *CertificateSpec) GetCountry() string\n```\nGetCountry returns the spec's Country field/value\n\n```go\nfunc (spec *CertificateSpec) GetExtensions() *[]pkix.Extension\n```\nGetExtensions returns the sepc's extensions\n\n```go\nfunc (spec *CertificateSpec) GetID() string\n```\nGetID returns the spec's ID field/value\n\n```go\nfunc (spec *CertificateSpec) GetNotAfter() *time.Time\n```\nGetNotAfter returns the spec NotAfter (time.Time) field/value\n\n```go\nfunc (spec *CertificateSpec) GetNotBefore() *time.Time\n```\nGetNotBefore returns the spec NotBefore (time.Time) field/value\n\n```go\nfunc (spec *CertificateSpec) GetOrganization() string\n```\nGetOrganization returns the spec's Organization field/value\n\n```go\nfunc (spec *CertificateSpec) GetPublicKey() interface{}\n```\nGetPublicKey returns the spec's Public Key field/value\n\n```go\nfunc (spec *CertificateSpec) GetSerialNumber() *big.Int\n```\nGetSerialNumber returns the spec's Serial Number field/value\n\n```go\nfunc (spec *CertificateSpec) GetSignatureAlgorithm() x509.SignatureAlgorithm\n```\nGetSignatureAlgorithm returns the X509.SignatureAlgorithm field/value\n\n```go\nfunc (spec *CertificateSpec) GetSubjectKeyID() *[]byte\n```\nGetSubjectKeyID returns the spec's subject KeyID\n\n```go\nfunc (spec *CertificateSpec) GetUsage() x509.KeyUsage\n```\nGetUsage returns the spec's usage (which is the x509.KeyUsage) field/value\n\n```go\ntype ECA struct {\n\t*CA\n\t// contains filtered or unexported fields\n}\n```\nECA is the enrollment certificate authority.\n\n```go\nfunc NewECA(aca *ACA) *ECA\n```\nNewECA sets up a new ECA.\n\n```go\nfunc (eca *ECA) Start(srv *grpc.Server)\n```\nStart starts the ECA.\n\n```go\nfunc (eca *ECA) Stop()\n```\nStop stops the ECA services.\n\n```go\ntype ECAA struct {\n\t// contains filtered or unexported fields\n}\n```\nECAA serves the administrator GRPC interface of the ECA.\n\n```go\nfunc (ecaa *ECAA) PublishCRL(context.Context, *pb.ECertCRLReq) (*pb.CAStatus, error)\n```\nPublishCRL requests the creation of a certificate revocation list from the ECA.  Not yet implemented.\n\n```go\nfunc (ecaa *ECAA) ReadUserSet(ctx context.Context, in *pb.ReadUserSetReq) (*pb.UserSet, error)\n```\nReadUserSet returns a list of users matching the parameters set in the read request.\n\n```go\nfunc (ecaa *ECAA) RegisterUser(ctx context.Context, in *pb.RegisterUserReq) (*pb.Token, error)\n```\nRegisterUser registers a new user with the ECA.  If the user had been registered before an error is returned.\n\n```go\nfunc (ecaa *ECAA) RevokeCertificate(context.Context, *pb.ECertRevokeReq) (*pb.CAStatus, error)\n```\nRevokeCertificate revokes a certificate from the ECA.  Not yet implemented.\n\n```go\ntype ECAP struct {\n\t// contains filtered or unexported fields\n}\n```\nECAP serves the public GRPC interface of the ECA.\n\n```go\nfunc (ecap *ECAP) CreateCertificatePair(ctx context.Context, in *pb.ECertCreateReq) (*pb.ECertCreateResp, error)\n```\nCreateCertificatePair requests the creation of a new enrollment certificate pair by the ECA.\n\n```go\nfunc (ecap *ECAP) ReadCACertificate(ctx context.Context, in *pb.Empty) (*pb.Cert, error)\n```\nReadCACertificate reads the certificate of the ECA.\n\n```go\nfunc (ecap *ECAP) ReadCertificateByHash(ctx context.Context, hash *pb.Hash) (*pb.Cert, error)\n```\nReadCertificateByHash reads a single enrollment certificate by hash from the ECA.\n\n```go\nfunc (ecap *ECAP) ReadCertificatePair(ctx context.Context, in *pb.ECertReadReq) (*pb.CertPair, error)\n```\nReadCertificatePair reads an enrollment certificate pair from the ECA.\n\n```go\nfunc (ecap *ECAP) RevokeCertificatePair(context.Context, *pb.ECertRevokeReq) (*pb.CAStatus, error)\n```\nRevokeCertificatePair revokes a certificate pair from the ECA.  Not yet implemented.\n\n```go\ntype MemberMetadata struct {\n\tRegistrar Registrar `json:\"registrar\"`\n}\n```\nMemberMetadata Additional member metadata\n\n```go\ntype Registrar struct {\n\tRoles         []string `json:\"roles\"`\n\tDelegateRoles []string `json:\"delegateRoles\"`\n}\n```\nRegistrar metadata\n\n```go\ntype TCA struct {\n\t*CA\n\t// contains filtered or unexported fields\n}\n```\nTCA is the transaction certificate authority.\n\n```go\nfunc NewTCA(eca *ECA) *TCA\n```\nNewTCA sets up a new TCA.\n\n```go\nfunc (tca *TCA) Start(srv *grpc.Server)\n```\nStart starts the TCA.\n\n```go\nfunc (tca *TCA) Stop() error\n```\nStop stops the TCA services.\n\n```go\ntype TCAA struct {\n\t// contains filtered or unexported fields\n}\n```\nTCAA serves the administrator GRPC interface of the TCA.\n\n```go\nfunc (tcaa *TCAA) PublishCRL(context.Context, *pb.TCertCRLReq) (*pb.CAStatus, error)\n```\nPublishCRL requests the creation of a certificate revocation list from the TCA.  Not yet implemented.\n\n```go\nfunc (tcaa *TCAA) RevokeCertificate(context.Context, *pb.TCertRevokeReq) (*pb.CAStatus, error)\n```\nRevokeCertificate revokes a certificate from the TCA.  Not yet implemented.\n\n```go\nfunc (tcaa *TCAA) RevokeCertificateSet(context.Context, *pb.TCertRevokeSetReq) (*pb.CAStatus, error)\n```\nRevokeCertificateSet revokes a certificate set from the TCA.  Not yet implemented.\n\n```go\ntype TCAP struct {\n\t// contains filtered or unexported fields\n}\n```\nTCAP serves the public GRPC interface of the TCA.\n\n```go\nfunc (tcap *TCAP) CreateCertificateSet(ctx context.Context, in *pb.TCertCreateSetReq) (*pb.TCertCreateSetResp, error)\n```\nCreateCertificateSet requests the creation of a new transaction certificate set by the TCA.\n\n```go\nfunc (tcap *TCAP) ReadCACertificate(ctx context.Context, in *pb.Empty) (*pb.Cert, error)\n```\nReadCACertificate reads the certificate of the TCA.\n\n```go\nfunc (tcap *TCAP) RevokeCertificate(context.Context, *pb.TCertRevokeReq) (*pb.CAStatus, error)\n```\nRevokeCertificate revokes a certificate from the TCA.  Not yet implemented.\n\n```go\nfunc (tcap *TCAP) RevokeCertificateSet(context.Context, *pb.TCertRevokeSetReq) (*pb.CAStatus, error)\n```\nRevokeCertificateSet revokes a certificate set from the TCA.  Not yet implemented.\n\n```go\ntype TCertSet struct {\n\tTs           int64\n\tEnrollmentID string\n\tNonce        []byte\n\tKey          []byte\n}\n```\nTCertSet contains relevant information of a set of tcerts\n\n```go\ntype TLSCA struct {\n\t*CA\n\t// contains filtered or unexported fields\n}\n```\nTLSCA is the tls certificate authority.\n\n```go\nfunc NewTLSCA(eca *ECA) *TLSCA\n```\nNewTLSCA sets up a new TLSCA.\n\n```go\nfunc (tlsca *TLSCA) Start(srv *grpc.Server)\n```\nStart starts the TLSCA.\n\n```go\nfunc (tlsca *TLSCA) Stop() error\n```\nStop stops the TCA services.\n\n```go\ntype TLSCAA struct {\n\t// contains filtered or unexported fields\n}\n```\nTLSCAA serves the administrator GRPC interface of the TLS.\n\n```go\nfunc (tlscaa *TLSCAA) RevokeCertificate(context.Context, *pb.TLSCertRevokeReq) (*pb.CAStatus, error)\n```\nRevokeCertificate revokes a certificate from the TLSCA.  Not yet implemented.\n\n```go\ntype TLSCAP struct {\n\t// contains filtered or unexported fields\n}\n```\nTLSCAP serves the public GRPC interface of the TLSCA.\n\n```go\nfunc (tlscap *TLSCAP) CreateCertificate(ctx context.Context, in *pb.TLSCertCreateReq) (*pb.TLSCertCreateResp, error)\n```\nCreateCertificate requests the creation of a new enrollment certificate by the TLSCA.\n\n```go\nfunc (tlscap *TLSCAP) ReadCACertificate(ctx context.Context, in *pb.Empty) (*pb.Cert, error)\n```\nReadCACertificate reads the certificate of the TLSCA.\n\n```go\nfunc (tlscap *TLSCAP) ReadCertificate(ctx context.Context, in *pb.TLSCertReadReq) (*pb.Cert, error)\n```\nReadCertificate reads an enrollment certificate from the TLSCA.\n\n```go\nfunc (tlscap *TLSCAP) RevokeCertificate(context.Context, *pb.TLSCertRevokeReq) (*pb.CAStatus, error)\n```\nRevokeCertificate revokes a certificate from the TLSCA.  Not yet implemented.\n\n```go\ntype TableInitializer func(*sql.DB) error\n```\nTableInitializer is a function type for table initialization\n\n","path":"github.com/eric-erki/https-hyperledger.org/membersrvc/ca","name":"ca","synopsis":"","isRedistributable":true}
