@@ -143,10 +143,42 @@ private TrustRootsResult(
143
143
this .policyTreeValidator = policyTreeValidator ;
144
144
}
145
145
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
+ */
146
157
public Optional <CertStore > getCertStore () {
147
158
return Optional .ofNullable (certStore );
148
159
}
149
160
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
+ */
150
182
public Optional <Predicate <PolicyNode >> getPolicyTreeValidator () {
151
183
return Optional .ofNullable (policyTreeValidator );
152
184
}
@@ -157,6 +189,11 @@ public static TrustRootsResultBuilder.Step1 builder() {
157
189
158
190
public static class TrustRootsResultBuilder {
159
191
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
+ */
160
197
public TrustRootsResultBuilder trustRoots (@ NonNull Set <X509Certificate > trustRoots ) {
161
198
return new TrustRootsResultBuilder ().trustRoots (trustRoots );
162
199
}
0 commit comments