Source Code Cross Referenced for SubjectConfirmationData.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: SubjectConfirmationData.java,v 1.4 2007/01/08 16:05:59 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.SubjectConfirmationDataType;
033:        import com.sun.xml.wss.saml.util.SAML20JAXBUtil;
034:        import java.util.logging.Logger;
035:        import java.util.GregorianCalendar;
036:        import javax.xml.datatype.DatatypeFactory;
037:        import javax.xml.datatype.DatatypeConfigurationException;
038:        import java.security.PublicKey;
039:
040:        import javax.xml.bind.JAXBContext;
041:        import org.w3c.dom.Element;
042:
043:        /**
044:         * The <code>SubjectConfirmationData</code> element specifies a subject by specifying data that
045:         * authenticates the subject.
046:         */
047:        public class SubjectConfirmationData extends
048:                SubjectConfirmationDataType implements 
049:                com.sun.xml.wss.saml.SubjectConfirmationData {
050:
051:            protected PublicKey keyInfoKeyValue = null;
052:
053:            protected static final Logger log = Logger.getLogger(
054:                    LogDomainConstants.WSS_API_DOMAIN,
055:                    LogDomainConstants.WSS_API_DOMAIN_BUNDLE);
056:
057:            public SubjectConfirmationData() {
058:
059:            }
060:
061:            /**
062:             * Constructs a subject confirmation element from an existing
063:             * XML block.
064:             *
065:             * @param SubjectConfirmationDataElement a DOM Element representing the
066:             *        <code>SubjectConfirmationData</code> object.
067:             * @throws SAMLException
068:             */
069:            public static SubjectConfirmationDataType fromElement(
070:                    org.w3c.dom.Element element) throws SAMLException {
071:                try {
072:                    JAXBContext jc = SAML20JAXBUtil.getJAXBContext();
073:
074:                    javax.xml.bind.Unmarshaller u = jc.createUnmarshaller();
075:                    return (SubjectConfirmationDataType) u.unmarshal(element);
076:                } catch (Exception ex) {
077:                    throw new SAMLException(ex.getMessage());
078:                }
079:            }
080:
081:            /**
082:             * Constructs an <code>SubjectConfirmationData</code> instance.
083:             *
084:             * @param confirmationMethods A set of <code>confirmationMethods</code>
085:             *        each of which is a URI (String) that identifies a protocol
086:             *        used to authenticate a <code>Subject</code>. Please refer to
087:             *        <code>draft-sstc-core-25</code> Section 7 for
088:             *        a list of URIs identifying common authentication protocols.
089:             * @param SubjectConfirmationDataData Additional authentication information to
090:             *        be used by a specific authentication protocol. Can be passed as
091:             *        null if there is no <code>SubjectConfirmationDataData</code> for the
092:             *        <code>SubjectConfirmationData</code> object.
093:             * @param keyInfo An XML signature element that specifies a cryptographic
094:             *        key held by the <code>Subject</code>.
095:             * @exception SAMLException if the input data is invalid or
096:             *            <code>confirmationMethods</code> is empty.
097:             */
098:            public SubjectConfirmationData(String address, String inResponseTo,
099:                    GregorianCalendar notBefore,
100:                    GregorianCalendar notOnOrAfter, String recipient,
101:                    Element keyInfo) throws SAMLException {
102:
103:                //        JAXBContext jc = null;
104:                //        javax.xml.bind.Unmarshaller u = null;
105:                //        
106:                //        //Unmarshal to JAXB KeyInfo Object and set it
107:                //        try {
108:                //            jc = SAML20JAXBUtil.getJAXBContext();
109:                //           u = jc.createUnmarshaller();
110:                //        } catch ( Exception ex) {
111:                //            throw new SAMLException(ex.getMessage());
112:                //        }
113:
114:                //        try {
115:                //            if ( keyInfo != null) {
116:                //                setKeyInfo((KeyInfoType)((JAXBElement)u.unmarshal(keyInfo)).getValue());
117:                //            }
118:                //            if ( SubjectConfirmationDataData != null) {
119:                //                setSubjectConfirmationDataData((SubjectConfirmationDataType)((JAXBElement)u.unmarshal(SubjectConfirmationDataData)).getValue());
120:                //            }
121:                //        } catch (Exception ex) {
122:                //            // log here
123:                //            throw new SAMLException(ex);
124:                //        }
125:                setAddress(address);
126:                setInResponseTo(inResponseTo);
127:                if (notBefore != null) {
128:                    try {
129:                        DatatypeFactory factory = DatatypeFactory.newInstance();
130:                        setNotBefore(factory.newXMLGregorianCalendar(notBefore));
131:                    } catch (DatatypeConfigurationException ex) {
132:                        //ignore
133:                    }
134:                }
135:
136:                if (notOnOrAfter != null) {
137:                    try {
138:                        DatatypeFactory factory = DatatypeFactory.newInstance();
139:                        setNotOnOrAfter(factory
140:                                .newXMLGregorianCalendar(notOnOrAfter));
141:                    } catch (DatatypeConfigurationException ex) {
142:                        //ignore
143:                    }
144:                }
145:
146:                setRecipient(recipient);
147:
148:                if (keyInfo != null) {
149:                    this.getContent().add(keyInfo);
150:                }
151:            }
152:        }
w___w_w___.j___a___v_a__2_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.