{"modulePath":"github.com/eric-erki/https-hyperledger.org","version":"v1.0.0-alpha","isLatest":false,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package attributes\n\n## Variables\n\n```go\nvar (\n\t// TCertEncAttributesBase is the base ASN1 object identifier for attributes.\n\t// When generating an extension to include the attribute an index will be\n\t// appended to this Object Identifier.\n\tTCertEncAttributesBase = asn1.ObjectIdentifier{1, 2, 3, 4, 5, 6}\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//HeaderAttributeName is the name used to derive the K used to encrypt/decrypt the header.\n\tHeaderAttributeName = \"attributeHeader\"\n)\n```\n\n## Functions\n\n```go\nfunc BuildAttributesHeader(attributesHeader map[string]int) ([]byte, error)\n```\nBuildAttributesHeader builds a header attribute from a map of attribute names and positions.\n\n```go\nfunc CreateAttributesMetadata(raw []byte, metadata []byte, preK0 []byte, attributeKeys []string) ([]byte, error)\n```\nCreateAttributesMetadata create the AttributesMetadata from the original metadata\n\n```go\nfunc CreateAttributesMetadataFromCert(cert *x509.Certificate, metadata []byte, preK0 []byte, attributeKeys []string) ([]byte, error)\n```\nCreateAttributesMetadataFromCert creates the AttributesMetadata from the original metadata and certificate \"cert\".\n\n```go\nfunc CreateAttributesMetadataObjectFromCert(cert *x509.Certificate, metadata []byte, preK0 []byte, attributeKeys []string) *pb.AttributesMetadata\n```\nCreateAttributesMetadataObjectFromCert creates an AttributesMetadata object from certificate \"cert\", metadata and the attributes keys.\n\n```go\nfunc DecryptAttributeValue(attributeKey []byte, encryptedValue []byte) ([]byte, error)\n```\nDecryptAttributeValue decrypts \"encryptedValue\" using \"attributeKey\" and return the decrypted value.\n\n```go\nfunc EncryptAttributeValue(attributeKey []byte, attributeValue []byte) ([]byte, error)\n```\nEncryptAttributeValue encrypts \"attributeValue\" using \"attributeKey\"\n\n```go\nfunc EncryptAttributeValuePK0(preK0 []byte, attributeName string, attributeValue []byte) ([]byte, error)\n```\nEncryptAttributeValuePK0 encrypts \"attributeValue\" using a key derived from preK0.\n\n```go\nfunc GetAttributesMetadata(metadata []byte) (*pb.AttributesMetadata, error)\n```\nGetAttributesMetadata object from the original metadata \"metadata\".\n\n```go\nfunc GetKForAttribute(attributeName string, preK0 []byte, cert *x509.Certificate) ([]byte, error)\n```\nGetKForAttribute derives the K for the attribute \"attributeName\" and returns the key\n\n```go\nfunc GetValueForAttribute(attributeName string, preK0 []byte, cert *x509.Certificate) ([]byte, error)\n```\nGetValueForAttribute derives the K for the attribute \"attributeName\" and returns the value\n\n```go\nfunc ParseAttributesHeader(header string) (map[string]int, error)\n```\nParseAttributesHeader parses a string and returns a map with the attributes.\n\n```go\nfunc ReadAttributeHeader(tcert *x509.Certificate, headerKey []byte) (map[string]int, bool, error)\n```\nReadAttributeHeader read the header of the attributes.\n\n```go\nfunc ReadTCertAttribute(tcert *x509.Certificate, attributeName string, headerKey []byte) ([]byte, bool, error)\n```\nReadTCertAttribute read the attribute with name \"attributeName\" and returns the value and a boolean indicating if the returned value is encrypted or not.\n\n```go\nfunc ReadTCertAttributeByPosition(tcert *x509.Certificate, position int) ([]byte, error)\n```\nReadTCertAttributeByPosition read the attribute stored in the position \"position\" of the tcert.\n\n","path":"github.com/eric-erki/https-hyperledger.org/accesscontrol/attributes","name":"attributes","synopsis":"","isRedistributable":true}
