getTwoFactorAuthenticationDomain(); } return new PublicKeyCredentialRpEntity( 'LDAP Account Manager', //Name $domain, $icon ); } /** * Returns the user entity for the registration. * * @param $dn DN * @return PublicKeyCredentialUserEntity user entity */ function getUserEntity($dn) { return new PublicKeyCredentialUserEntity( $dn, $dn, extractRDNValue($dn), null ); } /** * Returns the supported credential algorithms. * * @return array algorithms */ function getCredentialParameters() { return array( new PublicKeyCredentialParameters('public-key', Algorithms::COSE_ALGORITHM_ES256), new PublicKeyCredentialParameters('public-key', Algorithms::COSE_ALGORITHM_RS256), ); } /** * Verifies the registration and stores it in the database. * * @param PublicKeyCredentialCreationOptions $registration registration object * @param $clientResponse client response * @return bool true if response is valid and registration succeeded */ function storeNewRegistration($registration, $clientResponse) { $decoder = getCborDecoder(); $tokenBindingHandler = new IgnoreTokenBindingHandler(); $attestationSupportManager = getAttestationSupportManager($decoder); return false; } /** * Returns a CBOR decoder. * * @return Decoder decoder */ function getCborDecoder() { return new Decoder(new TagObjectManager(), new OtherObjectManager()); } /** * Creates the attestation support manager. * * @param Decoder $decoder decoder * @return AttestationStatementSupportManager manager */ function getAttestationSupportManager($decoder) { $manager = new AttestationStatementSupportManager(); $manager->add(new NoneAttestationStatementSupport()); $manager->add(new FidoU2FAttestationStatementSupport()); $manager->add(new AndroidSafetyNetAttestationStatementSupport(new Client() /*TODO*/)); $manager->add(new AndroidKeyAttestationStatementSupport($decoder)); $manager->add(new TPMAttestationStatementSupport()); $coseManager = new Manager(); $coseManager->add(new ES256()); $coseManager->add(new ES384()); $coseManager->add(new ES512()); $coseManager->add(new EdDSA()); $coseManager->add(new RS1()); $coseManager->add(new RS256()); $coseManager->add(new RS384); $coseManager->add(new RS512()); $manager->add(new PackedAttestationStatementSupport($decoder, $coseManager)); return $manager; }