Documentation ¶
Index ¶
- Variables
- func BuildAttributesHeader(attributesHeader map[string]int) ([]byte, error)
- func CreateAttributesMetadata(raw []byte, metadata []byte, preK0 []byte, attributeKeys []string) ([]byte, error)
- func CreateAttributesMetadataFromCert(cert *x509.Certificate, metadata []byte, preK0 []byte, attributeKeys []string) ([]byte, error)
- func CreateAttributesMetadataObjectFromCert(cert *x509.Certificate, metadata []byte, preK0 []byte, attributeKeys []string) *pb.AttributesMetadata
- func DecryptAttributeValue(attributeKey []byte, encryptedValue []byte) ([]byte, error)
- func EncryptAttributeValue(attributeKey []byte, attributeValue []byte) ([]byte, error)
- func EncryptAttributeValuePK0(preK0 []byte, attributeName string, attributeValue []byte) ([]byte, error)
- func GetAttributesMetadata(metadata []byte) (*pb.AttributesMetadata, error)
- func GetKForAttribute(attributeName string, preK0 []byte, cert *x509.Certificate) ([]byte, error)
- func GetValueForAttribute(attributeName string, preK0 []byte, cert *x509.Certificate) ([]byte, error)
- func ParseAttributesHeader(header string) (map[string]int, error)
- func ReadAttributeHeader(tcert *x509.Certificate, headerKey []byte) (map[string]int, bool, error)
- func ReadTCertAttribute(tcert *x509.Certificate, attributeName string, headerKey []byte) ([]byte, bool, error)
- func ReadTCertAttributeByPosition(tcert *x509.Certificate, position int) ([]byte, error)
Constants ¶
This section is empty.
Variables ¶
var ( // TCertEncAttributesBase is the base ASN1 object identifier for attributes. // When generating an extension to include the attribute an index will be // appended to this Object Identifier. TCertEncAttributesBase = asn1.ObjectIdentifier{1, 2, 3, 4, 5, 6} // TCertAttributesHeaders is the ASN1 object identifier of attributes header. TCertAttributesHeaders = asn1.ObjectIdentifier{1, 2, 3, 4, 5, 6, 9} //HeaderAttributeName is the name used to derive the K used to encrypt/decrypt the header. HeaderAttributeName = "attributeHeader" )
Functions ¶
func BuildAttributesHeader ¶
BuildAttributesHeader builds a header attribute from a map of attribute names and positions.
func CreateAttributesMetadata ¶
func CreateAttributesMetadata(raw []byte, metadata []byte, preK0 []byte, attributeKeys []string) ([]byte, error)
CreateAttributesMetadata create the AttributesMetadata from the original metadata
func CreateAttributesMetadataFromCert ¶
func CreateAttributesMetadataFromCert(cert *x509.Certificate, metadata []byte, preK0 []byte, attributeKeys []string) ([]byte, error)
CreateAttributesMetadataFromCert creates the AttributesMetadata from the original metadata and certificate "cert".
func CreateAttributesMetadataObjectFromCert ¶
func CreateAttributesMetadataObjectFromCert(cert *x509.Certificate, metadata []byte, preK0 []byte, attributeKeys []string) *pb.AttributesMetadata
CreateAttributesMetadataObjectFromCert creates an AttributesMetadata object from certificate "cert", metadata and the attributes keys.
func DecryptAttributeValue ¶
DecryptAttributeValue decrypts "encryptedValue" using "attributeKey" and return the decrypted value.
func EncryptAttributeValue ¶
EncryptAttributeValue encrypts "attributeValue" using "attributeKey"
func EncryptAttributeValuePK0 ¶
func EncryptAttributeValuePK0(preK0 []byte, attributeName string, attributeValue []byte) ([]byte, error)
EncryptAttributeValuePK0 encrypts "attributeValue" using a key derived from preK0.
func GetAttributesMetadata ¶
func GetAttributesMetadata(metadata []byte) (*pb.AttributesMetadata, error)
GetAttributesMetadata object from the original metadata "metadata".
func GetKForAttribute ¶
GetKForAttribute derives the K for the attribute "attributeName" and returns the key
func GetValueForAttribute ¶
func GetValueForAttribute(attributeName string, preK0 []byte, cert *x509.Certificate) ([]byte, error)
GetValueForAttribute derives the K for the attribute "attributeName" and returns the value
func ParseAttributesHeader ¶
ParseAttributesHeader parses a string and returns a map with the attributes.
func ReadAttributeHeader ¶
ReadAttributeHeader read the header of the attributes.
func ReadTCertAttribute ¶
func ReadTCertAttribute(tcert *x509.Certificate, attributeName string, headerKey []byte) ([]byte, bool, error)
ReadTCertAttribute read the attribute with name "attributeName" and returns the value and a boolean indicating if the returned value is encrypted or not.
func ReadTCertAttributeByPosition ¶
func ReadTCertAttributeByPosition(tcert *x509.Certificate, position int) ([]byte, error)
ReadTCertAttributeByPosition read the attribute stored in the position "position" of the tcert.
Types ¶
This section is empty.