Source Code Cross Referenced for SubjectConfirmation.java in  » 6.0-JDK-Modules-com.sun » xws-security » com » sun » xml » wss » saml » assertion » saml20 » jaxb20 » 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 » 6.0 JDK Modules com.sun » xws security » com.sun.xml.wss.saml.assertion.saml20.jaxb20 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * $Id: SubjectConfirmation.java,v 1.5 2007/01/08 16:06:00 shyam_rao Exp $
003:         */
004:
005:        /*
006:         * The contents of this file are subject to the terms
007:         * of the Common Development and Distribution License
008:         * (the License).  You may not use this file except in
009:         * compliance with the License.
010:         * 
011:         * You can obtain a copy of the license at
012:         * https://glassfish.dev.java.net/public/CDDLv1.0.html.
013:         * See the License for the specific language governing
014:         * permissions and limitations under the License.
015:         * 
016:         * When distributing Covered Code, include this CDDL
017:         * Header Notice in each file and include the License file
018:         * at https://glassfish.dev.java.net/public/CDDLv1.0.html.
019:         * If applicable, add the following below the CDDL Header,
020:         * with the fields enclosed by brackets [] replaced by
021:         * you own identifying information:
022:         * "Portions Copyrighted [year] [name of copyright owner]"
023:         * 
024:         * Copyright 2006 Sun Microsystems Inc. All Rights Reserved
025:         */
026:
027:        package com.sun.xml.wss.saml.assertion.saml20.jaxb20;
028:
029:        import com.sun.xml.wss.saml.SAMLException;
030:
031:        import com.sun.xml.wss.logging.LogDomainConstants;
032:        import com.sun.xml.wss.saml.internal.saml20.jaxb20.SubjectConfirmationType;
033:        import com.sun.xml.wss.saml.util.SAML20JAXBUtil;
034:        import java.util.logging.Logger;
035:
036:        import java.security.PublicKey;
037:
038:        import javax.xml.bind.JAXBContext;
039:
040:        /**
041:         * The <code>SubjectConfirmation</code> element specifies a subject by specifying data that
042:         * authenticates the subject.
043:         */
044:        public class SubjectConfirmation extends SubjectConfirmationType
045:                implements  com.sun.xml.wss.saml.SubjectConfirmation {
046:
047:            protected PublicKey keyInfoKeyValue = null;
048:
049:            protected static final Logger log = Logger.getLogger(
050:                    LogDomainConstants.WSS_API_DOMAIN,
051:                    LogDomainConstants.WSS_API_DOMAIN_BUNDLE);
052:
053:            public SubjectConfirmation() {
054:
055:            }
056:
057:            /**
058:             * From scratch constructor for a single confirmation method.
059:             *
060:             * @param confirmationMethod A URI (String) that identifies a protocol used
061:             *        to authenticate a <code>Subject</code>. Please refer to
062:             *        <code>draft-sstc-core-25</code> Section 7 for a list of URIs
063:             *        identifying common authentication protocols.
064:             * @exception SAMLException if the input data is null.
065:             */
066:            public SubjectConfirmation(NameID nameID, java.lang.String method) {
067:
068:                //        List cm = new LinkedList();
069:                //        cm.add(method);
070:                setNameID(nameID);
071:                setMethod(method);
072:            }
073:
074:            /**
075:             * Constructs a subject confirmation element from an existing
076:             * XML block.
077:             *
078:             * @param subjectConfirmationElement a DOM Element representing the
079:             *        <code>SubjectConfirmation</code> object.
080:             * @throws SAMLException
081:             */
082:            public static SubjectConfirmationType fromElement(
083:                    org.w3c.dom.Element element) throws SAMLException {
084:                try {
085:                    JAXBContext jc = SAML20JAXBUtil.getJAXBContext();
086:
087:                    javax.xml.bind.Unmarshaller u = jc.createUnmarshaller();
088:                    return (SubjectConfirmationType) u.unmarshal(element);
089:                } catch (Exception ex) {
090:                    throw new SAMLException(ex.getMessage());
091:                }
092:            }
093:
094:            /**
095:             * Constructs an <code>SubjectConfirmation</code> instance.
096:             *
097:             * @param confirmationMethods A set of <code>confirmationMethods</code>
098:             *        each of which is a URI (String) that identifies a protocol
099:             *        used to authenticate a <code>Subject</code>. Please refer to
100:             *        <code>draft-sstc-core-25</code> Section 7 for
101:             *        a list of URIs identifying common authentication protocols.
102:             * @param subjectConfirmationData Additional authentication information to
103:             *        be used by a specific authentication protocol. Can be passed as
104:             *        null if there is no <code>subjectConfirmationData</code> for the
105:             *        <code>SubjectConfirmation</code> object.
106:             * @param keyInfo An XML signature element that specifies a cryptographic
107:             *        key held by the <code>Subject</code>.
108:             * @exception SAMLException if the input data is invalid or
109:             *            <code>confirmationMethods</code> is empty.
110:             */
111:            public SubjectConfirmation(NameID nameID,
112:                    SubjectConfirmationData subjectConfirmationData,
113:                    java.lang.String confirmationMethod) throws SAMLException {
114:
115:                // JAXBContext jc = null;
116:                //javax.xml.bind.Unmarshaller u = null;
117:
118:                //Unmarshal to JAXB KeyInfo Object and set it
119:                // try {
120:                //    jc = SAML20JAXBUtil.getJAXBContext();
121:                //   u = jc.createUnmarshaller();
122:                //} catch ( Exception ex) {
123:                //   throw new SAMLException(ex.getMessage());
124:                //}
125:
126:                //        try {
127:                //            if ( keyInfo != null) {
128:                //                setKeyInfo((KeyInfoType)((JAXBElement)u.unmarshal(keyInfo)).getValue());
129:                //            }
130:                //            if ( subjectConfirmationData != null) {
131:                //                setSubjectConfirmationData((SubjectConfirmationType)((JAXBElement)u.unmarshal(subjectConfirmationData)).getValue());
132:                //            }
133:                //        } catch (Exception ex) {
134:                //            // log here
135:                //            throw new SAMLException(ex);
136:                //        }
137:                setNameID(nameID);
138:                if (subjectConfirmationData != null)
139:                    setSubjectConfirmationData(subjectConfirmationData);
140:                setMethod(confirmationMethod);
141:            }
142:
143:            public SubjectConfirmation(NameID nameID,
144:                    KeyInfoConfirmationData keyInfoConfirmationData,
145:                    java.lang.String confirmationMethod) throws SAMLException {
146:
147:                setNameID(nameID);
148:                if (keyInfoConfirmationData != null)
149:                    setSubjectConfirmationData(keyInfoConfirmationData);
150:                setMethod(confirmationMethod);
151:            }
152:        }
w__w_w___.___j_a__va_2__s.co_m__ | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.