Sign the request'; } $id = getHttpVal('id', 0); if ($id < 1) { echo 'Client id is missing!'; exit; } $otp = getHttpVal('otp', ''); $t = getHttpVal('t', ''); $apiKey = base64_decode($apiKey64); $a['id'] = $id; $a['otp'] = $otp; if ($t != '') { $a['t'] = $t; } $hmac = sign($a, $apiKey, true); // echo 'Test submit the request >> '; } else if ($act == 'sign_resp') { if ($apiKey64 == '') { echo 'API key cannot be empty!'; exit; } else { echo '

Sign the response

'; } $status = getHttpVal('status', ''); $t = getHttpVal('t', ''); $info = getHttpVal('info', ''); $apiKey = base64_decode($apiKey64); $a['status'] = $status; $a['t'] = $t; if ($info != '') { $a['info'] = $info; } $hmac = sign($a, $apiKey, true); } echo '
'; echo '

Generate a request signature

'. '
' . '' . 'api key: (use your api key issued to you by Yubico in b64 format): ' . '

' . 'id (your client id):

' . 'otp:

' . '' . '

'. '

Generate a response signature

'. '
' . '' . 'api key: (put your api key here in b64 format): ' . '

' . 'Status:

'. 'Time stamp:

' . 'info:

' . '' . '

'. '
'; ?>