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 Development
008: * and Distribution License("CDDL") (collectively, the "License"). You
009: * may not use this file except in compliance with the License. You can obtain
010: * a copy of the License at https://glassfish.dev.java.net/public/CDDL+GPL.html
011: * or glassfish/bootstrap/legal/LICENSE.txt. See the License for the specific
012: * language governing permissions and limitations under the License.
013: *
014: * When distributing the software, include this License Header Notice in each
015: * file and include the License file at glassfish/bootstrap/legal/LICENSE.txt.
016: * Sun designates this particular file as subject to the "Classpath" exception
017: * as provided by Sun in the GPL Version 2 section of the License file that
018: * accompanied this code. If applicable, add the following below the License
019: * Header, with the fields enclosed by brackets [] replaced by your own
020: * identifying information: "Portions Copyrighted [year]
021: * [name of copyright owner]"
022: *
023: * Contributor(s):
024: *
025: * If you wish your version of this file to be governed by only the CDDL or
026: * only the GPL Version 2, indicate your decision by adding "[Contributor]
027: * elects to include this software in this distribution under the [CDDL or GPL
028: * Version 2] license." If you don't indicate a single choice of license, a
029: * recipient has the option to distribute your version of this file under
030: * either the CDDL, the GPL Version 2 or to extend the choice of license to
031: * its licensees as provided above. However, if you add GPL Version 2 code
032: * and therefore, elected the GPL Version 2 license, then the option applies
033: * only if the new code is made subject to such option by the copyright
034: * holder.
035: */
036: package com.sun.xml.ws.security.impl.policy;
037:
038: import com.sun.xml.ws.policy.PolicyAssertion;
039: import java.util.logging.Level;
040: import java.util.logging.Logger;
041:
042: public class Constants {
043:
044: //Namespace constants
045: public final static String SECURITY_POLICY_NS = "http://schemas.xmlsoap.org/ws/2005/07/securitypolicy";
046: public final static String ADDRESSING_NS = "http://schemas.xmlsoap.org/ws/2004/08/addressing";
047: public final static String XPATH_NS = "http://www.w3.org/TR/1999/REC-xpath-19991116";
048: public final static String TRUST_NS = "http://schemas.xmlsoap.org/ws/2005/02/trust";
049: public final static String UTILITY_NS = "http://docs.oasis-open.org/wss/2004/01/oasis- 200401-wss-wssecurity-utility-1.0.xsd";
050: public final static String _XPATHVERSION = "XPathVersion";
051: public final static String InclusiveC14N = "InclusiveC14N";
052: public final static String InclusiveC14NWithComments = "InclusiveC14NWithComments";
053: public final static String InclusiveC14NWithCommentsForTransforms = "InclusiveC14NWithCommentsForTransforms";
054: public final static String InclusiveC14NWithCommentsForCm = "InclusiveC14NWithCommentsForCm";
055: public final static String ExclusiveC14NWithComments = "ExclusiveC14NWithComments";
056: public final static String ExclusiveC14NWithCommentsForTransforms = "ExclusiveC14NWithCommentsForTransforms";
057: public final static String ExclusiveC14NWithCommentsForCm = "ExclusiveC14NWithCommentsForCm";
058: public final static String MustSupportServerChallenge = "MustSupportServerChallenge";
059: public final static String Basic192Sha256Rsa15 = "Basic192Sha256Rsa15";
060: public final static String STRTransform10 = "STRTransform10";
061: public final static String WssX509PkiPathV1Token11 = "WssX509PkiPathV1Token11";
062: public final static String WssUsernameToken11 = "WssUsernameToken11";
063: public final static String Basic128 = "Basic128";
064: public final static String IssuedToken = "IssuedToken";
065: public final static String ProtectTokens = "ProtectTokens";
066: public final static String Basic256Sha256Rsa15 = "Basic256Sha256Rsa15";
067: public final static String WssGssKerberosV5ApReqToken11 = "WssGssKerberosV5ApReqToken11";
068: public final static String EncryptBeforeSigning = "EncryptBeforeSigning";
069: public final static String SignBeforeEncrypting = "SignBeforeEncrypting";
070: public final static String WssX509V3Token10 = "WssX509V3Token10";
071: public final static String SpnegoContextToken = "SpnegoContextToken";
072: public final static String EncryptSignature = "EncryptSignature";
073: public final static String SignedParts = "SignedParts";
074: public final static String EndorsingSupportingTokens = "EndorsingSupportingTokens";
075: public final static String MustSupportIssuedTokens = "MustSupportIssuedTokens";
076: public final static String WssX509PkiPathV1Token10 = "WssX509PkiPathV1Token10";
077: public final static String MustSupportRefEncryptedKey = "MustSupportRefEncryptedKey";
078: public final static String RequiredElements = "RequiredElements";
079: public final static String SOAPNormalization10 = "SOAPNormalization10";
080: public final static String WssSamlV11Token11 = "WssSamlV11Token11";
081: public final static String Basic128Sha256Rsa15 = "Basic128Sha256Rsa15";
082: public final static String MustSupportRefKeyIdentifier = "MustSupportRefKeyIdentifier";
083: public final static String RequireExternalUriReference = "RequireExternalUriReference";
084: public final static String SamlToken = "SamlToken";
085: public final static String RelToken = "RelToken";
086: public final static String RequireInternalReference = "RequireInternalReference";
087: public final static String Basic256Rsa15 = "Basic256Rsa15";
088: public final static String SignatureToken = "SignatureToken";
089: public final static String MustSupportClientChallenge = "MustSupportClientChallenge";
090: public final static String SignedEndorsingSupportingTokens = "SignedEndorsingSupportingTokens";
091: public final static String WssKerberosV5ApReqToken11 = "WssKerberosV5ApReqToken11";
092: public final static String Basic192Rsa15 = "Basic192Rsa15";
093: public final static String TripleDesRsa15 = "TripleDesRsa15";
094: public final static String Trust10 = "Trust10";
095: public final static String RequireClientEntropy = "RequireClientEntropy";
096: public final static String RequireDerivedKeys = "RequireDerivedKeys";
097: public final static String Strict = "Strict";
098: public final static String RequireKeyIdentifierReference = "RequireKeyIdentifierReference";
099: public final static String LaxTsFirst = "LaxTsFirst";
100: public final static String SecureConversationToken = "SecureConversationToken";
101: public final static String RequireThumbprintReference = "RequireThumbprintReference";
102: public final static String XPathFilter20 = "XPathFilter20";
103: public final static String HttpsToken = "HttpsToken";
104: public final static String SignedElements = "SignedElements";
105: public final static String WssX509Pkcs7Token10 = "WssX509Pkcs7Token10";
106: public final static String Wss10 = "Wss10";
107: public final static String MustSupportRefExternalURI = "MustSupportRefExternalURI";
108: public final static String TransportToken = "TransportToken";
109: public final static String MustSupportRefEmbeddedToken = "MustSupportRefEmbeddedToken";
110: public final static String Wss11 = "Wss11";
111: public final static String EncryptedElements = "EncryptedElements";
112: public final static String WssSamlV11Token10 = "WssSamlV11Token10";
113: public final static String TripleDesSha256 = "TripleDesSha256";
114: public final static String WssRelV10Token11 = "WssRelV10Token11";
115: public final static String SignedSupportingTokens = "SignedSupportingTokens";
116: public final static String SecurityContextToken = "SecurityContextToken";
117: public final static String Basic256Sha256 = "Basic256Sha256";
118: public final static String UsernameToken = "UsernameToken";
119: public final static String OnlySignEntireHeadersAndBody = "OnlySignEntireHeadersAndBody";
120: public final static String InitiatorToken = "InitiatorToken";
121: public final static String WssSamlV20Token11 = "WssSamlV20Token11";
122: public final static String WssSamlV10Token11 = "WssSamlV10Token11";
123: public final static String Basic256 = "Basic256";
124: public final static String WssRelV10Token10 = "WssRelV10Token10";
125: public final static String ProtectionToken = "ProtectionToken";
126: public final static String BootstrapPolicy = "BootstrapPolicy";
127: public final static String SC10SecurityContextToken = "SC10SecurityContextToken";
128: public final static String KerberosToken = "KerberosToken";
129: public final static String WssRelV20Token10 = "WssRelV20Token10";
130: public final static String LaxTsLast = "LaxTsLast";
131: public final static String RequireServerEntropy = "RequireServerEntropy";
132: public final static String RequireExternalReference = "RequireExternalReference";
133: public final static String RequireSignatureConfirmation = "RequireSignatureConfirmation";
134: public final static String Basic128Rsa15 = "Basic128Rsa15";
135: public final static String AsymmetricBinding = "AsymmetricBinding";
136: public final static String IncludeTimestamp = "IncludeTimestamp";
137: public final static String DisableTimestampSigning = "DisableTimestampSigning";
138: public final static String RequireEmbeddedTokenReference = "RequireEmbeddedTokenReference";
139: public final static String MustSupportRefThumbprint = "MustSupportRefThumbprint";
140: public final static String Basic192 = "Basic192";
141: public final static String WssX509Pkcs7Token11 = "WssX509Pkcs7Token11";
142: public final static String WssSamlV10Token10 = "WssSamlV10Token10";
143: public final static String Basic128Sha256 = "Basic128Sha256";
144: public final static String TripleDesSha256Rsa15 = "TripleDesSha256Rsa15";
145: public final static String WssUsernameToken10 = "WssUsernameToken10";
146: public final static String SymmetricBinding = "SymmetricBinding";
147: public final static String TripleDes = "TripleDes";
148: public final static String MustSupportRefIssuerSerial = "MustSupportRefIssuerSerial";
149: public final static String EncryptedParts = "EncryptedParts";
150: public final static String Basic192Sha256 = "Basic192Sha256";
151: public final static String AlgorithmSuite = "AlgorithmSuite";
152: public final static String WssRelV20Token11 = "WssRelV20Token11";
153: public final static String TransportBinding = "TransportBinding";
154: public final static String SupportingTokens = "SupportingTokens";
155: public final static String X509Token = "X509Token";
156: public final static String WssX509V1Token10 = "WssX509V1Token10";
157: public final static String WssX509V1Token11 = "WssX509V1Token11";
158: public final static String WssX509V3Token11 = "WssX509V3Token11";
159: public final static String RecipientToken = "RecipientToken";
160: public final static String EncryptionToken = "EncryptionToken";
161: public final static String Lax = "Lax";
162: public final static String Layout = "Layout";
163: public final static String RequireIssuerSerialReference = "RequireIssuerSerialReference";
164:
165: public final static String Body = "Body";
166:
167: public final static String HEADER = "Header";
168: public final static String RequestSecurityTokenTemplate = "RequestSecurityTokenTemplate";
169: public final static String EndpointReference = "EndpointReference";
170: public final static String IncludeToken = "IncludeToken";
171: public final static String XPath = "XPath";
172: public final static String RequireClientCertificate = "RequireClientCertificate";
173: public final static String Claims = "Claims";
174: public final static String Entropy = "Entropy";
175: //Trust constants
176: public final static String KeyType = "KeyType";
177: public final static String KeySize = "KeySize";
178: public final static String UseKey = "UseKey";
179: public final static String Encryption = "Encryption";
180: public final static String ProofEncryption = "ProofEncryption";
181: public final static String Lifetime = "Lifetime";
182: public final static String Issuer = "Issuer";
183:
184: //Addressing constants
185: public final static String Address = "Address";
186:
187: //utility constants
188: public final static String Created = "Created";
189: public final static String Expires = "Expires";
190: public final static String SignWith = "SignWith";
191: public final static String EncryptWith = "EncryptWith";
192: public final static String TokenType = "TokenType";
193: public final static String RequestType = "RequestType";
194: public final static String RequestSecurityToken = "RequestSecurityToken";
195: public final static String OnBehalfOf = "OnBehalfOf";
196: public final static String AuthenticationType = "AuthenticationType";
197: public final static String CanonicalizationAlgorithm = "CanonicalizationAlgorithm";
198: public final static String SignatureAlgorithm = "SignatureAlgorithm";
199: public final static String EncryptionAlgorithm = "EncryptionAlgorithm";
200: public final static String ComputedKeyAlgorithm = "ComputedKeyAlgorithm";
201: public static final String WS_SECURITY_POLICY_DOMAIN = "javax.enterprise.resource.xml.webservices.security.policy";
202: public static final String WS_SECURITY_POLICY_PACKAGE_ROOT = "com.sun.xml.ws.security.impl.policy";
203: public static final String WS_SECURITY_POLICY_DOMAIN_BUNDLE = WS_SECURITY_POLICY_PACKAGE_ROOT
204: + ".LogStrings";
205: public static final Logger logger = Logger.getLogger(
206: Constants.WS_SECURITY_POLICY_DOMAIN,
207: Constants.WS_SECURITY_POLICY_DOMAIN_BUNDLE);
208:
209: public static final String SUN_WSS_SECURITY_CLIENT_POLICY_NS = "http://schemas.sun.com/2006/03/wss/client";
210: public static final String SUN_WSS_SECURITY_SERVER_POLICY_NS = "http://schemas.sun.com/2006/03/wss/server";
211:
212: public static final String SUN_TRUST_CLIENT_SECURITY_POLICY_NS = "http://schemas.sun.com/ws/2006/05/trust/client";
213: public static final String SUN_TRUST_SERVER_SECURITY_POLICY_NS = "http://schemas.sun.com/ws/2006/05/trust/server";
214: public static final String SUN_SECURE_CLIENT_CONVERSATION_POLICY_NS = "http://schemas.sun.com/ws/2006/05/sc/client";
215: public static final String SUN_SECURE_SERVER_CONVERSATION_POLICY_NS = "http://schemas.sun.com/ws/2006/05/sc/server";
216:
217: public static final String KeyStore = "KeyStore";
218: public static final String TrustStore = "TrustStore";
219: public static final String CallbackHandler = "CallbackHandler";
220: public static final String CallbackHandlerConfiguration = "CallbackHandlerConfiguration";
221: public static final String Validator = "Validator";
222: public static final String ValidatorConfiguration = "ValidatorConfiguration";
223: public static final String ReferenceParameters = "ReferenceParameters";
224: public static final String ReferenceProperties = "ReferenceProperties";
225: public final static String PortType = "PortType";
226: public final static String ServiceName = "ServiceName";
227: public final static String CertStore = "CertStore";
228: public final static String NoPassword = "NoPassword";
229: public final static String BSP10 = "BSP10";
230: public final static String SECURITY_POLICY_PACKAGE_DIR = "com.sun.xml.ws.security.impl.policy";
231:
232: public static void log_invalid_assertion(PolicyAssertion assertion,
233: boolean isServer, String parentAssertion) {
234: Level level = Level.SEVERE;
235: if (!isServer) {
236: level = Level.WARNING;
237: }
238: if (logger.isLoggable(level)) {
239: logger.log(level, LogStringsMessages
240: .SP_0100_INVALID_SECURITY_ASSERTION(assertion,
241: parentAssertion));
242: }
243: }
244: }
|