CertStore that retrieves Certificates or
CRLs from a URI, for example, as specified in an X.509
AuthorityInformationAccess or CRLDistributionPoint extension.
For CRLs, this implementation retrieves a single DER encoded CRL per URI. For Certificates, this implementation retrieves a single DER encoded CRL or a collection of Certificates encoded as a PKCS#7 "certs-only" CMS message.
This CertStore also implements Certificate/CRL caching.
Currently, the cache is shared between all applications in the VM and uses a
hardcoded policy. The cache has a maximum size of 185 entries, which are held
by SoftReferences. A request will be satisfied from the cache if we last
checked for an update within CHECK_INTERVAL (last 30 seconds). Otherwise,
we open an URLConnection to download the Certificate(s)/CRL using an
If-Modified-Since request (HTTP) if possible. Note that both positive and
negative responses are cached, i.e. if we are unable to open the connection
or the Certificate(s)/CRL cannot be parsed, we remember this result and
additional calls during the CHECK_INTERVAL period do not try to open another
connection.
The URICertStore is not currently a standard CertStore type. We should consider adding a standard "URI" CertStore type.
| Modifier and Type | Class and Description |
|---|---|
| private static enum | URICertStore.
Enumeration for the allowed schemes we support when following a URI from an authorityInfoAccess extension on a certificate. |
| pack-priv static class | |
| pack-priv static class | |
| private static class | URICertStore.
Stream wrapper used when an InputStream passed into a CertificateFactory needs to be size limited. |
| private static class | URICertStore.
This class allows the URICertStore to be accessed as a CertStore. |
| pack-priv abstract static class | URICertStore.
URIRuleMatcher - abstract base class for the rule sets used for various URI schemes. |
| Modifier and Type | Field and Description |
|---|---|
| private static final boolean | |
| private static Set | |
| private static final int | CACERT_CONNECT_TIMEOUT
Integer value indicating the connect timeout, in milliseconds, to be used for the CA certificate download. |
| private static final int | CACERT_READ_TIMEOUT
Integer value indicating the read timeout, in milliseconds, to be used for the CA certificate download. |
| private static final int | |
| private Collection | |
| private static final Cache | certStoreCache
Returns a URI CertStore. |
| private static final int | |
| private X509CRL | |
| private static final int | CRL_CONNECT_TIMEOUT
Integer value indicating the connect timeout, in milliseconds, to be used for the CRL download. |
| private static final int | CRL_READ_TIMEOUT
Integer value indicating the read timeout, in milliseconds, to be used for the CRL download. |
| private static final Debug | |
| private static final int | |
| private static final int | |
| private static final int | |
| private static final int | |
| private final CertificateFactory | |
| private long | |
| private long | |
| private boolean | |
| private CertStore | |
| private static final long | MAX_CRL_DOWNLOAD_SIZE
Maximum size for a CRL downloaded through a URICertStore in bytes. |
| private final URI |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| private static void | addCaIssUriFilters(String[]
array containing String URI filters aiaUriStrs)Populate the filter collection from the list of AIA CA issuer URIs
found in the |
| public synchronized Collection | Returns: aCollection of X509Certificates that
match the specified selectora selector)CertSelector used to select which
X509Certificates should be returned. Specify
null to return all X509Certificates.Implements abstract java. Returns a |
| public synchronized Collection | Returns: ACollection of X509CRLs that
match the specified selectorA selector)CRLSelector used to select which
X509CRLs should be returned. Specify null
to return all X509CRLs.Implements abstract java. Returns a |
| pack-priv static synchronized CertStore | |
| pack-priv static CertStore | getInstance(AccessDescription ad)
Creates a CertStore from information included in the AccessDescription object of a certificate's Authority Information Access Extension. |
| private static Collection | getMatchingCerts(Collection<X509Certificate> certs, CertSelector selector)
Iterates over the specified Collection of X509Certificates and returns only those that match the criteria specified in the CertSelector. |
| private static Collection | getMatchingCRLs(X509CRL crl, CRLSelector selector)
Checks if the specified X509CRL matches the criteria specified in the CRLSelector. |
| private static int | initializeTimeout(String prop, int def)
Initialize the timeout length by getting the specified CRL timeout system property. |
| CA_ISS_ALLOW_ANY | back to summary |
|---|---|
| private static final boolean CA_ISS_ALLOW_ANY | |
| CA_ISS_URI_FILTERS | back to summary |
|---|---|
| private static Set<URI> CA_ISS_URI_FILTERS | |
| CACERT_CONNECT_TIMEOUT | back to summary |
|---|---|
| private static final int CACERT_CONNECT_TIMEOUT Integer value indicating the connect timeout, in milliseconds, to be used for the CA certificate download. A timeout of zero is interpreted as an infinite timeout. | |
| CACERT_READ_TIMEOUT | back to summary |
|---|---|
| private static final int CACERT_READ_TIMEOUT Integer value indicating the read timeout, in milliseconds, to be used for the CA certificate download. A timeout of zero is interpreted as an infinite timeout. | |
| CACHE_SIZE | back to summary |
|---|---|
| private static final int CACHE_SIZE | |
| certs | back to summary |
|---|---|
| private Collection<X509Certificate> certs | |
| certStoreCache | back to summary |
|---|---|
| private static final Cache<URICertStoreParameters, CertStore> certStoreCache Returns a URI CertStore. This method consults a cache of CertStores (shared per JVM) using the URI as a key. | |
| CHECK_INTERVAL | back to summary |
|---|---|
| private static final int CHECK_INTERVAL | |
| crl | back to summary |
|---|---|
| private X509CRL crl | |
| CRL_CONNECT_TIMEOUT | back to summary |
|---|---|
| private static final int CRL_CONNECT_TIMEOUT Integer value indicating the connect timeout, in milliseconds, to be used for the CRL download. A timeout of zero is interpreted as an infinite timeout. | |
| CRL_READ_TIMEOUT | back to summary |
|---|---|
| private static final int CRL_READ_TIMEOUT Integer value indicating the read timeout, in milliseconds, to be used for the CRL download. A timeout of zero is interpreted as an infinite timeout. | |
| debug | back to summary |
|---|---|
| private static final Debug debug | |
| DEFAULT_CACERT_CONNECT_TIMEOUT | back to summary |
|---|---|
| private static final int DEFAULT_CACERT_CONNECT_TIMEOUT | |
| DEFAULT_CACERT_READ_TIMEOUT | back to summary |
|---|---|
| private static final int DEFAULT_CACERT_READ_TIMEOUT | |
| DEFAULT_CRL_CONNECT_TIMEOUT | back to summary |
|---|---|
| private static final int DEFAULT_CRL_CONNECT_TIMEOUT | |
| DEFAULT_CRL_READ_TIMEOUT | back to summary |
|---|---|
| private static final int DEFAULT_CRL_READ_TIMEOUT | |
| factory | back to summary |
|---|---|
| private final CertificateFactory factory | |
| lastChecked | back to summary |
|---|---|
| private long lastChecked | |
| lastModified | back to summary |
|---|---|
| private long lastModified | |
| ldap | back to summary |
|---|---|
| private boolean ldap | |
| ldapCertStore | back to summary |
|---|---|
| private CertStore ldapCertStore | |
| MAX_CRL_DOWNLOAD_SIZE | back to summary |
|---|---|
| private static final long MAX_CRL_DOWNLOAD_SIZE Maximum size for a CRL downloaded through a URICertStore in bytes. This can be controlled by the com.sun.security.crl.maxSize Security or System property. The System property, if set, overrides the Security property. The default size is 20MiB. | |
| uri | back to summary |
|---|---|
| private final URI uri | |
| URICertStore | back to summary |
|---|---|
| pack-priv URICertStore(CertStoreParameters params) throws InvalidAlgorithmParameterException, NoSuchAlgorithmException Creates a URICertStore.
| |
| addCaIssUriFilters | back to summary |
|---|---|
| private static void addCaIssUriFilters(String[] aiaUriStrs) Populate the filter collection from the list of AIA CA issuer URIs
found in the
| |
| engineGetCertificates | back to summary |
|---|---|
| public synchronized Collection Implements abstract java. Returns a
| |
| engineGetCRLs | back to summary |
|---|---|
| public synchronized Collection Implements abstract java. Returns a
| |
| getInstance | back to summary |
|---|---|
| pack-priv static synchronized CertStore getInstance(URICertStoreParameters params) throws NoSuchAlgorithmException, InvalidAlgorithmParameterException | |
| getInstance | back to summary |
|---|---|
| pack-priv static CertStore getInstance(AccessDescription ad) Creates a CertStore from information included in the AccessDescription object of a certificate's Authority Information Access Extension. | |
| getMatchingCerts | back to summary |
|---|---|
| private static Collection Iterates over the specified Collection of X509Certificates and returns only those that match the criteria specified in the CertSelector. | |
| getMatchingCRLs | back to summary |
|---|---|
| private static Collection Checks if the specified X509CRL matches the criteria specified in the CRLSelector. | |
| initializeTimeout | back to summary |
|---|---|
| private static int initializeTimeout(String prop, int def) Initialize the timeout length by getting the specified CRL timeout system property. If the property has not been set, or if its value is negative, set the timeout length to the specified default. | |
| Modifier and Type | Field and Description |
|---|---|
| public static final URICertStore. | |
| public static final URICertStore. | |
| public static final URICertStore. | |
| public static final URICertStore. | |
| public static final URICertStore. | |
| pack-priv final URICertStore. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv static URICertStore. | |
| public static URICertStore. | |
| public static URICertStore. |
| FTP | back to summary |
|---|---|
| public static final URICertStore. | |
| HTTP | back to summary |
|---|---|
| public static final URICertStore. | |
| HTTPS | back to summary |
|---|---|
| public static final URICertStore. | |
| LDAP | back to summary |
|---|---|
| public static final URICertStore. | |
| LDAPS | back to summary |
|---|---|
| public static final URICertStore. | |
| ruleMatcher | back to summary |
|---|---|
| pack-priv final URICertStore. | |
| AllowedScheme | back to summary |
|---|---|
| private AllowedScheme(URICertStore. | |
| nameOf | back to summary |
|---|---|
| pack-priv static URICertStore. Return an
| |
| valueOf | back to summary |
|---|---|
| public static URICertStore. | |
| values | back to summary |
|---|---|
| public static URICertStore. | |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv static final URICertStore. | |
| pack-priv static final URICertStore. | |
| pack-priv static final URICertStore. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| private static boolean | Returns: true ifcandidate is a child path of base,
false otherwise.the URI that contains the root path base, URI the URI that contains the path being evaluated candidate)Performs a hierarchical containment check, ensuring that the base URI's path is a root component of the candidate path. |
| pack-priv boolean | matchRule(URI filterRule, URI caIssuer)
Implements abstract sun. Attempt to match an AIA URI against a specific filter rule. |
| FTP | back to summary |
|---|---|
| pack-priv static final URICertStore. | |
| HTTP | back to summary |
|---|---|
| pack-priv static final URICertStore. | |
| HTTPS | back to summary |
|---|---|
| pack-priv static final URICertStore. | |
| HttpFtpRuleMatcher | back to summary |
|---|---|
| private HttpFtpRuleMatcher(int port) | |
| isRootOf | back to summary |
|---|---|
| private static boolean isRootOf(URI base, URI candidate) Performs a hierarchical containment check, ensuring that the base URI's path is a root component of the candidate path. The path comparison is case-sensitive. If the base path ends in a slash (/) then all candidate paths that begin with the base path are allowed. If it does not end in a slash, then it is assumed that the leaf node in the base path is a file component and both paths must match exactly. | |
| matchRule | back to summary |
|---|---|
| pack-priv boolean matchRule(URI filterRule, URI caIssuer) Implements abstract sun. Doc from sun. Attempt to match an AIA URI against a specific filter rule. The specific rules to apply are implementation dependent.
| |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv static final URICertStore. | |
| pack-priv static final URICertStore. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv boolean | matchRule(URI filterRule, URI caIssuer)
Implements abstract sun. Attempt to match an AIA URI against a specific filter rule. |
| LDAP | back to summary |
|---|---|
| pack-priv static final URICertStore. | |
| LDAPS | back to summary |
|---|---|
| pack-priv static final URICertStore. | |
| LdapRuleMatcher | back to summary |
|---|---|
| private LdapRuleMatcher(int port) | |
| matchRule | back to summary |
|---|---|
| pack-priv boolean matchRule(URI filterRule, URI caIssuer) Implements abstract sun. Doc from sun. Attempt to match an AIA URI against a specific filter rule. The specific rules to apply are implementation dependent.
| |
| Modifier and Type | Field and Description |
|---|---|
| private long | |
| private final long |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public int | |
| public int | read(byte[] b, int off, int len)
Overrides java. Reads up to |
| bytesRead | back to summary |
|---|---|
| private long bytesRead | |
| maxBytes | back to summary |
|---|---|
| private final long maxBytes | |
| SizeLimitedInputStream | back to summary |
|---|---|
| private SizeLimitedInputStream(InputStream in, long maxBytes) | |
| read | back to summary |
|---|---|
| public int read() throws IOException Overrides java. Doc from java. Reads the next byte of data from the input stream. The value byte is
returned as an
| |
| read | back to summary |
|---|---|
| public int read(byte[] b, int off, int len) throws IOException Overrides java. Doc from java. Reads up to
| |
| Access | Constructor and Description |
|---|---|
| protected |
| UCS | back to summary |
|---|---|
| protected UCS(CertStoreSpi spi, Provider p, String type, CertStoreParameters params) | |
| Modifier and Type | Field and Description |
|---|---|
| protected final int |
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv abstract boolean | |
| pack-priv boolean | Returns: true if the scheme, host and port numbers match, false if any of the components do not match. If a port number is omitted in either the filter rule or AIA URI, the well-known port for that scheme is used in the comparison.the filter rule to match against filterRule, URI the AIA URI being compared caIssuer)Attempt to match the scheme, host and port between a filter rule URI and a URI coming from an AIA extension. |
| wellKnownPort | back to summary |
|---|---|
| protected final int wellKnownPort | |
| URIRuleMatcher | back to summary |
|---|---|
| protected URIRuleMatcher(int port) | |
| matchRule | back to summary |
|---|---|
| pack-priv abstract boolean matchRule(URI filterRule, URI caIssuer) Attempt to match an AIA URI against a specific filter rule. The specific rules to apply are implementation dependent. | |
| schemeHostPortCheck | back to summary |
|---|---|
| pack-priv boolean schemeHostPortCheck(URI filterRule, URI caIssuer) Attempt to match the scheme, host and port between a filter rule URI and a URI coming from an AIA extension.
| |