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.algorithms;
0N/A
0N/A
0N/A
0N/Aimport com.sun.org.apache.xml.internal.security.exceptions.XMLSecurityException;
0N/Aimport com.sun.org.apache.xml.internal.security.utils.Constants;
661N/Aimport com.sun.org.apache.xml.internal.security.utils.SignatureElementProxy;
0N/Aimport org.w3c.dom.Document;
0N/Aimport org.w3c.dom.Element;
0N/A
0N/A
0N/A/**
0N/A * The Algorithm class which stores the Algorithm URI as a string.
0N/A *
0N/A */
661N/Apublic abstract class Algorithm extends SignatureElementProxy {
0N/A
0N/A /**
0N/A *
0N/A * @param doc
0N/A * @param algorithmURI is the URI of the algorithm as String
0N/A */
0N/A public Algorithm(Document doc, String algorithmURI) {
0N/A
0N/A super(doc);
0N/A
0N/A this.setAlgorithmURI(algorithmURI);
0N/A }
0N/A
0N/A /**
0N/A * Constructor Algorithm
0N/A *
0N/A * @param element
0N/A * @param BaseURI
0N/A * @throws XMLSecurityException
0N/A */
0N/A public Algorithm(Element element, String BaseURI)
0N/A throws XMLSecurityException {
0N/A super(element, BaseURI);
0N/A }
0N/A
0N/A /**
0N/A * Method getAlgorithmURI
0N/A *
0N/A * @return The URI of the alogrithm
0N/A */
0N/A public String getAlgorithmURI() {
0N/A return this._constructionElement.getAttributeNS(null, Constants._ATT_ALGORITHM);
0N/A }
0N/A
0N/A /**
0N/A * Sets the algorithm's URI as used in the signature.
0N/A *
0N/A * @param algorithmURI is the URI of the algorithm as String
0N/A */
0N/A protected void setAlgorithmURI(String algorithmURI) {
0N/A
661N/A if ( (algorithmURI != null)) {
0N/A this._constructionElement.setAttributeNS(null, Constants._ATT_ALGORITHM,
0N/A algorithmURI);
0N/A }
0N/A }
0N/A}