Skip to content

Commit c8a5523

Browse files
authored
Merge pull request #418 from Yubico/preferredpkp-javadoc
Fix incorrect links in preferredPubKeyParams JavaDoc
2 parents 07e289a + 68a9c4b commit c8a5523

File tree

5 files changed

+124
-5
lines changed

5 files changed

+124
-5
lines changed

NEWS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
New features:
44

5+
* Added JavaDoc to `COSEAlgorithmIdentifier` constants.
56
* (Experimental) Added a new suite of interfaces, starting with
67
`CredentialRepositoryV2`. `RelyingParty` can now be configured with a
78
`CredentialRepositoryV2` instance instead of a `CredentialRepository`

webauthn-server-core/src/main/java/com/yubico/webauthn/RelyingParty.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,13 +210,14 @@ public class RelyingParty {
210210
* <ol>
211211
* <li>{@link com.yubico.webauthn.data.PublicKeyCredentialParameters#ES256 ES256}
212212
* <li>{@link com.yubico.webauthn.data.PublicKeyCredentialParameters#EdDSA EdDSA}
213-
* <li>{@link com.yubico.webauthn.data.PublicKeyCredentialParameters#ES256 ES384}
214-
* <li>{@link com.yubico.webauthn.data.PublicKeyCredentialParameters#ES256 ES512}
213+
* <li>{@link com.yubico.webauthn.data.PublicKeyCredentialParameters#ES384 ES384}
214+
* <li>{@link com.yubico.webauthn.data.PublicKeyCredentialParameters#ES512 ES512}
215215
* <li>{@link com.yubico.webauthn.data.PublicKeyCredentialParameters#RS256 RS256}
216216
* <li>{@link com.yubico.webauthn.data.PublicKeyCredentialParameters#RS384 RS384}
217217
* <li>{@link com.yubico.webauthn.data.PublicKeyCredentialParameters#RS512 RS512}
218218
* </ol>
219219
*
220+
* @since 0.2.0
220221
* @see PublicKeyCredentialCreationOptions#getAttestation()
221222
* @see <a href="https://www.w3.org/TR/2021/REC-webauthn-2-20210408/#sctn-attestation">§6.4.
222223
* Attestation</a>

webauthn-server-core/src/main/java/com/yubico/webauthn/RelyingPartyV2.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -224,8 +224,8 @@ public class RelyingPartyV2<C extends CredentialRecord> {
224224
* <ol>
225225
* <li>{@link PublicKeyCredentialParameters#ES256 ES256}
226226
* <li>{@link PublicKeyCredentialParameters#EdDSA EdDSA}
227-
* <li>{@link PublicKeyCredentialParameters#ES256 ES384}
228-
* <li>{@link PublicKeyCredentialParameters#ES256 ES512}
227+
* <li>{@link PublicKeyCredentialParameters#ES384 ES384}
228+
* <li>{@link PublicKeyCredentialParameters#ES512 ES512}
229229
* <li>{@link PublicKeyCredentialParameters#RS256 RS256}
230230
* <li>{@link PublicKeyCredentialParameters#RS384 RS384}
231231
* <li>{@link PublicKeyCredentialParameters#RS512 RS512}

webauthn-server-core/src/main/java/com/yubico/webauthn/data/COSEAlgorithmIdentifier.java

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,18 +38,109 @@
3838
* registered in the IANA COSE Algorithms registry, for instance, -7 for "ES256" and -257 for
3939
* "RS256".
4040
*
41+
* @since 0.3.0
4142
* @see <a
4243
* href="https://www.w3.org/TR/2021/REC-webauthn-2-20210408/#typedefdef-cosealgorithmidentifier">§5.10.5.
4344
* Cryptographic Algorithm Identifier (typedef COSEAlgorithmIdentifier)</a>
4445
*/
4546
public enum COSEAlgorithmIdentifier {
47+
48+
/**
49+
* The signature scheme Ed25519 as defined in <a href="https://www.rfc-editor.org/rfc/rfc8032">RFC
50+
* 8032</a>.
51+
*
52+
* <p>Note: This COSE identifier does not in general identify the full Ed25519 parameter suite,
53+
* but is specialized to that meaning within the WebAuthn API.
54+
*
55+
* @since 1.4.0
56+
* @see <a href="https://www.iana.org/assignments/cose/cose.xhtml#algorithms">COSE Algorithms
57+
* registry</a>
58+
* @see <a href="https://www.rfc-editor.org/rfc/rfc8032">RFC 8032</a>
59+
* @see <a href="https://www.w3.org/TR/2021/REC-webauthn-2-20210408/#sctn-alg-identifier">WebAuthn
60+
* §5.8.5. Cryptographic Algorithm Identifier (typedef <code>COSEAlgorithmIdentifier</code>
61+
* )</a>
62+
*/
4663
EdDSA(-8),
64+
65+
/**
66+
* ECDSA with SHA-256 on the NIST P-256 curve.
67+
*
68+
* <p>Note: This COSE identifier does not in general restrict the curve to P-256, but is
69+
* specialized to that meaning within the WebAuthn API.
70+
*
71+
* @since 0.3.0
72+
* @see <a href="https://www.iana.org/assignments/cose/cose.xhtml#algorithms">COSE Algorithms
73+
* registry</a>
74+
* @see <a href="https://www.w3.org/TR/2021/REC-webauthn-2-20210408/#sctn-alg-identifier">WebAuthn
75+
* §5.8.5. Cryptographic Algorithm Identifier (typedef <code>COSEAlgorithmIdentifier</code>
76+
* )</a>
77+
*/
4778
ES256(-7),
79+
80+
/**
81+
* ECDSA with SHA-384 on the NIST P-384 curve.
82+
*
83+
* <p>Note: This COSE identifier does not in general restrict the curve to P-384, but is
84+
* specialized to that meaning within the WebAuthn API.
85+
*
86+
* @since 2.1.0
87+
* @see <a href="https://www.iana.org/assignments/cose/cose.xhtml#algorithms">COSE Algorithms
88+
* registry</a>
89+
* @see <a href="https://www.w3.org/TR/2021/REC-webauthn-2-20210408/#sctn-alg-identifier">WebAuthn
90+
* §5.8.5. Cryptographic Algorithm Identifier (typedef <code>COSEAlgorithmIdentifier</code>
91+
* )</a>
92+
*/
4893
ES384(-35),
94+
95+
/**
96+
* ECDSA with SHA-512 on the NIST P-521 curve.
97+
*
98+
* <p>Note: This COSE identifier does not in general restrict the curve to P-521, but is
99+
* specialized to that meaning within the WebAuthn API.
100+
*
101+
* @since 2.1.0
102+
* @see <a href="https://www.iana.org/assignments/cose/cose.xhtml#algorithms">COSE Algorithms
103+
* registry</a>
104+
* @see <a href="https://www.w3.org/TR/2021/REC-webauthn-2-20210408/#sctn-alg-identifier">WebAuthn
105+
* §5.8.5. Cryptographic Algorithm Identifier (typedef <code>COSEAlgorithmIdentifier</code>
106+
* )</a>
107+
*/
49108
ES512(-36),
109+
110+
/**
111+
* RSASSA-PKCS1-v1_5 using SHA-256.
112+
*
113+
* @since 0.3.0
114+
* @see <a href="https://www.iana.org/assignments/cose/cose.xhtml#algorithms">COSE Algorithms
115+
* registry</a>
116+
*/
50117
RS256(-257),
118+
119+
/**
120+
* RSASSA-PKCS1-v1_5 using SHA-384.
121+
*
122+
* @since 2.4.0
123+
* @see <a href="https://www.iana.org/assignments/cose/cose.xhtml#algorithms">COSE Algorithms
124+
* registry</a>
125+
*/
51126
RS384(-258),
127+
128+
/**
129+
* RSASSA-PKCS1-v1_5 using SHA-512.
130+
*
131+
* @since 2.4.0
132+
* @see <a href="https://www.iana.org/assignments/cose/cose.xhtml#algorithms">COSE Algorithms
133+
* registry</a>
134+
*/
52135
RS512(-259),
136+
137+
/**
138+
* RSASSA-PKCS1-v1_5 using SHA-1.
139+
*
140+
* @since 1.5.0
141+
* @see <a href="https://www.iana.org/assignments/cose/cose.xhtml#algorithms">COSE Algorithms
142+
* registry</a>
143+
*/
53144
RS1(-65535);
54145

55146
@JsonValue @Getter private final long id;
@@ -65,6 +156,7 @@ public enum COSEAlgorithmIdentifier {
65156
* COSEAlgorithmIdentifier}
66157
* @return The {@link COSEAlgorithmIdentifier} instance whose {@link #getId() id} equals <code>id
67158
* </code>, if any.
159+
* @since 0.3.0
68160
* @see <a href="https://www.w3.org/TR/2021/REC-webauthn-2-20210408/#sctn-alg-identifier">§5.8.5.
69161
* Cryptographic Algorithm Identifier (typedef COSEAlgorithmIdentifier)</a>
70162
*/
@@ -80,6 +172,7 @@ public static Optional<COSEAlgorithmIdentifier> fromId(long id) {
80172
* COSEAlgorithmIdentifier}, if possible. Returns empty if the {@link COSEAlgorithmIdentifier}
81173
* enum has no constant matching the <code>alg</code> value.
82174
* @throws IllegalArgumentException if <code>publicKeyCose</code> is not a well-formed COSE_Key.
175+
* @since 2.1.0
83176
*/
84177
public static Optional<COSEAlgorithmIdentifier> fromPublicKey(@NonNull ByteArray publicKeyCose) {
85178
final CBORObject ALG = CBORObject.FromObject(3);

webauthn-server-core/src/main/java/com/yubico/webauthn/data/PublicKeyCredentialParameters.java

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
/**
3333
* Used to supply additional parameters when creating a new credential.
3434
*
35+
* @since 0.2.0
3536
* @see <a
3637
* href="https://www.w3.org/TR/2021/REC-webauthn-2-20210408/#dictdef-publickeycredentialparameters">§5.3.
3738
* Parameters for Credential Generation (dictionary PublicKeyCredentialParameters) </a>
@@ -44,10 +45,16 @@ public class PublicKeyCredentialParameters {
4445
* Specifies the cryptographic signature algorithm with which the newly generated credential will
4546
* be used, and thus also the type of asymmetric key pair to be generated, e.g., RSA or Elliptic
4647
* Curve.
48+
*
49+
* @since 0.2.0
4750
*/
4851
@NonNull private final COSEAlgorithmIdentifier alg;
4952

50-
/** Specifies the type of credential to be created. */
53+
/**
54+
* Specifies the type of credential to be created.
55+
*
56+
* @since 0.2.0
57+
*/
5158
@NonNull @Builder.Default
5259
private final PublicKeyCredentialType type = PublicKeyCredentialType.PUBLIC_KEY;
5360

@@ -61,55 +68,71 @@ private PublicKeyCredentialParameters(
6168
/**
6269
* Algorithm {@link COSEAlgorithmIdentifier#EdDSA} and type {@link
6370
* PublicKeyCredentialType#PUBLIC_KEY}.
71+
*
72+
* @since 1.4.0
6473
*/
6574
public static final PublicKeyCredentialParameters EdDSA =
6675
builder().alg(COSEAlgorithmIdentifier.EdDSA).build();
6776

6877
/**
6978
* Algorithm {@link COSEAlgorithmIdentifier#ES256} and type {@link
7079
* PublicKeyCredentialType#PUBLIC_KEY}.
80+
*
81+
* @since 0.3.0
7182
*/
7283
public static final PublicKeyCredentialParameters ES256 =
7384
builder().alg(COSEAlgorithmIdentifier.ES256).build();
7485

7586
/**
7687
* Algorithm {@link COSEAlgorithmIdentifier#ES384} and type {@link
7788
* PublicKeyCredentialType#PUBLIC_KEY}.
89+
*
90+
* @since 2.1.0
7891
*/
7992
public static final PublicKeyCredentialParameters ES384 =
8093
builder().alg(COSEAlgorithmIdentifier.ES384).build();
8194

8295
/**
8396
* Algorithm {@link COSEAlgorithmIdentifier#ES512} and type {@link
8497
* PublicKeyCredentialType#PUBLIC_KEY}.
98+
*
99+
* @since 2.1.0
85100
*/
86101
public static final PublicKeyCredentialParameters ES512 =
87102
builder().alg(COSEAlgorithmIdentifier.ES512).build();
88103

89104
/**
90105
* Algorithm {@link COSEAlgorithmIdentifier#RS1} and type {@link
91106
* PublicKeyCredentialType#PUBLIC_KEY}.
107+
*
108+
* @since 1.5.0
92109
*/
93110
public static final PublicKeyCredentialParameters RS1 =
94111
builder().alg(COSEAlgorithmIdentifier.RS1).build();
95112

96113
/**
97114
* Algorithm {@link COSEAlgorithmIdentifier#RS256} and type {@link
98115
* PublicKeyCredentialType#PUBLIC_KEY}.
116+
*
117+
* @since 0.3.0
99118
*/
100119
public static final PublicKeyCredentialParameters RS256 =
101120
builder().alg(COSEAlgorithmIdentifier.RS256).build();
102121

103122
/**
104123
* Algorithm {@link COSEAlgorithmIdentifier#RS384} and type {@link
105124
* PublicKeyCredentialType#PUBLIC_KEY}.
125+
*
126+
* @since 2.4.0
106127
*/
107128
public static final PublicKeyCredentialParameters RS384 =
108129
builder().alg(COSEAlgorithmIdentifier.RS384).build();
109130

110131
/**
111132
* Algorithm {@link COSEAlgorithmIdentifier#RS512} and type {@link
112133
* PublicKeyCredentialType#PUBLIC_KEY}.
134+
*
135+
* @since 2.4.0
113136
*/
114137
public static final PublicKeyCredentialParameters RS512 =
115138
builder().alg(COSEAlgorithmIdentifier.RS512).build();
@@ -127,6 +150,7 @@ public static class MandatoryStages {
127150
* {@link PublicKeyCredentialParametersBuilder#alg(COSEAlgorithmIdentifier) alg} is a required
128151
* parameter.
129152
*
153+
* @since 0.3.0
130154
* @see PublicKeyCredentialParametersBuilder#alg(COSEAlgorithmIdentifier)
131155
*/
132156
public PublicKeyCredentialParametersBuilder alg(COSEAlgorithmIdentifier alg) {

0 commit comments

Comments
 (0)