Search in sources :

Example 1 with KeyStoreTrustAnchorsProvider

use of com.webauthn4j.anchor.KeyStoreTrustAnchorsProvider in project keycloak by keycloak.

the class WebAuthnRegisterFactory method create.

@Override
public RequiredActionProvider create(KeycloakSession session) {
    WebAuthnRegister webAuthnRegister = null;
    TruststoreProvider truststoreProvider = session.getProvider(TruststoreProvider.class);
    if (truststoreProvider == null || truststoreProvider.getTruststore() == null) {
        webAuthnRegister = createProvider(session, new NullCertPathTrustworthinessValidator());
    } else {
        KeyStoreTrustAnchorsProvider trustAnchorsProvider = new KeyStoreTrustAnchorsProvider();
        trustAnchorsProvider.setKeyStore(truststoreProvider.getTruststore());
        TrustAnchorsResolverImpl resolverImpl = new TrustAnchorsResolverImpl(trustAnchorsProvider);
        TrustAnchorCertPathTrustworthinessValidator trustValidator = new TrustAnchorCertPathTrustworthinessValidator(resolverImpl);
        webAuthnRegister = createProvider(session, trustValidator);
    }
    return webAuthnRegister;
}
Also used : NullCertPathTrustworthinessValidator(com.webauthn4j.validator.attestation.trustworthiness.certpath.NullCertPathTrustworthinessValidator) TrustAnchorCertPathTrustworthinessValidator(com.webauthn4j.validator.attestation.trustworthiness.certpath.TrustAnchorCertPathTrustworthinessValidator) TrustAnchorsResolverImpl(com.webauthn4j.anchor.TrustAnchorsResolverImpl) TruststoreProvider(org.keycloak.truststore.TruststoreProvider) KeyStoreTrustAnchorsProvider(com.webauthn4j.anchor.KeyStoreTrustAnchorsProvider)

Aggregations

KeyStoreTrustAnchorsProvider (com.webauthn4j.anchor.KeyStoreTrustAnchorsProvider)1 TrustAnchorsResolverImpl (com.webauthn4j.anchor.TrustAnchorsResolverImpl)1 NullCertPathTrustworthinessValidator (com.webauthn4j.validator.attestation.trustworthiness.certpath.NullCertPathTrustworthinessValidator)1 TrustAnchorCertPathTrustworthinessValidator (com.webauthn4j.validator.attestation.trustworthiness.certpath.TrustAnchorCertPathTrustworthinessValidator)1 TruststoreProvider (org.keycloak.truststore.TruststoreProvider)1