Skip to content

Commit 29446e1

Browse files
committed
Add JavaDoc
1 parent 0361dd7 commit 29446e1

File tree

2 files changed

+42
-0
lines changed

2 files changed

+42
-0
lines changed

src/main/java/org/keepassxc/Connection.java

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -672,6 +672,28 @@ public JSONObject requestAutotype(String url) throws IOException, KeepassProxyAc
672672

673673
}
674674

675+
/**
676+
* Request passkeys-register from the KeePassXC database (KeePassXC 2.8.0 and newer).
677+
* @param publicKey An object containing all required information for the public key.
678+
* @see <a href="https://developer.mozilla.org/en-US/docs/Web/API/Web_Authentication_API">Web Authentication API</a> for publicKey contents.
679+
* @param origin The origin the request originates from in the form {@code https://...}
680+
* @param list A list of pairs of associateID and IDKeyPublicKey stored on association.
681+
* @return An object that contains the result of the operation. In case the Passkey could be registered, the response
682+
* looks like <pre>{@code "response": {
683+
* "authenticatorAttachment": "platform",
684+
* "id": "0iZ6ZoeTM0Kb9MYlH-JnKX8Ui5VrOEd_No42XDh-0D4",
685+
* "response": {
686+
* "attestationObject": "o2Nm...",
687+
* "clientDataJSON": "eyJj..."
688+
* },
689+
* "type": "public-key"
690+
* }}</pre>
691+
* In case the registration failed, the response looks like <pre>{@code "response": {
692+
* "errorCode": 20
693+
* }}</pre>
694+
* @throws IOException The passkeys-register request failed due to technical reasons.
695+
* @throws KeepassProxyAccessException The request could not be processed.
696+
*/
675697
public JSONObject passkeysRegister(JSONObject publicKey, String origin, List<Map<String, String>> list) throws IOException, KeepassProxyAccessException {
676698
var jsonArray = checkKeysList(list);
677699

src/main/java/org/purejava/KeepassProxyAccess.java

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -424,6 +424,26 @@ public boolean requestAutotype(String url) {
424424
}
425425
}
426426

427+
/**
428+
* Request passkeys-register from the KeePassXC database (KeePassXC 2.8.0 and newer).
429+
* @param publicKey An object containing all required information for the public key.
430+
* @see <a href="https://developer.mozilla.org/en-US/docs/Web/API/Web_Authentication_API">Web Authentication API</a> for publicKey contents.
431+
* @param origin The origin the request originates from in the form {@code https://...}
432+
* @param list A list of pairs of associateID and IDKeyPublicKey stored on association.
433+
* @return An object that contains the result of the operation. In case the Passkey could be registered, the response
434+
* looks like <pre>{@code "response": {
435+
* "authenticatorAttachment": "platform",
436+
* "id": "0iZ6ZoeTM0Kb9MYlH-JnKX8Ui5VrOEd_No42XDh-0D4",
437+
* "response": {
438+
* "attestationObject": "o2Nm...",
439+
* "clientDataJSON": "eyJj..."
440+
* },
441+
* "type": "public-key"
442+
* }}</pre>
443+
* In case the registration failed, the response looks like <pre>{@code "response": {
444+
* "errorCode": 20
445+
* }}</pre>
446+
*/
427447
public JSONObject passkeysRegister(JSONObject publicKey, String origin, List<Map<String, String>> list) {
428448
try {
429449
var response = connection.passkeysRegister(publicKey, origin, list);

0 commit comments

Comments
 (0)