Documentation ¶
Overview ¶
Package document implements data structures for representing the content of the MRTD.
Index ¶
- Constants
- type ActiveAuthenticationInfo
- type BiometricDataBlock
- type BiometricHeaderTemplate
- type BiometricInfoTemplate
- type COM
- type CardAccess
- type CardSecurity
- type ChipAuthStatus
- type ChipAuthenticationInfo
- type ChipAuthenticationPublicKeyInfo
- type DG1
- type DG11
- type DG12
- type DG13
- type DG14
- type DG15
- type DG16
- type DG2
- type DG7
- type DG7Image
- type DataGroupHash
- type Document
- type DocumentDetails
- type EFDIR
- type EFDirInfo
- type EfDirApplication
- type Facial
- type FacialFeature
- type FacialHeader
- type FacialInfo
- type Image
- type ImageInfo
- type LDS1
- type LDSSecurityObject
- type LDSVersionInfo
- type MasterFile
- type PaceDomainParameterInfo
- type PaceInfo
- type PassiveAuth
- type PersonDetails
- type SOD
- type SecurityInfoOid
- type SecurityInfoOidSET
- type SecurityInfos
- type TerminalAuthenticationInfo
- type UnhandledInfo
Constants ¶
View Source
const COMTag = 0x60
View Source
const DG11Tag = 0x6B
View Source
const DG12Tag = 0x6C
View Source
const DG13Tag = 0x6D
View Source
const DG14Tag = 0x6E
View Source
const DG15Tag = 0x6F
View Source
const DG16Tag = 0x70
View Source
const DG1Tag = 0x61
View Source
const DG2Tag = 0x75
View Source
const DG7Tag = 0x67
View Source
const SODTag = 0x77
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ActiveAuthenticationInfo ¶
type ActiveAuthenticationInfo struct { Protocol asn1.ObjectIdentifier Version int SignatureAlgorithm asn1.ObjectIdentifier }
type BiometricDataBlock ¶
type BiometricDataBlock struct {
Facial Facial
}
type BiometricHeaderTemplate ¶
type BiometricHeaderTemplate struct { IcaoHeaderVersion []byte // optional BiometricType []byte // optional BiometricSubType []byte // optional (for DG2) CreationDateTime []byte // optional ValidityPeriod []byte // optional PID []byte // optional FormatOwner []byte // required FormatType []byte // required }
type BiometricInfoTemplate ¶
type BiometricInfoTemplate struct { BHT BiometricHeaderTemplate BDB BiometricDataBlock }
type CardAccess ¶
type CardAccess struct { RawData []byte SecurityInfos *SecurityInfos }
func NewCardAccess ¶
func NewCardAccess(data []byte) (*CardAccess, error)
type CardSecurity ¶
type CardSecurity struct { RawData []byte SD *cms.SignedData SecurityInfos *SecurityInfos }
func NewCardSecurity ¶
func NewCardSecurity(data []byte) (out *CardSecurity, err error)
type ChipAuthStatus ¶
type ChipAuthStatus int
const ( CHIP_AUTH_STATUS_NONE ChipAuthStatus = iota CHIP_AUTH_STATUS_PACE_CAM CHIP_AUTH_STATUS_CA CHIP_AUTH_STATUS_AA )
func (ChipAuthStatus) String ¶
func (cas ChipAuthStatus) String() string
type ChipAuthenticationInfo ¶
type ChipAuthenticationInfo struct { Protocol asn1.ObjectIdentifier Version int KeyId *big.Int `asn1:"optional"` }
type ChipAuthenticationPublicKeyInfo ¶
type ChipAuthenticationPublicKeyInfo struct { Raw asn1.RawContent Protocol asn1.ObjectIdentifier ChipAuthenticationPublicKey cms.SubjectPublicKeyInfo KeyId *big.Int `asn1:"optional"` // nil if not present }
type DG11 ¶
type DG11 struct { RawData []byte Details PersonDetails }
type DG12 ¶
type DG12 struct { RawData []byte Details DocumentDetails }
type DG14 ¶
type DG14 struct { RawData []byte // TODO - add to test cases (for all other DGs also) SecInfos *SecurityInfos }
type DG2 ¶
type DG2 struct { RawData []byte BITs []BiometricInfoTemplate }
type DataGroupHash ¶
type Document ¶
type Document struct { Atr []byte Ats []byte Mf MasterFile ChipAuthStatus ChipAuthStatus // passive auth PassiveAuthSOD *PassiveAuth PassiveAuthCardSec *PassiveAuth Apdus []iso7816.ApduLog // TODO - should move this out of document }
func (*Document) IndentedJson ¶
func (Document) LdsVersion ¶
gets the LDS Version (e.g. '0108') from EF.SOD or EF.COM returns empty string if valid cannot be determined
func (Document) UnicodeVersion ¶
gets the Unicode Version (e.g. '040000') from EF.SOD or EF.COM returns empty string if valid cannot be determined
type DocumentDetails ¶
type DocumentDetails struct { IssuingAuthority string DateOfIssue string // YYYYMMDD OtherPersons []mrz.MrzName EndorsementsAndObservations string TaxExitRequirements string ImageFront []byte // Image of front of document. Image per ISO/IEC 10918. ImageRear []byte // Image of read of document. Image per ISO/IEC 10918. PersoDateTime string // yyyymmddhhmmss PersoSystemSerialNumber string }
type EFDIR ¶
type EFDIR struct { RawData []byte Application []EfDirApplication }
type EFDirInfo ¶
type EFDirInfo struct { Protocol asn1.ObjectIdentifier EFDir []byte }
type EfDirApplication ¶
type EfDirApplication struct {
// contains filtered or unexported fields
}
type Facial ¶
type Facial struct { Header FacialHeader Images []Image }
type FacialFeature ¶
type FacialHeader ¶
type FacialInfo ¶
type Image ¶
type Image struct { FacialInformation FacialInfo Features []FacialFeature ImageInformation ImageInfo Data []byte }
type LDS1 ¶
type LDS1 struct { Com *COM // largely deprecated by SOD, but used to determine Lds/Unicode Version if older SOD formatis present Sod *SOD // Document Security Object EF.SOD (MANDATORY) Dg1 *DG1 // DATA GROUP 1 — Machine Readable Zone Information (MANDATORY) Dg2 *DG2 // DATA GROUP 2 — Encoded Identification Features — Face (MANDATORY) Dg7 *DG7 // DATA GROUP 7 — Displayed Signature or Usual Mark (OPTIONAL) Dg11 *DG11 // DATA GROUP 11 — Additional Personal Detail(s) (OPTIONAL) Dg12 *DG12 // DATA GROUP 12 — Additional Document Detail(s) (OPTIONAL) Dg13 *DG13 // DATA GROUP 13 — Optional Details(s) (OPTIONAL) Dg14 *DG14 // DATA GROUP 14 — Security Options (CONDITIONAL) Dg15 *DG15 // DATA GROUP 15 — Active Authentication Public Key Info (CONDITIONAL) Dg16 *DG16 // DATA GROUP 16 — Person(s) to Notify (OPTIONAL) }
type LDSSecurityObject ¶
type LDSSecurityObject struct { Version int HashAlgorithm cms.AlgorithmIdentifier DataGroupHashValues []DataGroupHash LdsVersionInfo LDSVersionInfo `asn1:"optional"` }
type LDSVersionInfo ¶
NB present but empty strings if not present in parsed data (i.e. older version of EF.SOD)
type MasterFile ¶
type MasterFile struct { // TODO - ATR is technically within here? CardAccess *CardAccess CardSecurity *CardSecurity // NB only read for PACE-CAM - read during PACE flow Dir *EFDIR // indicates which applications are present - generally not acvailable Lds1 LDS1 }
type PaceDomainParameterInfo ¶
type PaceDomainParameterInfo struct { Protocol asn1.ObjectIdentifier DomainParameter cms.AlgorithmIdentifier ParameterId *big.Int `asn1:"optional"` // nil if not present }
type PaceInfo ¶
type PaceInfo struct { Protocol asn1.ObjectIdentifier Version int ParameterId *big.Int `asn1:"optional"` // nil if not present }
type PassiveAuth ¶
type PassiveAuth struct {
CertChain [][]byte
}
func NewPassiveAuth ¶
func NewPassiveAuth(certChain [][]byte) *PassiveAuth
type PersonDetails ¶
type PersonDetails struct { NameOfHolder mrz.MrzName OtherNames []mrz.MrzName PersonalNumber string FullDateOfBirth string // YYYYMMDD PlaceOfBirth []string Address []string Telephone string Profession string Title string PersonalSummary string ProofOfCitizenship []byte // image (ISO-10918) OtherTravelDocuments []string CustodyInformation string }
type SOD ¶
type SOD struct { RawData []byte SD *cms.SignedData LdsSecurityObject *LDSSecurityObject }
type SecurityInfoOid ¶
type SecurityInfoOid struct { Raw asn1.RawContent Protocol asn1.ObjectIdentifier `asn1:""` }
type SecurityInfoOidSET ¶
type SecurityInfoOidSET []SecurityInfoOid
type SecurityInfos ¶
type SecurityInfos struct { PaceInfos []PaceInfo PaceDomainParamInfos []PaceDomainParameterInfo ActiveAuthInfos []ActiveAuthenticationInfo ChipAuthInfos []ChipAuthenticationInfo ChipAuthPubKeyInfos []ChipAuthenticationPublicKeyInfo TermAuthInfos []TerminalAuthenticationInfo EfDirInfos []EFDirInfo UnhandledInfos []UnhandledInfo TotalCnt int }
func DecodeSecurityInfos ¶
func DecodeSecurityInfos(secInfoData []byte) (secInfos *SecurityInfos, err error)
TODO - currently fails if anything wrong... maybe we should be more tolerant, but record issues?
type TerminalAuthenticationInfo ¶
type TerminalAuthenticationInfo struct { Protocol asn1.ObjectIdentifier Version int }
type UnhandledInfo ¶
type UnhandledInfo struct { Protocol asn1.ObjectIdentifier RawData []byte }
Click to show internal directories.
Click to hide internal directories.