Source Code Cross Referenced for CertAdminFactory.java in  » Portal » Open-Portal » com » sun » portal » cli » cert » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Portal » Open Portal » com.sun.portal.cli.cert 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * CertAdminFactory.java
003:         *
004:         */
005:
006:        /**
007:         *
008:         * @author ss133690 
009:         * @version 
010:         */package com.sun.portal.cli.cert;
011:
012:        import java.util.ResourceBundle;
013:        import com.sun.portal.log.common.PortalLogger;
014:
015:        public class CertAdminFactory {
016:
017:            public static PasswordContext CreatePasswordContext() {
018:                return new PasswordContextImpl();
019:            }
020:
021:            public static JSSContext CreateJSSContext(String inst,
022:                    String basedir, String dsameLocaledir)
023:                    throws CertAdminException {
024:
025:                String platformFile = basedir + CertAdminConstants.SEPERATOR
026:                        + CertAdminConstants.PLATFORMFILE + "." + inst;
027:                if (!CertAdminUtil.fileExist(platformFile)) {
028:                    //println("Error!, Cannot locate Platform file.");
029:                    throw new CertAdminException(CertAdminLocale.getPFString(
030:                            "m2", CertAdminConstants.m2));
031:                }
032:                SystemProperties.init(platformFile);
033:                String certdir = SystemProperties.get("gateway.certdir");
034:                String fqdn = SystemProperties.get("gateway.host");
035:                String dsameLocaleFile = dsameLocaledir
036:                        + CertAdminConstants.SEPERATOR
037:                        + CertAdminConstants.LOCALEFILE;
038:                /*        if( !CertAdminUtil.fileExist(dsameLocaleFile) ){
039:                 throw new CertAdminException(CertAdminLocale.getPFString("m51",CertAdminConstants.m51));
040:                 }*/
041:                //        SystemProperties.init(dsameLocaleFile);
042:                //        String locale = SystemProperties.get("com.iplanet.am.locale", "en_US");
043:                ResourceBundle amConfigProps = ResourceBundle
044:                        .getBundle("AMConfig");
045:                String locale = "en_US";
046:                try {
047:                    locale = amConfigProps.getString("com.iplanet.am.locale");
048:                } catch (Exception ex) {
049:                    locale = "en_US";
050:                }
051:                JSSContext jsscntx = new JSSContextImpl(certdir, fqdn, locale);
052:                jsscntx.setPasswordContext(CreatePasswordContext());
053:                if (!jsscntx.init()) {
054:                    throw new CertAdminException(CertAdminLocale.getPFString(
055:                            "m1", CertAdminConstants.m1));
056:                }
057:                return jsscntx;
058:
059:            }
060:
061:            public static CertContext CreateCertificateContext(String fqdn,
062:                    String o, String ou, String l, String s, String c,
063:                    String token, String nick, int val) {
064:                CertContext certcntx = new CertContext();
065:                certcntx.fqdn = fqdn;
066:                certcntx.o = o;
067:                certcntx.ou = ou;
068:                certcntx.l = l;
069:                certcntx.s = s;
070:                certcntx.c = c;
071:                certcntx.token = token;
072:                certcntx.nick = nick;
073:                certcntx.val = val;
074:                return certcntx;
075:            }
076:
077:            public static Command CreateCommand(int cid) {
078:                switch (cid) {
079:                case 1: {
080:                    return new CreateSelfSignedCertificate();
081:                }
082:                case 2: {
083:                    return new GenerateCSR();
084:                }
085:                case 3: {
086:                    return new AddRootCA();
087:                }
088:                case 4: {
089:                    return new InstallCertificate();
090:                }
091:                case 5: {
092:                    return new DeleteCertificate();
093:                }
094:                case 6: {
095:                    return new ModifyTrustAttributes();
096:                }
097:                case 7: {
098:                    return new ListCACertificates();
099:                }
100:                case 8: {
101:                    return new ListCertificates();
102:                }
103:                case 9: {
104:                    return new PrintCertificate();
105:                }
106:                default: {
107:                    return new Exit();
108:                }
109:                }
110:            }
111:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.