Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Cryptix V3.1
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## java.security
Interface Padding

All Known Implementing Classes:
  PaddingScheme

public interface Padding

Padding is the interface defined by JavaSoft's JCE to be implemented by classes that provide a general-purpose padding scheme. It is not used in IJCE, for several reasons:

- Interfaces are more difficult to extend with new functionality than abstract classes (for an abstract class, new methods can be given default implementations that are defined in terms of existing methods).

- An abstract class can enforce that SPI methods are called with valid arguments; an interface cannot.

- The Padding interface does not support arbitrary block sizes. Each padding scheme must be defined for a specific block size.

- The documentation for Padding was not clear enough to re-implement accurately.

- The Security.getImpl method in JavaSoft's implementation of JCE does not work correctly for interfaces.

This interface is included in IJCE only so that classes that use it will not fail with an unrecoverable linking error. The abstract class PaddingScheme should be used instead.

Copyright © 1997 Systemics Ltd on behalf of the Cryptix Development Team.
All rights reserved.

$Revision: 1.1.1.1 $

Since:
  IJCE 1.0.0
Author:
  David Hopwood
See Also:
  `PaddingScheme`

Method Summary
`int` | `pad(byte[] in, int off, int len)` Deprecated. Pads a given array of bytes.
`String` | `paddingScheme()` Deprecated. Returns the standard name of the padding scheme implemented.
`int` | `padLength(int len)` Deprecated. Returns the absolute value of the increase in size that a padding operation would cause on input data of a given length.
`int` | `unpad(byte[] in, int off, int len)` Deprecated. Given the specified subarray of bytes that includes padding bytes, returns the index indicating where padding starts.

Method Detail

### pad

    public int pad(byte[] in,
                   int off,
                   int len)

  Deprecated.
  Pads a given array of bytes. The padded bytes are written to the same buffer that is used for input ("in").
  Parameters:
    `in` - the buffer containing the bytes.
    `off` - the offset into the `in` buffer of the first byte in the group of bytes to be padded.
    `len` - the number of bytes from the `in` buffer, starting at `off`, that need to be padded.
  Returns:
    the number of padding bytes written.
  See Also:
    `Cipher.blockSize()`

### unpad

    public int unpad(byte[] in,
                     int off,
                     int len)

  Deprecated.
  Given the specified subarray of bytes that includes padding bytes, returns the index indicating where padding starts.
  Parameters:
    `in` - the buffer containing the bytes.
    `off` - the starting offset into the `in` buffer of the bytes to be checked to determine where padding starts.
    `len` - the number of bytes from the `in` buffer to check, starting at offset `off`.
  Returns:
    the index into the `in` buffer indicating where the padding starts.

### padLength

    public int padLength(int len)

  Deprecated.
  Returns the absolute value of the increase in size that a padding operation would cause on input data of a given length.
  Parameters:
    `len` - the length of the data which is to be padded.
  Returns:
    the absolute value of the increase in size that a padding operation would cause on input data of the specified length.

### paddingScheme

    public String paddingScheme()

  Deprecated.
  Returns the standard name of the padding scheme implemented.

  See International JCE Standard Algorithm Names for a list of PaddingScheme algorithm names.

  Returns:
    the standard name of the padding scheme, such as "PKCS#5".

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Cryptix V3.1
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright (C) 1995-2000 The Cryptix Foundation Ltd. All rights reserved.