use of com.webauthn4j.data.attestation.statement.AttestationCertificatePath in project webauthn4j by webauthn4j.
the class PackedAttestationStatementValidatorTest method validate_with_RSAx5c_test.
@Test
void validate_with_RSAx5c_test() throws Exception {
KeyPair keyPair = RSAUtil.createKeyPair();
AuthenticatorData<RegistrationExtensionAuthenticatorOutput> authenticatorData = TestDataUtil.createAuthenticatorData();
byte[] clientData = TestDataUtil.createClientDataJSON(ClientDataType.WEBAUTHN_CREATE);
byte[] signature = generateSignature("SHA256withRSA", keyPair, authenticatorData, clientData);
AttestationCertificatePath x5c = generateCertPath(keyPair, "SHA256withRSA");
PackedAttestationStatement packedAttestationStatement = new PackedAttestationStatement(COSEAlgorithmIdentifier.RS256, signature, x5c);
AttestationObject attestationObject = new AttestationObject(authenticatorData, packedAttestationStatement);
validate(clientData, attestationObject);
}
use of com.webauthn4j.data.attestation.statement.AttestationCertificatePath in project webauthn4j by webauthn4j.
the class FIDOU2FAttestationStatementValidatorTest method validateAttestationStatementNotNull_test.
@Test
void validateAttestationStatementNotNull_test() {
FIDOU2FAttestationStatement attestationStatement = new FIDOU2FAttestationStatement(new AttestationCertificatePath(), new byte[32]);
target.validateAttestationStatementNotNull(attestationStatement);
}
Aggregations