Skip to content

TypeScript implementation of ICAO 9303 passport standard

License

Notifications You must be signed in to change notification settings

danzipie/mrtd-ts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mrtd-ts

Installation

yarn
yarn test

Usage

Parse the EF.SOD element.

const pem = "MIIHhgYJKoZIhv ... 2lQaWKGlcudYPw==";
const contentInfo = AsnConvert.parse(Convert.FromBase64(pem), ContentInfo);
const signedData = AsnConvert.parse(contentInfo.content, SignedData);
const securityObject = AsnConvert.parse(signedData.encapContentInfo.eContent.single, LDSSecurityObject);

console.log(securityObject);

Output

LDSSecurityObject {
  version: 0,
  hashAlgorithm: DigestAlgorithmIdentifier {
    algorithm: '2.16.840.1.101.3.4.2.1',
    parameters: null
  },
  dataGroupHashValues: [
    DataGroupHash {
      dataGroupNumber: 1,
      dataGroupHashValue: [Uint8Array]
    },
    DataGroupHash {
      dataGroupNumber: 2,
      dataGroupHashValue: [Uint8Array]
    },
    DataGroupHash {
      dataGroupNumber: 3,
      dataGroupHashValue: [Uint8Array]
    },
    DataGroupHash {
      dataGroupNumber: 14,
      dataGroupHashValue: [Uint8Array]
    },
    DataGroupHash {
      dataGroupNumber: 4,
      dataGroupHashValue: [Uint8Array]
    }
  ]
}

About

TypeScript implementation of ICAO 9303 passport standard

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published