Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import org.jspecify.annotations.NullMarked;
import org.jspecify.annotations.Nullable;
import org.openqa.selenium.internal.Require;

/**
Expand All @@ -31,13 +33,14 @@
* @see <a
* href="https://w3c.github.io/webauthn/#credential-parameters">https://w3c.github.io/webauthn/#credential-parameters</a>
*/
@NullMarked
public class Credential {

private final byte[] id;
private final boolean isResidentCredential;
private final String rpId;
private final PKCS8EncodedKeySpec privateKey;
private final byte[] userHandle;
private final byte @Nullable [] userHandle;
private final int signCount;

/** Creates a non resident (i.e. stateless) credential. */
Expand Down Expand Up @@ -75,7 +78,7 @@ private Credential(
boolean isResidentCredential,
String rpId,
PKCS8EncodedKeySpec privateKey,
byte[] userHandle,
byte @Nullable [] userHandle,
int signCount) {
this.id = Require.nonNull("Id", id);
this.isResidentCredential = isResidentCredential;
Expand All @@ -101,7 +104,7 @@ public PKCS8EncodedKeySpec getPrivateKey() {
return privateKey;
}

public byte[] getUserHandle() {
public byte @Nullable [] getUserHandle() {
return userHandle == null ? null : Arrays.copyOf(userHandle, userHandle.length);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@

package org.openqa.selenium.virtualauthenticator;

import org.jspecify.annotations.NullMarked;

/** Interface implemented by each driver that allows access to the virtual authenticator API. */
@NullMarked
public interface HasVirtualAuthenticator {
/**
* Adds a virtual authenticator with the given options.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,10 @@
package org.openqa.selenium.virtualauthenticator;

import java.util.List;
import org.jspecify.annotations.NullMarked;

/** Represents a virtual authenticator. */
@NullMarked
public interface VirtualAuthenticator {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,15 @@
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import org.jspecify.annotations.NullMarked;

/**
* Options for the creation of virtual authenticators.
*
* @see <a
* href="https://w3c.github.io/webauthn/#sctn-automation">https://w3c.github.io/webauthn/#sctn-automation</a>
*/
@NullMarked
public class VirtualAuthenticatorOptions {

public enum Protocol {
Expand Down
Loading