Top Description Constructors Methods
org.bouncycastle.crypto.internal.paddings

public Class PKCS7Padding

extends Object
implements BlockCipherPadding
Class Inheritance
All Implemented Interfaces
org.bouncycastle.crypto.internal.paddings.BlockCipherPadding
Imports
java.security.SecureRandom, org.bouncycastle.crypto.internal.InvalidCipherTextException

A padder that adds PKCS7/PKCS5 padding to a block.

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public int
addPadding(byte[] in, int inOff)

Implements org.bouncycastle.crypto.internal.paddings.BlockCipherPadding.addPadding.

add the pad bytes to the passed in block, returning the number of bytes added.
public String

Returns:

the name of the algorithm the padder implements.
getPaddingName
()

Implements org.bouncycastle.crypto.internal.paddings.BlockCipherPadding.getPaddingName.

Return the name of the algorithm the padder implements.
public void
init(SecureRandom
- a SecureRandom if available.
random
)

Implements org.bouncycastle.crypto.internal.paddings.BlockCipherPadding.init.

Initialise the padder.
public int
padCount(byte[] in)

Implements org.bouncycastle.crypto.internal.paddings.BlockCipherPadding.padCount.

return the number of pad bytes present in the block
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

PKCS7Paddingback to summary
public PKCS7Padding()

Method Detail

addPaddingback to summary
public int addPadding(byte[] in, int inOff)

Implements org.bouncycastle.crypto.internal.paddings.BlockCipherPadding.addPadding.

add the pad bytes to the passed in block, returning the number of bytes added.

getPaddingNameback to summary
public String getPaddingName()

Implements org.bouncycastle.crypto.internal.paddings.BlockCipherPadding.getPaddingName.

Return the name of the algorithm the padder implements.

Returns:String

the name of the algorithm the padder implements.

initback to summary
public void init(SecureRandom random) throws IllegalArgumentException

Implements org.bouncycastle.crypto.internal.paddings.BlockCipherPadding.init.

Initialise the padder.

Parameters
random:SecureRandom

- a SecureRandom if available.

padCountback to summary
public int padCount(byte[] in) throws InvalidCipherTextException

Implements org.bouncycastle.crypto.internal.paddings.BlockCipherPadding.padCount.

return the number of pad bytes present in the block

Exceptions
InvalidCipherTextException:

Doc from org.bouncycastle.crypto.internal.paddings.BlockCipherPadding.padCount.

if the padding is badly formed or invalid.