Skip to content

Commit 2f00c8e

Browse files
committed
Copy JavaDoc to predefined methods in TrustRootsResult
1 parent 15ff965 commit 2f00c8e

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

webauthn-server-core/src/main/java/com/yubico/webauthn/attestation/AttestationTrustSource.java

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,10 +143,42 @@ private TrustRootsResult(
143143
this.policyTreeValidator = policyTreeValidator;
144144
}
145145

146+
/**
147+
* A {@link CertStore} of additional CRLs and/or intermediate certificates to use during
148+
* certificate path validation, if any. This will not be used if {@link
149+
* TrustRootsResultBuilder#trustRoots(Set) trustRoots} is empty.
150+
*
151+
* <p>Any certificates included in this {@link CertStore} are NOT considered trusted; they will
152+
* be trusted only if they chain to any of the {@link TrustRootsResultBuilder#trustRoots(Set)
153+
* trustRoots}.
154+
*
155+
* <p>The default is <code>null</code>.
156+
*/
146157
public Optional<CertStore> getCertStore() {
147158
return Optional.ofNullable(certStore);
148159
}
149160

161+
/**
162+
* If non-null, the PolicyQualifiersRejected flag will be set to false during certificate path
163+
* validation. See {@link
164+
* java.security.cert.PKIXParameters#setPolicyQualifiersRejected(boolean)}.
165+
*
166+
* <p>The given {@link Predicate} will be used to validate the policy tree. The {@link
167+
* Predicate} should return <code>true</code> if the policy tree is acceptable, and <code>false
168+
* </code> otherwise.
169+
*
170+
* <p>Depending on your <code>"PKIX"</code> JCA provider configuration, this may be required if
171+
* any certificate in the certificate path contains a certificate policies extension marked
172+
* critical. If this is not set, then such a certificate will be rejected by the certificate
173+
* path validator from the default provider.
174+
*
175+
* <p>Consult the <a
176+
* href="https://docs.oracle.com/en/java/javase/17/security/java-pki-programmers-guide.html#GUID-3AD41382-E729-469B-83EE-CB2FE66D71D8">Java
177+
* PKI Programmer's Guide</a> for how to use the {@link PolicyNode} argument of the {@link
178+
* Predicate}.
179+
*
180+
* <p>The default is <code>null</code>.
181+
*/
150182
public Optional<Predicate<PolicyNode>> getPolicyTreeValidator() {
151183
return Optional.ofNullable(policyTreeValidator);
152184
}
@@ -157,6 +189,11 @@ public static TrustRootsResultBuilder.Step1 builder() {
157189

158190
public static class TrustRootsResultBuilder {
159191
public static class Step1 {
192+
/**
193+
* A set of attestation root certificates trusted to certify the relevant attestation
194+
* statement. If the attestation statement is not trusted, or if no trust roots were found,
195+
* this should be an empty set.
196+
*/
160197
public TrustRootsResultBuilder trustRoots(@NonNull Set<X509Certificate> trustRoots) {
161198
return new TrustRootsResultBuilder().trustRoots(trustRoots);
162199
}

0 commit comments

Comments
 (0)