⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 endusercertificateprofile.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.ca.store.certificateprofiles;import java.util.ArrayList;/** * EndUserCertificateProfile is a class defining the fixed characteristics of an enduser certificate type ** @version $Id$  */public class EndUserCertificateProfile extends CertificateProfile{    // Public Constants    public final static String CERTIFICATEPROFILENAME =  "ENDUSER";    // Public Methods    /** Creates a certificate with the characteristics of an end user. */    public EndUserCertificateProfile() {      setCertificateVersion(VERSION_X509V3);      setValidity(730);      setUseBasicConstraints(true);      setBasicConstraintsCritical(true);      setUseSubjectKeyIdentifier(true);      setSubjectKeyIdentifierCritical(false);      setUseAuthorityKeyIdentifier(true);      setAuthorityKeyIdentifierCritical(false);      setUseSubjectAlternativeName(true);      setSubjectAlternativeNameCritical(false);      setUseCRLDistributionPoint(false);      setCRLDistributionPointCritical(false);      setCRLDistributionPointURI("");      setUseCertificatePolicies(false);      setCertificatePoliciesCritical(false);      setCertificatePolicyId("2.5.29.32.0");      setType(TYPE_ENDENTITY);      int[] bitlengths = {512,1024,2048,4096};      setAvailableBitLengths(bitlengths);      // Standard key usages for end users are: digitalSignature | keyEncipherment or nonRepudiation      // Default key usage is digitalSignature | keyEncipherment      // Create an array for KeyUsage acoording to X509Certificate.getKeyUsage()      setUseKeyUsage(true);      setKeyUsage(new boolean[9]);      setKeyUsage(DIGITALSIGNATURE,true);      setKeyUsage(KEYENCIPHERMENT,true);      setKeyUsageCritical(true);      setUseExtendedKeyUsage(true);      ArrayList eku = new ArrayList();      eku.add(new Integer(SERVERAUTH));      eku.add(new Integer(CLIENTAUTH));      eku.add(new Integer(EMAILPROTECTION));      eku.add(new Integer(IPSECENDSYSTEM));      eku.add(new Integer(IPSECUSER));      setExtendedKeyUsage(eku);      setExtendedKeyUsageCritical(false);            ArrayList availablecas = new ArrayList();      availablecas.add(new Integer(ANYCA));      setAvailableCAs(availablecas);            setPublisherList(new ArrayList());    }    // Public Methods.    public void upgrade(){      if(LATEST_VERSION != getVersion()){        // New version of the class, upgrade        super.upgrade();               }    }    // Private fields.}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -