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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? authorizer.java

?? 一套JAVA的CA證書簽發系統.
?? JAVA
字號:
/************************************************************************* *                                                                       * *  EJBCA: The OpenSource Certificate Authority                          * *                                                                       * *  This software is free software; you can redistribute it and/or       * *  modify it under the terms of the GNU Lesser General Public           * *  License as published by the Free Software Foundation; either         * *  version 2.1 of the License, or any later version.                    * *                                                                       * *  See terms of license at gnu.org.                                     * *                                                                       * *************************************************************************/ package se.anatom.ejbca.authorization;import java.rmi.RemoteException;import java.security.cert.Certificate;import java.security.cert.X509Certificate;import java.util.ArrayList;import java.util.Collection;import java.util.Iterator;import javax.ejb.CreateException;import javax.naming.NamingException;import se.anatom.ejbca.ca.caadmin.ICAAdminSessionLocal;import se.anatom.ejbca.ca.crl.RevokedCertInfo;import se.anatom.ejbca.ca.store.ICertificateStoreSessionLocal;import se.anatom.ejbca.log.Admin;import se.anatom.ejbca.log.ILogSessionLocal;import se.anatom.ejbca.log.LogEntry;import se.anatom.ejbca.ra.raadmin.IRaAdminSessionLocal;import se.anatom.ejbca.util.CertTools;/** * A java bean handling the athorization to ejbca. * * The main metod are isAthorized and authenticate. * * @version $Id: Authorizer.java,v 1.8 2004/05/19 07:00:46 anatom Exp $ */public class Authorizer extends Object implements java.io.Serializable{        /** Creates new EjbcaAthorization */    public Authorizer(Collection admingroups, AdminGroupDataLocalHome  admingrouphome,                      ILogSessionLocal logsession, ICertificateStoreSessionLocal certificatestoresession,                       IRaAdminSessionLocal raadminsession, ICAAdminSessionLocal caadminsession, Admin admin, int module)                         throws NamingException, CreateException, RemoteException {        accesstree = new AccessTree();        authorizationproxy = new AuthorizationProxy(admingrouphome, accesstree);        buildAccessTree(admingroups);                                this.logsession = logsession;        this.module=module;        this.certificatesession = certificatestoresession;        this.raadminsession = raadminsession;        this.caadminsession = caadminsession;                     }    // Public methods.    /**     * Method to check if a user is authorized to a resource     *     * @param admininformation information about the user to be authorized.     * @param resource the resource to look up.     * @return true if authorizes     * @throws AuthorizationDeniedException when authorization is denied.     */    public boolean isAuthorized(Admin admin, String resource) throws AuthorizationDeniedException {               if(admin == null)       	 throw  new AuthorizationDeniedException("Administrator not authorized to resource : " + resource);              AdminInformation admininformation = admin.getAdminInformation();	          if(!authorizationproxy.isAuthorized(admininformation, resource)  && !authorizationproxy.isAuthorized(admininformation, "/super_administrator")){         if(!admininformation.isSpecialUser())           logsession.log(admin, admininformation.getX509Certificate(), module,   new java.util.Date(),null, null, LogEntry.EVENT_ERROR_NOTAUTHORIZEDTORESOURCE,"Resource : " + resource);         else           logsession.log(admin, ILogSessionLocal.INTERNALCAID, module,   new java.util.Date(),null, null, LogEntry.EVENT_ERROR_NOTAUTHORIZEDTORESOURCE,"Resource : " + resource);           throw  new AuthorizationDeniedException("Administrator not authorized to resource : " + resource);       }       if(!admininformation.isSpecialUser())         logsession.log(admin,admininformation.getX509Certificate(),  module, new java.util.Date(),null, null, LogEntry.EVENT_INFO_AUTHORIZEDTORESOURCE,"Resource : " + resource);              else         logsession.log(admin, ILogSessionLocal.INTERNALCAID,  module, new java.util.Date(),null, null, LogEntry.EVENT_INFO_AUTHORIZEDTORESOURCE,"Resource : " + resource);                  return true;    }    /**     * Method to check if a user is authorized to a resource without performing any logging     *     * @param AdminInformation information about the user to be authorized.     * @param resource the resource to look up.     * @return true if authorizes     * @throws AuthorizationDeniedException when authorization is denied.     */    public boolean isAuthorizedNoLog(Admin admin, String resource) throws AuthorizationDeniedException {        if(admin == null)        	throw  new AuthorizationDeniedException("Administrator not authorized to resource : " + resource);                // Check in accesstree.       if(!authorizationproxy.isAuthorized(admin.getAdminInformation(), resource)  && !authorizationproxy.isAuthorized(admin.getAdminInformation(), "/super_administrator")){         throw  new AuthorizationDeniedException("Administrator not authorized to resource : " + resource);       }        return true;    }    	/**	 * Method to check if a group is authorized to a resource	 *	 * @param admininformation information about the user to be authorized.	 * @param resource the resource to look up.	 * @return true if authorizes	 * @throws AuthorizationDeniedException when authorization is denied.	 */	public boolean isGroupAuthorized(Admin admin, int pk, String resource) throws AuthorizationDeniedException {	   if(admin == null)	   	 throw  new AuthorizationDeniedException("Administrator group not authorized to resource : " + resource);			   AdminInformation admininformation = admin.getAdminInformation();	   	   if(!authorizationproxy.isGroupAuthorized(admininformation, pk, resource)){		 if(!admininformation.isSpecialUser())		   logsession.log(admin, admininformation.getX509Certificate(), module,   new java.util.Date(),null, null, LogEntry.EVENT_ERROR_NOTAUTHORIZEDTORESOURCE,"Adminstrator group authorized to resource : " + resource);		 else		   logsession.log(admin, ILogSessionLocal.INTERNALCAID, module,   new java.util.Date(),null, null, LogEntry.EVENT_ERROR_NOTAUTHORIZEDTORESOURCE,"Adminstrator group authorized to resource : " + resource);  		 throw  new AuthorizationDeniedException("Administrator group not authorized to resource : " + resource);	   }	   if(!admininformation.isSpecialUser())		 logsession.log(admin,admininformation.getX509Certificate(),  module, new java.util.Date(),null, null, LogEntry.EVENT_INFO_AUTHORIZEDTORESOURCE,"Adminstrator group not authorized to resource : " + resource);       	   else		 logsession.log(admin, ILogSessionLocal.INTERNALCAID,  module, new java.util.Date(),null, null, LogEntry.EVENT_INFO_AUTHORIZEDTORESOURCE,"Adminstrator group not authorized to resource : " + resource);           	   return true;	}	/**	 * Method to check if a group is authorized to a resource without performing any logging	 *	 * @param AdminInformation information about the user to be authorized.	 * @param resource the resource to look up.	 * @return true if authorizes	 * @throws AuthorizationDeniedException when authorization is denied.	 */	public boolean isGroupAuthorizedNoLog(Admin admin, int pk, String resource) throws AuthorizationDeniedException {	   if(admin == null)  	   	 throw  new AuthorizationDeniedException("Administrator group not authorized to resource : " + resource);		// Check in accesstree.	   if(!authorizationproxy.isGroupAuthorized(admin.getAdminInformation(), 	                                              pk, resource)){		 throw  new AuthorizationDeniedException("Administrator group not authorized to resource : " + resource);	   }		return true;	}        /**     * Method that authenticates a certificate by verifying signature, checking validity and lookup if certificate is revoked.     *     * @param certificate the certificate to be authenticated.     * @throws AuthenticationFailedException if authentication failed.     */    public void authenticate(X509Certificate certificate) throws AuthenticationFailedException {      // Check Validity        try{          certificate.checkValidity();        }catch(Exception e){           throw new AuthenticationFailedException("Your certificates vality has expired.");        }        // TODO /*     // Vertify Signature        boolean verified = false;        for(int i=0; i < this.cacertificatechain.length; i++){           try{//            log.debug("Authorizer: authenticate : Comparing : "  + CertTools.getIssuerDN(certificate) + " With " + CertTools.getSubjectDN((X509Certificate) cacertificatechain[i]));//            if(LDAPDN.equals(CertTools.getIssuerDN(certificate), CertTools.getSubjectDN((X509Certificate) cacertificatechain[i]))){               certificate.verify(cacertificatechain[i].getPublicKey());               verified = true;//            }           }catch(Exception e){}        }        if(!verified)           throw new AuthenticationFailedException("Your certificate cannot be verified by CA certificate chain.");*/      // Check if certificate is revoked.        RevokedCertInfo revinfo = certificatesession.isRevoked(new Admin(certificate), CertTools.getIssuerDN(certificate),certificate.getSerialNumber());        if (revinfo == null) {            // Certificate missing            throw new AuthenticationFailedException("Your certificate cannot be found in database.");        } else if (revinfo.getReason() != RevokedCertInfo.NOT_REVOKED) {            // Certificate revoked            throw new AuthenticationFailedException("Your certificate have been revoked.");        }    }    /**     * Method used to return an ArrayList of Integers indicating which CAids a administrator     * is authorized to access.     */           public Collection getAuthorizedCAIds(Admin admin){               ArrayList returnval = new ArrayList();        Iterator iter = caadminsession.getAvailableCAs(admin).iterator();                       while(iter.hasNext()){        Integer caid = (Integer) iter.next();        try{                     isAuthorizedNoLog(admin, AvailableAccessRules.CAPREFIX + caid.toString());                         returnval.add(caid);         }catch(AuthorizationDeniedException e){}      }                               return returnval;    }		           /**     * Method used to return an Collection of Integers indicating which end entity profiles     * the administrator is authorized to view.     *     * @param admin, the administrator      * @rapriviledge should be one of the end entity profile authorization constans defined in AvailableAccessRules.     */            public Collection getAuthorizedEndEntityProfileIds(Admin admin, String rapriviledge){      ArrayList returnval = new ArrayList();        Iterator iter = raadminsession.getEndEntityProfileIdToNameMap(admin).keySet().iterator();                   while(iter.hasNext()){        Integer profileid = (Integer) iter.next();        try{          isAuthorizedNoLog(admin, AvailableAccessRules.ENDENTITYPROFILEPREFIX + profileid + rapriviledge);               returnval.add(profileid);         }catch(AuthorizationDeniedException e){}                         }            return returnval;    }        /** Metod to load the access data from database. */    public void buildAccessTree(Collection admingroups){      accesstree.buildTree(admingroups);      authorizationproxy.clear();    }    // Private metods    // Private fields.    private AccessTree            accesstree;    private Certificate[]         cacertificatechain;    private int                   module;    private ICertificateStoreSessionLocal  certificatesession;    private ILogSessionLocal               logsession;    private IRaAdminSessionLocal           raadminsession;    private ICAAdminSessionLocal           caadminsession;    private AuthorizationProxy             authorizationproxy;}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品不卡在线| 中文字幕在线一区二区三区| 在线观看一区日韩| 日韩欧美国产不卡| 综合久久久久综合| 亚洲一区二区影院| 日韩极品在线观看| 欧美亚洲一区三区| 久久久久88色偷偷免费| 日本一区二区三级电影在线观看| 国产日产亚洲精品系列| 亚洲无线码一区二区三区| 免费在线观看日韩欧美| 久久精品av麻豆的观看方式| 国产传媒久久文化传媒| 欧美中文字幕亚洲一区二区va在线| 亚洲欧洲无码一区二区三区| 日韩精彩视频在线观看| 国产一区二区视频在线播放| 成人app在线观看| 精品国产一区二区三区四区四 | 成人爽a毛片一区二区免费| 久久影院午夜片一区| 国产精品看片你懂得| 亚洲第一搞黄网站| 国产在线精品不卡| 色婷婷亚洲婷婷| 欧美成人官网二区| 亚洲成人一区二区在线观看| 丁香激情综合国产| 精品国产一区二区国模嫣然| 一区精品在线播放| 色婷婷久久久综合中文字幕| 欧美日韩国产首页在线观看| 国产日韩v精品一区二区| 亚洲视频网在线直播| 成人免费视频播放| 国产日本一区二区| 不卡在线观看av| 亚洲三级电影网站| 国内精品在线播放| 久久精品日产第一区二区三区高清版| 亚洲欧美激情一区二区| 成人av午夜影院| 国产校园另类小说区| 国产精品白丝jk黑袜喷水| 日韩一卡二卡三卡四卡| 久久精品国产99国产| 久久免费美女视频| 床上的激情91.| 亚洲黄色免费网站| 99亚偷拍自图区亚洲| 日韩欧美国产电影| 国产精华液一区二区三区| 久久久久国产成人精品亚洲午夜| 蜜臀av性久久久久蜜臀av麻豆| 精品中文字幕一区二区小辣椒| 91九色最新地址| 欧美激情艳妇裸体舞| 99国产精品视频免费观看| 91精品国产色综合久久| 日韩av不卡一区二区| 2023国产精华国产精品| 国产一区二区三区四区五区美女| 欧美日韩国产高清一区二区 | 最新日韩在线视频| 国产精品亚洲第一区在线暖暖韩国| 另类小说色综合网站| 国产精品色一区二区三区| aaa亚洲精品| 国产欧美一区二区精品久导航| 国产黄人亚洲片| 国产精品午夜春色av| 高清国产一区二区| 亚洲人吸女人奶水| 欧美日本视频在线| 欧美成人三级电影在线| 成人在线视频一区二区| 久久久亚洲国产美女国产盗摄| 日韩av中文在线观看| 欧美激情在线看| 3atv一区二区三区| 成人禁用看黄a在线| 一区在线中文字幕| 国产精品久久福利| 欧美手机在线视频| 秋霞电影网一区二区| 免费在线一区观看| 精品国产免费久久| 北条麻妃一区二区三区| 亚洲乱码国产乱码精品精可以看| 91一区二区三区在线观看| 午夜精品久久久久久久久久 | 精品视频在线免费| 不卡的电影网站| 极品少妇一区二区三区精品视频| 久久精品欧美日韩| 欧美一区二区网站| 91丨porny丨首页| 香蕉加勒比综合久久| 中文字幕在线视频一区| 欧美一区二区在线不卡| 欧美久久一二区| 欧美亚洲精品一区| 91麻豆精品秘密| 风间由美性色一区二区三区| 免费成人美女在线观看| 国产蜜臀97一区二区三区| 欧美视频在线观看一区| 麻豆国产一区二区| 日本亚洲视频在线| 视频一区二区三区在线| 亚洲欧洲精品天堂一级 | 国产精品小仙女| 亚洲线精品一区二区三区| 国产欧美视频一区二区| 欧美高清你懂得| a在线欧美一区| 成人在线视频一区二区| 美女视频黄免费的久久| 国产精品大尺度| 国产精品素人视频| 欧美日韩国产综合视频在线观看| 国产一区欧美日韩| 国产精品中文欧美| 日本不卡高清视频| 亚洲成a人片综合在线| 日韩欧美国产一区二区三区 | 欧美性猛交xxxxxx富婆| 麻豆精品一区二区综合av| 在线免费观看成人短视频| 国产mv日韩mv欧美| 北条麻妃一区二区三区| 91麻豆国产精品久久| 国产激情91久久精品导航| 欧美日韩国产一区二区三区地区| 亚洲国产成人av| 亚洲第一激情av| 九九九精品视频| 成人精品视频一区二区三区| 国产伦精品一区二区三区视频青涩| 免费观看91视频大全| 国内外成人在线视频| 久久99九九99精品| 成人精品gif动图一区| 99久久婷婷国产综合精品电影| 久久99精品久久久久久国产越南| 丝袜亚洲另类丝袜在线| 亚洲h在线观看| 日本vs亚洲vs韩国一区三区二区| 香蕉久久一区二区不卡无毒影院| 一区二区三区91| 国产高清在线观看免费不卡| 成人综合在线观看| 一本色道久久综合亚洲91| 欧美色爱综合网| 国产午夜精品一区二区三区嫩草| 久久综合网色—综合色88| 国产精品成人免费精品自在线观看| 国产精品成人在线观看| 亚洲成人免费在线观看| 国产精品一级黄| 色综合一个色综合| 4438x亚洲最大成人网| 欧美大黄免费观看| 国产精品美女久久福利网站| 自拍偷拍国产亚洲| 蜜臀va亚洲va欧美va天堂| 美女网站视频久久| av一区二区三区| 日韩欧美的一区| 一区二区三区精品视频| 国产麻豆视频一区| 日韩一二三区不卡| 中文字幕在线不卡一区| 美日韩一区二区| 欧美日韩激情一区二区三区| 国产色91在线| 亚洲永久免费av| 国内精品久久久久影院色| 色香蕉久久蜜桃| 亚洲精品在线观看视频| 日韩成人伦理电影在线观看| 国内精品伊人久久久久av影院| 色999日韩国产欧美一区二区| 精品少妇一区二区三区视频免付费| 中文字幕欧美激情| 风间由美一区二区av101| 欧美这里有精品| 亚洲国产精品激情在线观看| 国产主播一区二区三区| 欧美欧美欧美欧美| 亚洲一区二区成人在线观看| 91欧美一区二区| 亚洲精品乱码久久久久| youjizz国产精品| 久久久99精品免费观看不卡| 亚洲国产成人91porn| 国产ts人妖一区二区| 国产日韩欧美电影|