/** * Returns the Certificate object corresponding to the provided encoding. * Resulting object is retrieved from the cache * if it contains such correspondence * and is constructed on the base of encoding * and stored in the cache otherwise. * @throws IOException if some decoding errors occur * (in the case of cache miss). */ private static Certificate getCertificate(byte[] encoding) throws CertificateException, IOException { if (encoding.length < CERT_CACHE_SEED_LENGTH) { throw new CertificateException("encoding.length < CERT_CACHE_SEED_LENGTH"); } synchronized (CERT_CACHE) { long hash = CERT_CACHE.getHash(encoding); if (CERT_CACHE.contains(hash)) { Certificate res = (Certificate) CERT_CACHE.get(hash, encoding); if (res != null) { return res; } } Certificate res = new X509CertImpl(encoding); CERT_CACHE.put(hash, encoding, res); return res; } }
hash |= getSuffHash(encoding); if (hash == 0) { return null;
/** * Returns the CRL object corresponding to the provided encoding. * Resulting object is retrieved from the cache * if it contains such correspondence * and is constructed on the base of encoding * and stored in the cache otherwise. * @throws IOException if some decoding errors occur * (in the case of cache miss). */ private static CRL getCRL(byte[] encoding) throws CRLException, IOException { if (encoding.length < CRL_CACHE_SEED_LENGTH) { throw new CRLException("encoding.length < CRL_CACHE_SEED_LENGTH"); } synchronized (CRL_CACHE) { long hash = CRL_CACHE.getHash(encoding); if (CRL_CACHE.contains(hash)) { X509CRL res = (X509CRL) CRL_CACHE.get(hash, encoding); if (res != null) { return res; } } X509CRL res = new X509CRLImpl(encoding); CRL_CACHE.put(hash, encoding, res); return res; } }
hash |= getSuffHash(encoding);
throw new CertificateException("InputStream doesn't contain enough data"); long hash = CERT_CACHE.getHash(buff); if (CERT_CACHE.contains(hash)) { byte[] encoding = new byte[BerInputStream.getLength(buff)]; if (encoding.length < CERT_CACHE_SEED_LENGTH) { Certificate res = (Certificate) CERT_CACHE.get(hash, encoding); if (res != null) { return res; CERT_CACHE.put(hash, encoding, res); return res; } else { inStream.reset(); Certificate res = new X509CertImpl(inStream); CERT_CACHE.put(hash, res.getEncoded(), res); return res;
hash |= getSuffHash(encoding); if (hash == 0) { return null;
throw new CRLException("InputStream doesn't contain enough data"); long hash = CRL_CACHE.getHash(buff); if (CRL_CACHE.contains(hash)) { byte[] encoding = new byte[BerInputStream.getLength(buff)]; if (encoding.length < CRL_CACHE_SEED_LENGTH) { CRL res = (CRL) CRL_CACHE.get(hash, encoding); if (res != null) { return res; CRL_CACHE.put(hash, encoding, res); return res; } else { X509CRL res = new X509CRLImpl(inStream); CRL_CACHE.put(hash, res.getEncoded(), res); return res;
hash |= getSuffHash(encoding); if (hash == 0) { return null;
/** * Returns the Certificate object corresponding to the provided encoding. * Resulting object is retrieved from the cache * if it contains such correspondence * and is constructed on the base of encoding * and stored in the cache otherwise. * @throws IOException if some decoding errors occur * (in the case of cache miss). */ private static Certificate getCertificate(byte[] encoding) throws CertificateException, IOException { if (encoding.length < CERT_CACHE_SEED_LENGTH) { throw new CertificateException("encoding.length < CERT_CACHE_SEED_LENGTH"); } synchronized (CERT_CACHE) { long hash = CERT_CACHE.getHash(encoding); if (CERT_CACHE.contains(hash)) { Certificate res = (Certificate) CERT_CACHE.get(hash, encoding); if (res != null) { return res; } } Certificate res = new X509CertImpl(encoding); CERT_CACHE.put(hash, encoding, res); return res; } }
hash |= getSuffHash(encoding); if (hash == 0) { return null;
/** * Returns the Certificate object corresponding to the provided encoding. * Resulting object is retrieved from the cache * if it contains such correspondence * and is constructed on the base of encoding * and stored in the cache otherwise. * @throws IOException if some decoding errors occur * (in the case of cache miss). */ private static Certificate getCertificate(byte[] encoding) throws CertificateException, IOException { if (encoding.length < CERT_CACHE_SEED_LENGTH) { throw new CertificateException("encoding.length < CERT_CACHE_SEED_LENGTH"); } synchronized (CERT_CACHE) { long hash = CERT_CACHE.getHash(encoding); if (CERT_CACHE.contains(hash)) { Certificate res = (Certificate) CERT_CACHE.get(hash, encoding); if (res != null) { return res; } } Certificate res = new X509CertImpl(encoding); CERT_CACHE.put(hash, encoding, res); return res; } }
hash |= getSuffHash(encoding); if (hash == 0) { return null;
/** * Returns the Certificate object corresponding to the provided encoding. * Resulting object is retrieved from the cache * if it contains such correspondence * and is constructed on the base of encoding * and stored in the cache otherwise. * @throws IOException if some decoding errors occur * (in the case of cache miss). */ private static Certificate getCertificate(byte[] encoding) throws CertificateException, IOException { if (encoding.length < CERT_CACHE_SEED_LENGTH) { throw new CertificateException("encoding.length < CERT_CACHE_SEED_LENGTH"); } synchronized (CERT_CACHE) { long hash = CERT_CACHE.getHash(encoding); if (CERT_CACHE.contains(hash)) { Certificate res = (Certificate) CERT_CACHE.get(hash, encoding); if (res != null) { return res; } } Certificate res = new X509CertImpl(encoding); CERT_CACHE.put(hash, encoding, res); return res; } }
hash |= getSuffHash(encoding); if (hash == 0) { return null;
/** * Returns the Certificate object corresponding to the provided encoding. * Resulting object is retrieved from the cache * if it contains such correspondence * and is constructed on the base of encoding * and stored in the cache otherwise. * @throws IOException if some decoding errors occur * (in the case of cache miss). */ private static Certificate getCertificate(byte[] encoding) throws CertificateException, IOException { if (encoding.length < CERT_CACHE_SEED_LENGTH) { throw new CertificateException("encoding.length < CERT_CACHE_SEED_LENGTH"); } synchronized (CERT_CACHE) { long hash = CERT_CACHE.getHash(encoding); if (CERT_CACHE.contains(hash)) { Certificate res = (Certificate) CERT_CACHE.get(hash, encoding); if (res != null) { return res; } } Certificate res = new X509CertImpl(encoding); CERT_CACHE.put(hash, encoding, res); return res; } }
hash |= getSuffHash(encoding); if (hash == 0) { return null;
/** * Returns the Certificate object corresponding to the provided encoding. * Resulting object is retrieved from the cache * if it contains such correspondence * and is constructed on the base of encoding * and stored in the cache otherwise. * @throws IOException if some decoding errors occur * (in the case of cache miss). */ private static Certificate getCertificate(byte[] encoding) throws CertificateException, IOException { if (encoding.length < CERT_CACHE_SEED_LENGTH) { throw new CertificateException("encoding.length < CERT_CACHE_SEED_LENGTH"); } synchronized (CERT_CACHE) { long hash = CERT_CACHE.getHash(encoding); if (CERT_CACHE.contains(hash)) { Certificate res = (Certificate) CERT_CACHE.get(hash, encoding); if (res != null) { return res; } } Certificate res = new X509CertImpl(encoding); CERT_CACHE.put(hash, encoding, res); return res; } }
hash |= getSuffHash(encoding);
/** * Returns the Certificate object corresponding to the provided encoding. * Resulting object is retrieved from the cache * if it contains such correspondence * and is constructed on the base of encoding * and stored in the cache otherwise. * @throws IOException if some decoding errors occur * (in the case of cache miss). */ private static Certificate getCertificate(byte[] encoding) throws CertificateException, IOException { if (encoding.length < CERT_CACHE_SEED_LENGTH) { throw new CertificateException("encoding.length < CERT_CACHE_SEED_LENGTH"); } synchronized (CERT_CACHE) { long hash = CERT_CACHE.getHash(encoding); if (CERT_CACHE.contains(hash)) { Certificate res = (Certificate) CERT_CACHE.get(hash, encoding); if (res != null) { return res; } } Certificate res = new X509CertImpl(encoding); CERT_CACHE.put(hash, encoding, res); return res; } }
hash |= getSuffHash(encoding);