Server IP : 51.89.169.208 / Your IP : 18.117.180.237 Web Server : Apache System : Linux ns3209505.ip-198-244-202.eu 4.18.0-553.27.1.el8_10.x86_64 #1 SMP Tue Nov 5 04:50:16 EST 2024 x86_64 User : yellowleaf ( 1019) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /home/yellowleaf/www/phpMyAdmin/vendor/web-auth/webauthn-lib/src/ |
Upload File : |
<?php namespace Webauthn; use CBOR\ByteStringObject; use CBOR\MapItem; use CBOR\MapObject; use CBOR\NegativeIntegerObject; use CBOR\UnsignedIntegerObject; class U2FPublicKey { public static function isU2FKey($publicKey): bool { return $publicKey[0] === "\x04"; } public static function createCOSEKey($publicKey): string { $mapObject = new MapObject([ 1 => MapItem::create( new UnsignedIntegerObject(1, null), new UnsignedIntegerObject(2, null) ), 3 => MapItem::create( new UnsignedIntegerObject(3, null), new NegativeIntegerObject(6, null) ), -1 => MapItem::create( new NegativeIntegerObject(0, null), new UnsignedIntegerObject(1, null) ), -2 => MapItem::create( new NegativeIntegerObject(1, null), new ByteStringObject(substr($publicKey, 1, 32)) ), -3 => MapItem::create( new NegativeIntegerObject(2, null), new ByteStringObject(substr($publicKey, 33)) ), ]); return $mapObject->__toString(); } }