0N/A/*
0N/A * reserved comment block
0N/A * DO NOT REMOVE OR ALTER!
0N/A */
0N/A/*
0N/A * Copyright 1999-2004 The Apache Software Foundation.
0N/A *
0N/A * Licensed under the Apache License, Version 2.0 (the "License");
0N/A * you may not use this file except in compliance with the License.
0N/A * You may obtain a copy of the License at
0N/A *
0N/A * http://www.apache.org/licenses/LICENSE-2.0
0N/A *
0N/A * Unless required by applicable law or agreed to in writing, software
0N/A * distributed under the License is distributed on an "AS IS" BASIS,
0N/A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
0N/A * See the License for the specific language governing permissions and
0N/A * limitations under the License.
0N/A *
0N/A */
0N/Apackage com.sun.org.apache.xml.internal.security.utils;
0N/A
0N/Aimport com.sun.org.apache.xml.internal.security.exceptions.XMLSecurityException;
0N/A
0N/A/**
0N/A * Provides all constants and some translation functions for i18n.
0N/A *
0N/A * For the used Algorithm identifiers and Namespaces, look at the
0N/A * <A HREF="http://www.w3.org/TR/xmldsig-core/#sec-TransformAlg">XML
0N/A * Signature specification</A>.
0N/A *
661N/A * @author $Author: mullan $
0N/A */
0N/Apublic class Constants {
0N/A
0N/A /** Field configurationFile */
0N/A public static final String configurationFile = "data/websig.conf";
0N/A
0N/A /** Field configurationFileNew */
0N/A public static final String configurationFileNew = ".xmlsecurityconfig";
0N/A
0N/A /** Field exceptionMessagesResourceBundleDir */
0N/A public static final String exceptionMessagesResourceBundleDir =
0N/A "com/sun/org/apache/xml/internal/security/resource";
0N/A
0N/A /** Field exceptionMessagesResourceBundleBase is the location of the <CODE>ResourceBundle</CODE> */
0N/A public static final String exceptionMessagesResourceBundleBase =
0N/A exceptionMessagesResourceBundleDir + "/" + "xmlsecurity";
0N/A //J-
0N/A /**
0N/A * The URL of the <A HREF="http://www.w3.org/TR/2001/CR-xmldsig-core-20010419/">XML Signature specification</A>
0N/A */
0N/A public static final String SIGNATURESPECIFICATION_URL = "http://www.w3.org/TR/2001/CR-xmldsig-core-20010419/";
0N/A
0N/A /**
0N/A * The namespace of the <A HREF="http://www.w3.org/TR/2001/CR-xmldsig-core-20010419/">XML Signature specification</A>
0N/A */
0N/A public static final String SignatureSpecNS = "http://www.w3.org/2000/09/xmldsig#";
0N/A /** The URL for more algorithm **/
0N/A public static final String MoreAlgorithmsSpecNS = "http://www.w3.org/2001/04/xmldsig-more#";
0N/A /** The URI for XML spec*/
0N/A public static final String XML_LANG_SPACE_SpecNS = "http://www.w3.org/XML/1998/namespace";
0N/A /** The URI for XMLNS spec*/
0N/A public static final String NamespaceSpecNS = "http://www.w3.org/2000/xmlns/";
0N/A
0N/A /** Tag of Attr Algorithm**/
0N/A public static final String _ATT_ALGORITHM = "Algorithm";
0N/A /** Tag of Attr URI**/
0N/A public static final String _ATT_URI = "URI";
0N/A /** Tag of Attr Type**/
0N/A public static final String _ATT_TYPE = "Type";
0N/A /** Tag of Attr Id**/
0N/A public static final String _ATT_ID = "Id";
0N/A /** Tag of Attr MimeType**/
0N/A public static final String _ATT_MIMETYPE = "MimeType";
0N/A /** Tag of Attr Encoding**/
0N/A public static final String _ATT_ENCODING = "Encoding";
0N/A /** Tag of Attr Target**/
0N/A public static final String _ATT_TARGET = "Target";
0N/A
0N/A // KeyInfo (KeyName|KeyValue|RetrievalMethod|X509Data|PGPData|SPKIData|MgmtData)
0N/A // KeyValue (DSAKeyValue|RSAKeyValue)
0N/A // DSAKeyValue (P, Q, G, Y, J?, (Seed, PgenCounter)?)
0N/A // RSAKeyValue (Modulus, Exponent)
0N/A // RetrievalMethod (Transforms?)
0N/A // X509Data ((X509IssuerSerial | X509SKI | X509SubjectName | X509Certificate)+ | X509CRL)
0N/A // X509IssuerSerial (X509IssuerName, X509SerialNumber)
0N/A // PGPData ((PGPKeyID, PGPKeyPacket?) | (PGPKeyPacket))
0N/A // SPKIData (SPKISexp)
0N/A
0N/A /** Tag of Element CanonicalizationMethod **/
0N/A public static final String _TAG_CANONICALIZATIONMETHOD = "CanonicalizationMethod";
0N/A /** Tag of Element DigestMethod **/
0N/A public static final String _TAG_DIGESTMETHOD = "DigestMethod";
0N/A /** Tag of Element DigestValue **/
0N/A public static final String _TAG_DIGESTVALUE = "DigestValue";
0N/A /** Tag of Element Manifest **/
0N/A public static final String _TAG_MANIFEST = "Manifest";
0N/A /** Tag of Element Methods **/
0N/A public static final String _TAG_METHODS = "Methods";
0N/A /** Tag of Element Object **/
0N/A public static final String _TAG_OBJECT = "Object";
0N/A /** Tag of Element Reference **/
0N/A public static final String _TAG_REFERENCE = "Reference";
0N/A /** Tag of Element Signature **/
0N/A public static final String _TAG_SIGNATURE = "Signature";
0N/A /** Tag of Element SignatureMethod **/
0N/A public static final String _TAG_SIGNATUREMETHOD = "SignatureMethod";
0N/A /** Tag of Element HMACOutputLength **/
0N/A public static final String _TAG_HMACOUTPUTLENGTH = "HMACOutputLength";
0N/A /** Tag of Element SignatureProperties **/
0N/A public static final String _TAG_SIGNATUREPROPERTIES = "SignatureProperties";
0N/A /** Tag of Element SignatureProperty **/
0N/A public static final String _TAG_SIGNATUREPROPERTY = "SignatureProperty";
0N/A /** Tag of Element SignatureValue **/
0N/A public static final String _TAG_SIGNATUREVALUE = "SignatureValue";
0N/A /** Tag of Element SignedInfo **/
0N/A public static final String _TAG_SIGNEDINFO = "SignedInfo";
0N/A /** Tag of Element Transform **/
0N/A public static final String _TAG_TRANSFORM = "Transform";
0N/A /** Tag of Element Transforms **/
0N/A public static final String _TAG_TRANSFORMS = "Transforms";
0N/A /** Tag of Element XPath **/
0N/A public static final String _TAG_XPATH = "XPath";
0N/A /** Tag of Element KeyInfo **/
0N/A public static final String _TAG_KEYINFO = "KeyInfo";
0N/A /** Tag of Element KeyName **/
0N/A public static final String _TAG_KEYNAME = "KeyName";
0N/A /** Tag of Element KeyValue **/
0N/A public static final String _TAG_KEYVALUE = "KeyValue";
0N/A /** Tag of Element RetrievalMethod **/
0N/A public static final String _TAG_RETRIEVALMETHOD = "RetrievalMethod";
0N/A /** Tag of Element X509Data **/
0N/A public static final String _TAG_X509DATA = "X509Data";
0N/A /** Tag of Element PGPData **/
0N/A public static final String _TAG_PGPDATA = "PGPData";
0N/A /** Tag of Element SPKIData **/
0N/A public static final String _TAG_SPKIDATA = "SPKIData";
0N/A /** Tag of Element MgmtData **/
0N/A public static final String _TAG_MGMTDATA = "MgmtData";
0N/A /** Tag of Element RSAKeyValue **/
0N/A public static final String _TAG_RSAKEYVALUE = "RSAKeyValue";
0N/A /** Tag of Element Exponent **/
0N/A public static final String _TAG_EXPONENT = "Exponent";
0N/A /** Tag of Element Modulus **/
0N/A public static final String _TAG_MODULUS = "Modulus";
0N/A /** Tag of Element DSAKeyValue **/
0N/A public static final String _TAG_DSAKEYVALUE = "DSAKeyValue";
0N/A /** Tag of Element P **/
0N/A public static final String _TAG_P = "P";
0N/A /** Tag of Element Q **/
0N/A public static final String _TAG_Q = "Q";
0N/A /** Tag of Element G **/
0N/A public static final String _TAG_G = "G";
0N/A /** Tag of Element Y **/
0N/A public static final String _TAG_Y = "Y";
0N/A /** Tag of Element J **/
0N/A public static final String _TAG_J = "J";
0N/A /** Tag of Element Seed **/
0N/A public static final String _TAG_SEED = "Seed";
0N/A /** Tag of Element PgenCounter **/
0N/A public static final String _TAG_PGENCOUNTER = "PgenCounter";
0N/A /** Tag of Element rawX509Certificate **/
0N/A public static final String _TAG_RAWX509CERTIFICATE = "rawX509Certificate";
0N/A /** Tag of Element X509IssuerSerial **/
0N/A public static final String _TAG_X509ISSUERSERIAL = "X509IssuerSerial";
0N/A /** Tag of Element X509SKI **/
0N/A public static final String _TAG_X509SKI = "X509SKI";
0N/A /** Tag of Element X509SubjectName **/
0N/A public static final String _TAG_X509SUBJECTNAME = "X509SubjectName";
0N/A /** Tag of Element X509Certificate **/
0N/A public static final String _TAG_X509CERTIFICATE = "X509Certificate";
0N/A /** Tag of Element X509CRL **/
0N/A public static final String _TAG_X509CRL = "X509CRL";
0N/A /** Tag of Element X509IssuerName **/
0N/A public static final String _TAG_X509ISSUERNAME = "X509IssuerName";
0N/A /** Tag of Element X509SerialNumber **/
0N/A public static final String _TAG_X509SERIALNUMBER = "X509SerialNumber";
0N/A /** Tag of Element PGPKeyID **/
0N/A public static final String _TAG_PGPKEYID = "PGPKeyID";
0N/A /** Tag of Element PGPKeyPacket **/
0N/A public static final String _TAG_PGPKEYPACKET = "PGPKeyPacket";
0N/A /** Tag of Element SPKISexp **/
0N/A public static final String _TAG_SPKISEXP = "SPKISexp";
0N/A
0N/A /** Digest - Required SHA1 */
0N/A public static final String ALGO_ID_DIGEST_SHA1 = SignatureSpecNS + "sha1";
0N/A
0N/A /**
0N/A * @see <A HREF="http://www.ietf.org/internet-drafts/draft-blake-wilson-xmldsig-ecdsa-02.txt">
0N/A * draft-blake-wilson-xmldsig-ecdsa-02.txt</A>
0N/A */
0N/A public static final String ALGO_ID_SIGNATURE_ECDSA_CERTICOM = "http://www.certicom.com/2000/11/xmlecdsig#ecdsa-sha1";
0N/A //J+
0N/A
0N/A private Constants() {
0N/A // we don't allow instantiation
0N/A }
0N/A
0N/A /**
0N/A * Sets the namespace prefix which will be used to identify elements in the
0N/A * XML Signature Namespace.
0N/A *
0N/A * <pre>
0N/A * Constants.setSignatureSpecNSprefix("dsig");
0N/A * </pre>
0N/A *
0N/A * @param newPrefix is the new namespace prefix.
0N/A * @throws XMLSecurityException
0N/A * @see com.sun.org.apache.xml.internal.security.utils.Constants#getSignatureSpecNSprefix
0N/A * $todo$ Add consistency checking for valid prefix
0N/A */
0N/A public static void setSignatureSpecNSprefix(String newPrefix) throws XMLSecurityException {
0N/A ElementProxy.setDefaultPrefix(Constants.SignatureSpecNS, newPrefix);
0N/A }
0N/A
0N/A /**
0N/A * Returns the XML namespace prefix which is used for elements in the XML
0N/A * Signature namespace.
0N/A *
0N/A * It is defaulted to <code>dsig</code>, but can be changed using the
0N/A * {@link #setSignatureSpecNSprefix} function.
0N/A *
0N/A * @return the current used namespace prefix
0N/A * @see #setSignatureSpecNSprefix
0N/A */
0N/A public static String getSignatureSpecNSprefix() {
0N/A return ElementProxy.getDefaultPrefix(Constants.SignatureSpecNS);
0N/A }
0N/A}