亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? pkixcertpathbuilderspi.java

?? 內(nèi)容:基于jdk1.4的加密算法的具體實(shí)現(xiàn)
?? JAVA
字號(hào):
package org.bouncycastle.jce.provider;import java.io.IOException;import java.security.InvalidAlgorithmParameterException;import java.security.PublicKey;import java.security.cert.*;import java.util.ArrayList;import java.util.Collection;import java.util.HashSet;import java.util.Iterator;import java.util.List;import java.util.Set;import javax.security.auth.x500.X500Principal;/** * Implements the PKIX CertPathBuilding algorithem for BouncyCastle. * <br /> * <b>MAYBE: implement more CertPath validation whil build path to omit invalid pathes</b> * * @see CertPathBuilderSpi **/public class PKIXCertPathBuilderSpi    extends CertPathBuilderSpi{    /**     * Build and validate a CertPath using the given parameter.     *     * @param params PKIXBuilderParameters object containing all     * information to build the CertPath     **/    public CertPathBuilderResult engineBuild(        CertPathParameters params)        throws CertPathBuilderException, InvalidAlgorithmParameterException     {        if (!(params instanceof PKIXBuilderParameters))        {            throw new InvalidAlgorithmParameterException("params must be a PKIXBuilderParameters instance");        }        PKIXBuilderParameters pkixParams = (PKIXBuilderParameters)params;        Collection targets;        Iterator targetIter;        List certPathList = new ArrayList();        X509Certificate cert;        Collection      certs;        CertPath        certPath = null;        Exception       certPathException = null;        // search target certificates        CertSelector certSelect = pkixParams.getTargetCertConstraints();        if (certSelect == null)        {            throw new CertPathBuilderException("targetCertConstraints must be non-null for CertPath building");        }        try        {            targets = findCertificates(certSelect, pkixParams.getCertStores());        }        catch (CertStoreException e)        {            throw new CertPathBuilderException(e);        }        if (targets.isEmpty())        {            throw new CertPathBuilderException("no certificate found matching targetCertContraints");        }        CertificateFactory  cFact;        CertPathValidator   validator;        try        {            cFact = CertificateFactory.getInstance("X.509", "BC");            validator = CertPathValidator.getInstance("PKIX", "BC");        }        catch (Exception e)        {            throw new CertPathBuilderException("exception creating support classes: " + e);        }        //        // check all potential target certificates        targetIter = targets.iterator();        while (targetIter.hasNext())        {            cert = (X509Certificate)targetIter.next();            certPathList.clear();            while (cert != null)            {                // add cert to the certpath                certPathList.add(cert);                // check wether the issuer of <cert> is a TrustAnchor                 if (findTrustAnchor(cert, pkixParams.getTrustAnchors()) != null)                {                    try                    {                        certPath = cFact.generateCertPath(certPathList);                        PKIXCertPathValidatorResult result = (PKIXCertPathValidatorResult)validator.validate(certPath, pkixParams);                        return new PKIXCertPathBuilderResult(certPath,                                     result.getTrustAnchor(),                                     result.getPolicyTree(),                                     result.getPublicKey());                    }                    catch (CertificateException ex)                    {                        certPathException = ex;                    }                    catch (CertPathValidatorException ex)                    {                        certPathException = ex;                    }                    // if validation failed go to next certificate                    cert = null;                }                else                {                    // try to get the issuer certificate from one                    // of the CertStores                    try                    {                        X509Certificate issuer = findIssuer(cert, pkixParams.getCertStores());                        if (issuer.equals(cert))                        {                            cert = null;                        }                        else                        {                            cert = issuer;                        }                    }                    catch (CertPathValidatorException ex)                    {                        certPathException = ex;                        cert = null;                    }                }            }        }        if (certPath != null)        {            throw new CertPathBuilderException("found certificate chain, but could not be validated", certPathException);        }        throw new CertPathBuilderException("unable to find certificate chain");    }    /**     * Search the given Set of TrustAnchor's for one that is the     * issuer of the fiven X509 certificate.     *     * @param cert the X509 certificate     * @param trustAnchors a Set of TrustAnchor's     *     * @return the <code>TrustAnchor</code> object if found or     * <code>null</code> if not.     *     * @exception CertPathValidatorException if a TrustAnchor  was     * found but the signature verificytion on the given certificate     * has thrown an exception. This Exception can be obtainted with     * <code>getCause()</code> method.     **/    final TrustAnchor findTrustAnchor(        X509Certificate cert,        Set             trustAnchors)         throws CertPathBuilderException    {        Iterator iter = trustAnchors.iterator();        TrustAnchor trust = null;        PublicKey trustPublicKey = null;        Exception invalidKeyEx = null;        X509CertSelector certSelectX509 = new X509CertSelector();        try        {            certSelectX509.setSubject(cert.getIssuerX500Principal().getEncoded());        }        catch (IOException ex)        {            throw new CertPathBuilderException("can't get trust anchor principal",null);        }        while (iter.hasNext() && trust == null)        {            trust = (TrustAnchor)iter.next();            if (trust.getTrustedCert() != null)            {                if (certSelectX509.match(trust.getTrustedCert()))                {                    trustPublicKey = trust.getTrustedCert().getPublicKey();                }                else                {                    trust = null;                }            }            else if (trust.getCAName() != null                        && trust.getCAPublicKey() != null)            {                try                {                    X500Principal certIssuer = cert.getIssuerX500Principal();                    X500Principal caName = new X500Principal(trust.getCAName());                    if (certIssuer.equals(caName))                    {                        trustPublicKey = trust.getCAPublicKey();                    }                    else                    {                        trust = null;                    }                }                catch (IllegalArgumentException ex)                {                    trust = null;                }            }            else            {                trust = null;            }                        if (trustPublicKey != null)            {                try                {                    cert.verify(trustPublicKey);                }                catch (Exception ex)                {                    invalidKeyEx = ex;                    trust = null;                }            }        }            if (trust == null && invalidKeyEx != null)        {            throw new CertPathBuilderException("TrustAnchor found put certificate validation failed",invalidKeyEx);        }        return trust;    }    /**     * Return a Collection of all certificates found in the     * CertStore's that are matching the certSelect criteriums.     *     * @param certSelector a {@link CertSelector CertSelector}     * object that will be used to select the certificates     * @param certStores a List containing only {@link CertStore     * CertStore} objects. These are used to search for     * certificates     *     * @return a Collection of all found {@link Certificate Certificate}     * objects. May be empty but never <code>null</code>.     **/    private final Collection findCertificates(        CertSelector    certSelect,        List            certStores)         throws CertStoreException    {        Set certs = new HashSet();        Iterator iter = certStores.iterator();        while (iter.hasNext())        {            CertStore   certStore = (CertStore)iter.next();            certs.addAll(certStore.getCertificates(certSelect));        }        return certs;    }        /**     * Find the issuer certificate of the given certificate.     *     * @param cert the certificate hows issuer certificate should     * be found.     * @param certStores a list of <code>CertStore</code> object     * that will be searched     *     * @return then <code>X509Certificate</code> object containing     * the issuer certificate or <code>null</code> if not found     *     * @exception CertPathValidatorException if a TrustAnchor  was     * found but the signature verificytion on the given certificate     * has thrown an exception. This Exception can be obtainted with     * <code>getCause()</code> method.     **/    private final X509Certificate findIssuer(        X509Certificate cert,        List certStores)        throws CertPathValidatorException    {        Exception invalidKeyEx = null;        X509CertSelector certSelect = new X509CertSelector();        try        {            certSelect.setSubject(cert.getIssuerX500Principal().getEncoded());        }        catch (IOException ex)        {            throw new CertPathValidatorException("Issuer not found", null, null, -1);        }        Iterator iter;        try        {            iter = findCertificates(certSelect, certStores).iterator();        }        catch (CertStoreException e)        {            throw new CertPathValidatorException(e);        }                X509Certificate issuer = null;        while (iter.hasNext() && issuer == null)        {            issuer = (X509Certificate)iter.next();            try            {                cert.verify(issuer.getPublicKey());            }            catch (Exception ex)            {                invalidKeyEx = ex;                issuer = null;            }        }        if (issuer == null && invalidKeyEx == null)        {           throw new CertPathValidatorException("Issuer not found", null, null, -1);        }        if (issuer == null && invalidKeyEx != null)        {            throw new CertPathValidatorException("issuer found but certificate validation failed",invalidKeyEx,null,-1);        }        return issuer;    }}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产一区二区三区不卡在线观看| 亚洲综合图片区| 国产东北露脸精品视频| 国产香蕉久久精品综合网| 国产99一区视频免费| 国产精品国产三级国产aⅴ入口| 粉嫩在线一区二区三区视频| 亚洲色图丝袜美腿| 欧美日韩精品一区二区| 久久精品国产久精国产| 国产亚洲一二三区| 91极品视觉盛宴| 日韩精品一区第一页| 欧美岛国在线观看| eeuss国产一区二区三区| 亚洲激情欧美激情| 精品乱人伦小说| 99久久免费国产| 日韩精品一二区| 国产欧美日韩精品一区| 色婷婷香蕉在线一区二区| 天堂一区二区在线| 国产亚洲欧洲997久久综合| 一本久久a久久精品亚洲| 日本系列欧美系列| 国产精品久久久久四虎| 欧美久久久久久蜜桃| 国产成人精品1024| 亚洲成人高清在线| 国产欧美一区二区三区沐欲| 色8久久人人97超碰香蕉987| 国产成人综合精品三级| 亚洲欧美在线另类| 日韩三级av在线播放| 91无套直看片红桃| 国产在线视频一区二区三区| 一区二区三区在线观看网站| 久久综合色8888| 欧美在线免费视屏| 岛国精品一区二区| 免费在线欧美视频| 亚洲综合免费观看高清完整版| 久久久久成人黄色影片| 欧美一区二区精品久久911| caoporm超碰国产精品| 黑人精品欧美一区二区蜜桃| 香蕉成人伊视频在线观看| 国产精品免费人成网站| 欧美成人高清电影在线| 欧美日韩精品欧美日韩精品一| av网站免费线看精品| 国产一区二区伦理片| 日本不卡一区二区三区高清视频| 亚洲品质自拍视频| 国产精品乱人伦中文| 精品国产乱码久久久久久蜜臀 | 中文字幕佐山爱一区二区免费| 欧美精品精品一区| 91国产丝袜在线播放| 成人免费高清在线观看| 久久精品国产精品青草| 青青国产91久久久久久 | 亚洲第一av色| 亚洲三级在线播放| 国产精品乱码一区二区三区软件| 日韩美女主播在线视频一区二区三区 | 国产欧美日韩在线视频| 日韩美一区二区三区| 欧美精品丝袜中出| 欧美日韩国产小视频在线观看| 91浏览器在线视频| av在线一区二区三区| 欧洲国产伦久久久久久久| 日本韩国一区二区三区| 91日韩精品一区| eeuss国产一区二区三区| 成人黄色a**站在线观看| 国产高清成人在线| 国产成人免费在线| 国产精品66部| 国产不卡在线视频| 成人av在线观| 色综合久久中文字幕综合网| 91麻豆国产自产在线观看| 色婷婷久久久久swag精品| 欧美性受极品xxxx喷水| 欧美午夜不卡在线观看免费| 欧美日韩综合在线| 4438成人网| 久久综合九色综合97婷婷| 精品久久久网站| 国产无人区一区二区三区| 欧美国产日韩在线观看| 亚洲精品国产品国语在线app| 亚洲国产综合人成综合网站| 视频一区国产视频| 精品一区二区三区在线播放视频| 国产风韵犹存在线视精品| 91碰在线视频| 欧美日韩中文字幕一区二区| 日韩视频中午一区| 国产精品免费aⅴ片在线观看| 中文字幕日韩一区| 日本中文字幕不卡| 国产精品香蕉一区二区三区| 色综合网色综合| 欧美精品123区| 国产欧美精品一区| 亚洲午夜成aⅴ人片| 看电视剧不卡顿的网站| 高清不卡一区二区在线| 在线中文字幕一区二区| 亚洲精品在线观| 中文字幕亚洲在| 丝袜亚洲另类欧美综合| 成人激情小说网站| 欧美电影在线免费观看| 欧美国产精品一区二区| 亚洲一二三四久久| 国产一区二区在线免费观看| 91猫先生在线| 欧美不卡视频一区| 亚洲精品第一国产综合野| 久久91精品国产91久久小草| 91蜜桃视频在线| 久久伊人中文字幕| 香蕉av福利精品导航| 成人短视频下载| 日韩视频在线观看一区二区| 亚洲天堂网中文字| 国产在线观看免费一区| 欧美精品久久天天躁| 国产精品久久久久影院老司| 日本女人一区二区三区| 色婷婷综合久久久| 欧美国产日韩精品免费观看| 欧美a级一区二区| 欧美少妇一区二区| 国产精品毛片大码女人| 韩国精品在线观看| 欧美一区二区三区四区在线观看| 中文字幕欧美一区| 成人自拍视频在线| 日韩欧美美女一区二区三区| 亚洲综合小说图片| 91美女视频网站| 欧美高清在线视频| 国产精品资源网| 精品91自产拍在线观看一区| 偷拍亚洲欧洲综合| 欧美日韩国产精选| 亚洲小说春色综合另类电影| 懂色av一区二区三区蜜臀| 久久综合色鬼综合色| 麻豆视频观看网址久久| 在线电影院国产精品| 一个色在线综合| 色女孩综合影院| 亚洲精品国产一区二区精华液| 99综合影院在线| 国产精品电影一区二区| 成人激情小说网站| 国产精品国产三级国产aⅴ中文| 懂色av一区二区三区蜜臀| 中文字幕的久久| 成人精品鲁一区一区二区| 欧美国产精品一区二区| 成人一区二区在线观看| 国产精品你懂的在线欣赏| bt欧美亚洲午夜电影天堂| √…a在线天堂一区| 91视频在线观看免费| 亚洲精品欧美激情| 欧美亚洲尤物久久| 亚洲一区成人在线| 欧美日韩一区二区在线观看| 日韩电影一区二区三区| proumb性欧美在线观看| 欧美xxxx在线观看| 国产乱对白刺激视频不卡| 国产欧美一二三区| 99久久国产综合精品色伊| 综合欧美亚洲日本| 精品视频一区二区不卡| 男人的j进女人的j一区| 久久综合久久鬼色中文字| 不卡电影一区二区三区| 亚洲久草在线视频| 欧美一区二区三区影视| 久久99这里只有精品| 国产女人18水真多18精品一级做 | 成人黄色小视频| 夜夜亚洲天天久久| 日韩欧美精品在线| 高清在线观看日韩| 亚洲一区二区三区四区在线免费观看 | 成人免费av资源| 亚洲综合成人网| 26uuu国产一区二区三区| 成人一区二区三区视频在线观看|