View Javadoc
1   /*
2    * Licensed to the Apache Software Foundation (ASF) under one
3    * or more contributor license agreements.  See the NOTICE file
4    * distributed with this work for additional information
5    * regarding copyright ownership.  The ASF licenses this file
6    * to you under the Apache License, Version 2.0 (the
7    * "License"); you may not use this file except in compliance
8    * with the License.  You may obtain a copy of the License at
9    *
10   *     http://www.apache.org/licenses/LICENSE-2.0
11   *
12   * Unless required by applicable law or agreed to in writing, software
13   * distributed under the License is distributed on an "AS IS" BASIS,
14   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15   * See the License for the specific language governing permissions and
16   * limitations under the License.
17   */
18  
19  package org.apache.commons.crypto.cipher;
20  
21  import java.io.IOException;
22  import java.nio.ByteBuffer;
23  import java.security.InvalidAlgorithmParameterException;
24  import java.security.InvalidKeyException;
25  import java.security.Key;
26  import java.security.spec.AlgorithmParameterSpec;
27  
28  import javax.crypto.BadPaddingException;
29  import javax.crypto.IllegalBlockSizeException;
30  import javax.crypto.ShortBufferException;
31  
32  /**
33   * Tests default methods.
34   */
35  public class DefaultCryptoCipher implements CryptoCipher {
36  
37      @Override
38      public void close() throws IOException {
39          // Simplest
40  
41      }
42  
43      @Override
44      public int doFinal(final byte[] input, final int inputOffset, final int inputLen, final byte[] output, final int outputOffset)
45              throws ShortBufferException, IllegalBlockSizeException, BadPaddingException {
46          // Simplest
47          return 0;
48      }
49  
50      @Override
51      public int doFinal(final ByteBuffer inBuffer, final ByteBuffer outBuffer) throws ShortBufferException, IllegalBlockSizeException, BadPaddingException {
52          // Simplest
53          return 0;
54      }
55  
56      @Override
57      public String getAlgorithm() {
58          // Simplest
59          return null;
60      }
61  
62      @Override
63      public int getBlockSize() {
64          // Simplest
65          return 0;
66      }
67  
68      @Override
69      public void init(final int mode, final Key key, final AlgorithmParameterSpec params) throws InvalidKeyException, InvalidAlgorithmParameterException {
70          // Simplest
71  
72      }
73  
74      @Override
75      public int update(final byte[] input, final int inputOffset, final int inputLen, final byte[] output, final int outputOffset) throws ShortBufferException {
76          // Simplest
77          return 0;
78      }
79  
80      @Override
81      public int update(final ByteBuffer inBuffer, final ByteBuffer outBuffer) throws ShortBufferException {
82          // Simplest
83          return 0;
84      }
85  
86  }