android.net.http
Class CertificateValidatorCache
java.lang.Object
android.net.http.CertificateValidatorCache
class CertificateValidatorCache
- extends Object
Validator cache used to speed-up certificate chain validation. The idea is
to keep each secure domain name associated with a cryptographically secure
hash of the certificate chain successfully used to validate the domain. If
we establish connection with the domain more than once and each time receive
the same list of certificates, we do not have to re-validate.
|
Method Summary |
boolean |
has(String domain,
byte[] secureHash)
|
boolean |
put(String domain,
byte[] secureHash,
long save)
Adds the (domain, secureHash) tuple to the cache |
static byte[] |
secureHash(Certificate[] certificates)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
mSave
public static long mSave
mCost
public static long mCost
CertificateValidatorCache
public CertificateValidatorCache()
- Creates a new certificate-validator cache
secureHash
public static byte[] secureHash(Certificate[] certificates)
- Parameters:
certificate - The array of server certificates to compute a
secure hash from
- Returns:
- The secure hash computed from server certificates
has
public boolean has(String domain,
byte[] secureHash)
- Parameters:
domain - The domain to check againstsecureHash - The secure hash to check against
- Returns:
- True iff there is a valid (not expired) cache entry
associated with the domain and the secure hash
put
public boolean put(String domain,
byte[] secureHash,
long save)
- Adds the (domain, secureHash) tuple to the cache
- Parameters:
domain - The domain to be added to the cachesecureHash - The secure hash to be added to the cache
- Returns:
- True iff succeeds
Please submit a feedback, bug or feature