FileDocCategorySizeDatePackage
NullCipherSpi.javaAPI DocAndroid 1.5 API5578Wed May 06 22:41:02 BST 2009org.apache.harmony.crypto.internal

NullCipherSpi

public class NullCipherSpi extends CipherSpi
CipherSpi implementation for javax.crypto.NullCipher

Fields Summary
Constructors Summary
Methods Summary
public byte[]engineDoFinal(byte[] input, int inputOffset, int inputLen)

        if (input == null) {
            return null;
        }
        return engineUpdate(input, inputOffset, inputLen);
    
public intengineDoFinal(byte[] input, int inputOffset, int inputLen, byte[] output, int outputOffset)

        int result = engineUpdate(input, inputOffset, inputLen, output,
                outputOffset);
        return result;
    
public intengineDoFinal(java.nio.ByteBuffer input, java.nio.ByteBuffer output)

        return engineUpdate(input, output);
    
public intengineGetBlockSize()

        return 1;
    
public byte[]engineGetIV()

        return new byte[8]; // compatible with RI
    
public intengineGetKeySize(java.security.Key key)

        throw new UnsupportedOperationException(Messages.getString("crypto.46")); //$NON-NLS-1$
    
public intengineGetOutputSize(int inputLen)

        return inputLen;
    
public java.security.AlgorithmParametersengineGetParameters()

        return null;
    
public voidengineInit(int opmode, java.security.Key key, java.security.SecureRandom random)

        // Do nothing
    
public voidengineInit(int opmode, java.security.Key key, java.security.spec.AlgorithmParameterSpec params, java.security.SecureRandom random)

        // Do nothing
    
public voidengineInit(int opmode, java.security.Key key, java.security.AlgorithmParameters params, java.security.SecureRandom random)

        // Do nothing
    
public voidengineSetMode(java.lang.String arg0)

        // Do nothing
    
public voidengineSetPadding(java.lang.String arg0)

        // Do nothing
    
public java.security.KeyengineUnwrap(byte[] wrappedKey, java.lang.String wrappedKeyAlgorithm, int wrappedKeyType)

        throw new UnsupportedOperationException(Messages.getString("crypto.45")); //$NON-NLS-1$
    
public byte[]engineUpdate(byte[] input, int inputOffset, int inputLen)

        if (input == null) {
            return null;
        }
        byte[] result = new byte[inputLen];
        System.arraycopy(input, inputOffset, result, 0, inputLen);
        return result;
    
public intengineUpdate(byte[] input, int inputOffset, int inputLen, byte[] output, int outputOffset)

        if (input == null) {
            return 0;
        }
        System.arraycopy(input, inputOffset, output, outputOffset, inputLen);
        return inputLen;
    
public intengineUpdate(java.nio.ByteBuffer input, java.nio.ByteBuffer output)

        if (input == null || output == null) {
            throw new NullPointerException();
        }
        int result = input.limit() - input.position();
        try {
            output.put(input);
        } catch (java.nio.BufferOverflowException e) {
            throw new ShortBufferException(Messages.getString("crypto.0F", e)); //$NON-NLS-1$
        }
        return result;
    
public byte[]engineWrap(java.security.Key key)

        throw new UnsupportedOperationException(Messages.getString("crypto.44")); //$NON-NLS-1$