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


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