Build 1.0_r1(from source)

android.net.http
Class CertificateValidatorCache

java.lang.Object
  extended by 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.


Field Summary
static long mCost
           
static long mSave
           
 
Constructor Summary
CertificateValidatorCache()
          Creates a new certificate-validator cache
 
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
 

Field Detail

mSave

public static long mSave

mCost

public static long mCost
Constructor Detail

CertificateValidatorCache

public CertificateValidatorCache()
Creates a new certificate-validator cache

Method Detail

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 against
secureHash - 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 cache
secureHash - The secure hash to be added to the cache
Returns:
True iff succeeds

Build 1.0_r1(from source)

Please submit a feedback, bug or feature