Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- include('File/ASN1.php');
- $IdentityObjectMap = array('type' =>FILE_ASN1_TYPE_SEQUENCE,
- 'children'=> array(
- 'identityIdentificationData' => array('type'=>FILE_ASN1_TYPE_SEQUENCE,
- 'children'=> array(
- 'version' => array('type' => FILE_ASN1_TYPE_IA5_STRING),
- 'staticData' =>array('type' => FILE_ASN1_TYPE_SEQUENCE,
- 'children'=> array(
- 'acceptedPolicyVersion' => array('type' =>FILE_ASN1_TYPE_IA5_STRING),
- 'cardHolderID' => array('type' =>FILE_ASN1_TYPE_INTEGER),
- 'deviceSerialNumber' => array('type' => FILE_ASN1_TYPE_SEQUENCE,
- 'children'=> array(
- 'deviceType' => array('type' =>FILE_ASN1_TYPE_INTEGER),
- 'deviceUniqueID' => array('type' =>FILE_ASN1_TYPE_OCTET_STRING)
- ),
- ),
- 'appLabel' => array('type' =>FILE_ASN1_TYPE_UTF8_STRING),
- 'requestorRole' => array('type' => FILE_ASN1_TYPE_ENUMERATED,
- 'mapping' => array(
- 'roleClient',
- 'roleParticipant'
- )
- ),
- 'creationTime' => array('type' =>FILE_ASN1_TYPE_UTC_TIME)
- )
- )
- )
- )
- )
- );
- $json = "{
- \"identityIdentificationData\":{
- \"version\":\"2.0\",
- \"staticData\":{
- \"acceptedPolicyVersion\":\"2\",
- \"cardHolderID\":11111111111,
- \"deviceSerialNumber\":{
- \"deviceType\":3,
- \"deviceUniqueID\":\"11111111\"
- },
- \"appLabel\":\"examination\",
- \"requestorRole\": \"roleClient\",
- \"creationTime\": \"January 1, 2018\"
- }
- }
- }";
- $IdentityObject = json_decode($json, true);
- $asn1 = new File_ASN1();
- echo $asn1->encodeDER($IdentityObject, $IdentityObjectMap);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement