001: /*
002: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
003: *
004: * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
005: *
006: * The contents of this file are subject to the terms of either the GNU
007: * General Public License Version 2 only ("GPL") or the Common
008: * Development and Distribution License("CDDL") (collectively, the
009: * "License"). You may not use this file except in compliance with the
010: * License. You can obtain a copy of the License at
011: * http://www.netbeans.org/cddl-gplv2.html
012: * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
013: * specific language governing permissions and limitations under the
014: * License. When distributing the software, include this License Header
015: * Notice in each file and include the License file at
016: * nbbuild/licenses/CDDL-GPL-2-CP. Sun designates this
017: * particular file as subject to the "Classpath" exception as provided
018: * by Sun in the GPL Version 2 section of the License file that
019: * accompanied this code. If applicable, add the following below the
020: * License Header, with the fields enclosed by brackets [] replaced by
021: * your own identifying information:
022: * "Portions Copyrighted [year] [name of copyright owner]"
023: *
024: * Contributor(s):
025: *
026: * The Original Software is NetBeans. The Initial Developer of the Original
027: * Software is Sun Microsystems, Inc. Portions Copyright 2006 Sun
028: * Microsystems, Inc. All Rights Reserved.
029: *
030: * If you wish your version of this file to be governed by only the CDDL
031: * or only the GPL Version 2, indicate your decision by adding
032: * "[Contributor] elects to include this software in this distribution
033: * under the [CDDL or GPL Version 2] license." If you do not indicate a
034: * single choice of license, a recipient has the option to distribute
035: * your version of this file under either the CDDL, the GPL Version 2 or
036: * to extend the choice of license to its licensees as provided above.
037: * However, if you add GPL Version 2 code and therefore, elected the GPL
038: * Version 2 license, then the option applies only if the new code is
039: * made subject to such option by the copyright holder.
040: */
041:
042: package org.netbeans.modules.websvc.wsitmodelext.security;
043:
044: import javax.xml.namespace.QName;
045: import java.util.HashSet;
046: import java.util.Set;
047:
048: /**
049: *
050: * @author Martin Grebac
051: */
052: public enum SecurityPolicyQName {
053: TRUST10(createSecurityPolicyQName("Trust10")), //NOI18N
054: MUSTSUPPORTISSUEDTOKENS(
055: createSecurityPolicyQName("MustSupportIssuedTokens")), //NOI18N
056: MUSTSUPPORTCLIENTCHALLENGE(
057: createSecurityPolicyQName("MustSupportClientChallenge")), //NOI18N
058: MUSTSUPPORTSERVERCHALLENGE(
059: createSecurityPolicyQName("MustSupportServerChallenge")), //NOI18N
060: REQUIRECLIENTENTROPY(
061: createSecurityPolicyQName("RequireClientEntropy")), //NOI18N
062: REQUIRESERVERENTROPY(
063: createSecurityPolicyQName("RequireServerEntropy")), //NOI18N
064:
065: WSS11(createSecurityPolicyQName("Wss11")), //NOI18N
066: WSS10(createSecurityPolicyQName("Wss10")), //NOI18N
067: MUSTSUPPORTREFKEYIDENTIFIER(
068: createSecurityPolicyQName("MustSupportRefKeyIdentifier")), //NOI18N
069: MUSTSUPPORTREFISSUERSERIAL(
070: createSecurityPolicyQName("MustSupportRefIssuerSerial")), //NOI18N
071: MUSTSUPPORTREFTHUMBPRINT(
072: createSecurityPolicyQName("MustSupportRefThumbprint")), //NOI18N
073: MUSTSUPPORTREFENCRYPTEDKEY(
074: createSecurityPolicyQName("MustSupportRefEncryptedKey")), //NOI18N
075: MUSTSUPPORTREFEXTERNALURI(
076: createSecurityPolicyQName("MustSupportRefExternalURI")), //NOI18N
077: MUSTSUPPORTREFEMBEDDEDTOKEN(
078: createSecurityPolicyQName("MustSupportRefEmbeddedToken")), //NOI18N
079: REQUIRESIGNATURECONFIRMATION(
080: createSecurityPolicyQName("RequireSignatureConfirmation")), //NOI18N
081: REQUESTSECURITYTOKENTEMPLATE(
082: createSecurityPolicyQName("RequestSecurityTokenTemplate")), //NOI18N
083:
084: SIGNEDPARTS(createSecurityPolicyQName("SignedParts")), //NOI18N
085: SIGNEDELEMENTS(createSecurityPolicyQName("SignedElements")), //NOI18N
086: ENCRYPTEDPARTS(createSecurityPolicyQName("EncryptedParts")), //NOI18N
087: ENCRYPTEDELEMENTS(createSecurityPolicyQName("EncryptedElements")), //NOI18N
088: REQUIREDELEMENTS(createSecurityPolicyQName("RequiredElements")), //NOI18N
089: XPATH(createSecurityPolicyQName("XPath")), //NOI18N
090: BODY(createSecurityPolicyQName("Body")), //NOI18N
091: HEADER(createSecurityPolicyQName("Header")), //NOI18N
092:
093: TRANSPORTBINDING(createSecurityPolicyQName("TransportBinding")), //NOI18N
094: SYMMETRICBINDING(createSecurityPolicyQName("SymmetricBinding")), //NOI18N
095: ASYMMETRICBINDING(createSecurityPolicyQName("AsymmetricBinding")), //NOI18N
096: BOOTSTRAPPOLICY(createSecurityPolicyQName("BootstrapPolicy")), //NOI18N
097:
098: INCLUDETIMESTAMP(createSecurityPolicyQName("IncludeTimestamp")), //NOI18N
099: ENCRYPTBEFORESIGNING(
100: createSecurityPolicyQName("EncryptBeforeSigning")), //NOI18N
101: ENCRYPTSIGNATURE(createSecurityPolicyQName("EncryptSignature")), //NOI18N
102: PROTECTTOKENS(createSecurityPolicyQName("ProtectTokens")), //NOI18N
103: ONLYSIGNENTIREHEADERSANDBODY(
104: createSecurityPolicyQName("OnlySignEntireHeadersAndBody")), //NOI18N
105:
106: LAYOUT(createSecurityPolicyQName("Layout")), //NOI18N
107: STRICT(createSecurityPolicyQName("Strict")), //NOI18N
108: LAX(createSecurityPolicyQName("Lax")), //NOI18N
109: LAXTSFIRST(createSecurityPolicyQName("LaxTsFirst")), //NOI18N
110: LAXTSLAST(createSecurityPolicyQName("LaxTsLast")); //NOI18N
111:
112: public static final String SECPOLICY_UTILITY = "http://schemas.xmlsoap.org/ws/2005/07/securitypolicy"; //NOI18N
113: public static final String SECPOLICY_UTILITY_NS_PREFIX = "sp"; //NOI18N
114:
115: public static QName createSecurityPolicyQName(String localName) {
116: return new QName(SECPOLICY_UTILITY, localName,
117: SECPOLICY_UTILITY_NS_PREFIX);
118: }
119:
120: SecurityPolicyQName(QName name) {
121: qName = name;
122: }
123:
124: public QName getQName() {
125: return qName;
126: }
127:
128: private static Set<QName> qnames = null;
129:
130: public static Set<QName> getQNames() {
131: if (qnames == null) {
132: qnames = new HashSet<QName>();
133: for (SecurityPolicyQName wq : values()) {
134: qnames.add(wq.getQName());
135: }
136: }
137: return qnames;
138: }
139:
140: private final QName qName;
141:
142: }
|