001package org.apache.fulcrum.crypto.provider;
002
003/*
004 * Licensed to the Apache Software Foundation (ASF) under one
005 * or more contributor license agreements.  See the NOTICE file
006 * distributed with this work for additional information
007 * regarding copyright ownership.  The ASF licenses this file
008 * to you under the Apache License, Version 2.0 (the
009 * "License"); you may not use this file except in compliance
010 * with the License.  You may obtain a copy of the License at
011 *
012 *   http://www.apache.org/licenses/LICENSE-2.0
013 *
014 * Unless required by applicable law or agreed to in writing,
015 * software distributed under the License is distributed on an
016 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
017 * KIND, either express or implied.  See the License for the
018 * specific language governing permissions and limitations
019 * under the License.
020 */
021
022import org.apache.fulcrum.crypto.CryptoAlgorithm;
023
024/**
025 * This is a dummy for "cleartext" encryption. It goes through the notions of
026 * the CryptoAlgorithm interface but actually does nothing. It can be used as a
027 * replacement for the "encrypt = no" setting in TurbineResources.
028 *
029 * Can be used as the default crypto algorithm
030 *
031 * @author <a href="mailto:hps@intermeta.de">Henning P. Schmiedehausen</a>
032 * @version $Id: ClearCrypt.java 1852158 2019-01-25 18:19:46Z painter $
033 */
034public class ClearCrypt implements CryptoAlgorithm {
035        
036        /**
037         * Constructor
038         */
039        public ClearCrypt() 
040        {
041        }
042
043        /**
044         * This class never uses an algorithm, so this is just a dummy.
045         *
046         * @param cipher Cipher (ignored)
047         */
048        public void setCipher(String cipher) 
049        {
050        }
051
052        /**
053         * This class never uses a seed, so this is just a dummy.
054         *
055         * @param seed Seed (ignored)
056         */
057        public void setSeed(String seed) 
058        {
059        }
060
061        /**
062         * This method performs no encryption and will simply
063         * return the value passed
064         *
065         * @param value The value to be encrypted
066         * @return The original value
067         * @throws Exception An Exception of the underlying implementation.
068         */
069        public String encrypt(String value) throws Exception 
070        {
071                return value;
072        }
073}