24 */ |
24 */ |
25 |
25 |
26 package sun.security.util; |
26 package sun.security.util; |
27 |
27 |
28 import java.security.cert.X509Certificate; |
28 import java.security.cert.X509Certificate; |
|
29 import java.util.Date; |
29 |
30 |
30 /** |
31 /** |
31 * This class is a wrapper for keeping state and passing objects between PKIX, |
32 * This class is a wrapper for keeping state and passing objects between PKIX, |
32 * AlgorithmChecker, and DisabledAlgorithmConstraints. |
33 * AlgorithmChecker, and DisabledAlgorithmConstraints. |
33 */ |
34 */ |
34 public class CertConstraintParameters { |
35 public class CertConstraintParameters { |
35 // A certificate being passed to check against constraints. |
36 // A certificate being passed to check against constraints. |
36 private final X509Certificate cert; |
37 private final X509Certificate cert; |
37 |
|
38 // This is true if the trust anchor in the certificate chain matches a cert |
38 // This is true if the trust anchor in the certificate chain matches a cert |
39 // in AnchorCertificates |
39 // in AnchorCertificates |
40 private final boolean trustedMatch; |
40 private final boolean trustedMatch; |
|
41 // PKIXParameter date |
|
42 private final Date pkixDate; |
41 |
43 |
42 public CertConstraintParameters(X509Certificate c, boolean match) { |
44 public CertConstraintParameters(X509Certificate c, boolean match, |
|
45 Date pkixdate) { |
43 cert = c; |
46 cert = c; |
44 trustedMatch = match; |
47 trustedMatch = match; |
|
48 pkixDate = pkixdate; |
45 } |
49 } |
46 |
50 |
47 public CertConstraintParameters(X509Certificate c) { |
51 public CertConstraintParameters(X509Certificate c) { |
48 this(c, false); |
52 this(c, false, null); |
49 } |
53 } |
50 |
54 |
51 // Returns if the trust anchor has a match if anchor checking is enabled. |
55 // Returns if the trust anchor has a match if anchor checking is enabled. |
52 public boolean isTrustedMatch() { |
56 public boolean isTrustedMatch() { |
53 return trustedMatch; |
57 return trustedMatch; |
54 } |
58 } |
55 |
59 |
56 public X509Certificate getCertificate() { |
60 public X509Certificate getCertificate() { |
57 return cert; |
61 return cert; |
58 } |
62 } |
|
63 |
|
64 public Date getPKIXParamDate() { |
|
65 return pkixDate; |
|
66 } |
|
67 |
59 } |
68 } |