Java源码示例:com.webauthn4j.validator.attestation.statement.packed.PackedAttestationStatementValidator
示例1
@Test
void constructor_test() {
NoneAttestationStatementValidator noneAttestationStatementValidator = new NoneAttestationStatementValidator();
PackedAttestationStatementValidator packedAttestationStatementValidator = new PackedAttestationStatementValidator();
FIDOU2FAttestationStatementValidator fidoU2FAttestationStatementValidator = new FIDOU2FAttestationStatementValidator();
AndroidKeyAttestationStatementValidator androidKeyAttestationStatementValidator = new AndroidKeyAttestationStatementValidator();
TrustAnchorsResolver trustAnchorsResolver = TestAttestationUtil.createTrustAnchorProviderWith3tierTestRootCACertificate();
WebAuthnRegistrationManager webAuthnRegistrationManager = new WebAuthnRegistrationManager(
Arrays.asList(
noneAttestationStatementValidator,
packedAttestationStatementValidator,
fidoU2FAttestationStatementValidator,
androidKeyAttestationStatementValidator),
new TrustAnchorCertPathTrustworthinessValidator(trustAnchorsResolver),
new DefaultSelfAttestationTrustworthinessValidator()
);
assertThat(webAuthnRegistrationManager).isNotNull();
}
示例2
@Test
void constructor_test() {
NoneAttestationStatementValidator noneAttestationStatementValidator = new NoneAttestationStatementValidator();
PackedAttestationStatementValidator packedAttestationStatementValidator = new PackedAttestationStatementValidator();
FIDOU2FAttestationStatementValidator fidoU2FAttestationStatementValidator = new FIDOU2FAttestationStatementValidator();
AndroidKeyAttestationStatementValidator androidKeyAttestationStatementValidator = new AndroidKeyAttestationStatementValidator();
TrustAnchorsResolver trustAnchorsResolver = TestAttestationUtil.createTrustAnchorProviderWith3tierTestRootCACertificate();
WebAuthnManager webAuthnManager = new WebAuthnManager(
Arrays.asList(
noneAttestationStatementValidator,
packedAttestationStatementValidator,
fidoU2FAttestationStatementValidator,
androidKeyAttestationStatementValidator),
new TrustAnchorCertPathTrustworthinessValidator(trustAnchorsResolver),
new DefaultSelfAttestationTrustworthinessValidator()
);
assertThat(webAuthnManager).isNotNull();
}
示例3
private WebAuthnRegistrationManager createWebAuthnRegistrationManager() {
return new WebAuthnRegistrationManager(
Arrays.asList(
new NoneAttestationStatementValidator(),
new PackedAttestationStatementValidator(),
new TPMAttestationStatementValidator(),
new AndroidKeyAttestationStatementValidator(),
new AndroidSafetyNetAttestationStatementValidator(),
new FIDOU2FAttestationStatementValidator()
), this.certPathtrustValidator,
new DefaultSelfAttestationTrustworthinessValidator(),
Collections.emptyList(), // Custom Registration Validator is not supported
new ObjectConverter()
);
}