{"modulePath":"github.com/eric-erki/https-hyperledger.org","version":"v1.4.4","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package attrmgr\n\n## Variables\n\n```go\nvar (\n\t// AttrOID is the ASN.1 object identifier for an attribute extension in an\n\t// X509 certificate\n\tAttrOID = asn1.ObjectIdentifier{1, 2, 3, 4, 5, 6, 7, 8, 1}\n\t// AttrOIDString is the string version of AttrOID\n\tAttrOIDString = \"1.2.3.4.5.6.7.8.1\"\n)\n```\n\n## Types\n\n```go\ntype Attribute interface {\n\t// GetName returns the name of the attribute\n\tGetName() string\n\t// GetValue returns the value of the attribute\n\tGetValue() string\n}\n```\nAttribute is a name/value pair\n\n```go\ntype AttributeRequest interface {\n\t// GetName returns the name of an attribute\n\tGetName() string\n\t// IsRequired returns true if the attribute is required\n\tIsRequired() bool\n}\n```\nAttributeRequest is a request for an attribute\n\n```go\ntype Attributes struct {\n\tAttrs map[string]string `json:\"attrs\"`\n}\n```\nAttributes contains attribute names and values\n\n```go\nfunc (a *Attributes) Contains(name string) bool\n```\nContains returns true if the named attribute is found\n\n```go\nfunc (a *Attributes) Names() []string\n```\nNames returns the names of the attributes\n\n```go\nfunc (a *Attributes) True(name string) error\n```\nTrue returns nil if the value of attribute 'name' is true; otherwise, an appropriate error is returned.\n\n```go\nfunc (a *Attributes) Value(name string) (string, bool, error)\n```\nValue returns an attribute's value\n\n```go\ntype Mgr struct{}\n```\nMgr is the attribute manager and is the main object for this package\n\n```go\nfunc New() *Mgr\n```\nNew constructs an attribute manager\n\n```go\nfunc (mgr *Mgr) AddAttributesToCert(attrs *Attributes, cert *x509.Certificate) error\n```\nAddAttributesToCert adds public attribute info to an X509 certificate.\n\n```go\nfunc (mgr *Mgr) GetAttributesFromCert(cert *x509.Certificate) (*Attributes, error)\n```\nGetAttributesFromCert gets the attributes from a certificate.\n\n```go\nfunc (mgr *Mgr) ProcessAttributeRequests(requests []AttributeRequest, attributes []Attribute) (*Attributes, error)\n```\nProcessAttributeRequests takes an array of attribute requests and an identity's attributes and returns an Attributes object containing the requested attributes.\n\n```go\nfunc (mgr *Mgr) ProcessAttributeRequestsForCert(requests []AttributeRequest, attributes []Attribute, cert *x509.Certificate) error\n```\nProcessAttributeRequestsForCert add attributes to an X509 certificate, given attribute requests and attributes.\n\n","path":"github.com/eric-erki/https-hyperledger.org/common/attrmgr","name":"attrmgr","synopsis":"","isRedistributable":true}
