Documentation ¶
Overview ¶
Package cbeff contains helpers to process CBEFF (Common Biometric Exchange Formats Framework) data. CBEFF is a set of ISO standards defining an approach to facilitate serialisation and sharing of biometric data in an implementation agnostic manner. This is achieved through use of a data structure which both describes, and contains, biometric data.
This format is most notibly used as part of the US Government's FIPS 201 PIV II smartcard.
Currently, only Facial support has been partially implemented, due to the paywalled documetation on large swaths of this encoding. This package has been implemented only based on freely avalible US Government provided examples of PIV II data and documentation. As such this may be incomplete or slightly wrong in some aspects. Please submit pull requests as issues are triaged.
Index ¶
- Variables
- type BiographicalInformation
- type BiographicalInformationEyeColor
- type BiographicalInformationGender
- type BiographicalInformationHairColor
- type BiometricType
- type CBEFF
- type Facial
- type FacialFeature
- type FacialHeader
- type FacialInformation
- type Header
- type Image
- type ImageInformation
- type Time
Constants ¶
This section is empty.
Variables ¶
var ( // BiometricTypeFingerprint indicates the CBEFF file contains fingerprint // information. This may either be an enrollment or minutiae. BiometricTypeFingerprint = BiometricType{0x00, 0x00, 0x08} // BiometricTypeFacial indicates the CBEFF file contains the facial photos // to be used for visual confirmation of the individual. BiometricTypeFacial = BiometricType{0x00, 0x00, 0x02} )
Functions ¶
This section is empty.
Types ¶
type BiographicalInformation ¶
type BiographicalInformation struct { Gender BiographicalInformationGender EyeColor BiographicalInformationEyeColor HairColor BiographicalInformationHairColor Properties [3]byte }
BiographicalInformation contains information about the individual who is the subject of the Image. This is not frequently used, and likely should not be relied on.
func (BiographicalInformation) String ¶
func (b BiographicalInformation) String() string
String will return a human readable string.
type BiographicalInformationEyeColor ¶
type BiographicalInformationEyeColor uint8
BiographicalInformationEyeColor will return the eye color of the subject of the Image.
func (BiographicalInformationEyeColor) String ¶
func (b BiographicalInformationEyeColor) String() string
String will return a human readable string.
type BiographicalInformationGender ¶
type BiographicalInformationGender uint8
BiographicalInformationGender contains inforamtion on the subject of the Image's "Gender". Whatever this could possibly mean, it's not something to be used if it's avoidable.
func (BiographicalInformationGender) String ¶
func (b BiographicalInformationGender) String() string
String will return a human readable string.
type BiographicalInformationHairColor ¶
type BiographicalInformationHairColor uint8
BiographicalInformationHairColor will return the hair color of the subject of the Image.
func (BiographicalInformationHairColor) String ¶
func (b BiographicalInformationHairColor) String() string
String will return a human readable string.
type BiometricType ¶
type BiometricType [3]byte
BiometricType indicates the type of biometric stored in the CBEFF, such as Face photos, or Fingerprints.
func (BiometricType) Equal ¶
func (b BiometricType) Equal(o BiometricType) bool
Equal will check to see if the two BiometricTypes are the same.
type CBEFF ¶
type CBEFF struct { // CBEFF file metadata, such as what kind of file this is, sizes of the // various payloads, and information such as creator, who the metric is of, // and validity time. Header Header // io.Reader over this CBEFF entry. This reader must be fully read before // moving onto any other files on the same Reader. Reader io.Reader }
CBEFF is an ecapsulation of a CBEFF serialized file. This will allow you to dispatch based on the Header.BiometricType, and extract the information depending on what type of CBEFF entry it is.
type Facial ¶
type Facial struct { Header FacialHeader Images []Image Reader io.Reader }
Facial contains a series of images and annotations.
type FacialFeature ¶
type FacialFeature struct { Type uint8 MajorPoint uint8 MinorPoint uint8 X uint16 Y uint16 Reserved uint8 }
FacialFeature contains an annotation on the attached Image.
type FacialHeader ¶
type FacialHeader struct { FormatID [4]byte VersionID [4]byte RecordLength uint32 NumberFaces uint16 }
FacialHeader contains information about the Facial record to follow.
func (FacialHeader) Validate ¶
func (fh FacialHeader) Validate() error
Validate will ensure that the FacialHeader is well formatted and understood by this library.
type FacialInformation ¶
type FacialInformation struct { Length uint32 NumberOfPoints uint16 BiographicalInformation BiographicalInformation Expression [2]byte Pose [3]byte PoseUncertainty [3]byte }
FacialInformation contains information regarding the Image this is attached to.
func (FacialInformation) Validate ¶
func (fi FacialInformation) Validate() error
Validate will ensure that this library understands and can properly process this data.
type Header ¶
type Header struct { PatronHeaderVersion uint8 SBHSecurityOptions uint8 BDBLength uint32 SBLength uint16 BDBFormatOwner uint16 BDBFormatType uint16 BiometricCreationDate Time ValidityNotBefore Time ValidityNotAfter Time BiometricType BiometricType BiometricDataType uint8 BiometricDataQuality uint8 Creator [18]byte FASC [25]byte Reserved [4]byte }
Header contains information regarding the CBEFF data contained within the data stream.
type Image ¶
type Image struct { FacialInformation FacialInformation ImageInformation ImageInformation Features []FacialFeature Data []byte }
Image represents annotations and metadata attached to the image contained within.
type ImageInformation ¶
type ImageInformation struct { Type uint8 DataType uint8 Width uint16 Height uint16 ColorSpace uint8 SourceType uint8 DeviceType uint16 Quality uint16 }
ImageInformation contains metadata regarding the format of the image data.
func (ImageInformation) Validate ¶
func (ii ImageInformation) Validate() error
Validate will ensure that this library understands and can properly process this data.