Top Description Fields Constructors Methods
org.bouncycastle.cert.crmf.bc

public Class BcFixedLengthMGF1Padder

extends Object
implements EncryptedValuePadder
Class Inheritance
All Implemented Interfaces
org.bouncycastle.cert.crmf.EncryptedValuePadder
Imports
java.security.SecureRandom, org.bouncycastle.cert.crmf.EncryptedValuePadder, org.bouncycastle.crypto.Digest, org.bouncycastle.crypto.digests.SHA1Digest, org.bouncycastle.crypto.generators.MGF1BytesGenerator, org.bouncycastle.crypto.params.MGFParameters

An encrypted value padder that uses MGF1 as the basis of the padding.

Field Summary

Modifier and TypeField and Description
private Digest
private int
private SecureRandom

Constructor Summary

AccessConstructor and Description
public
BcFixedLengthMGF1Padder(int
fixed length for padded output.
length
)

Create a padder to so that padded output will always be at least length bytes long.

public
BcFixedLengthMGF1Padder(int
fixed length for padded output.
length
,
SecureRandom
a source of randomness.
random
)

Create a padder to so that padded output will always be at least length bytes long, using the passed in source of randomness to provide the random material for the padder.

Method Summary

Modifier and TypeMethod and Description
public byte[]
getPaddedData(byte[]
the data to be padded.
data
)

Implements org.bouncycastle.cert.crmf.EncryptedValuePadder.getPaddedData.

Return a byte array of padded data.
public byte[]
getUnpaddedData(byte[]
the data to be padded.
paddedData
)

Implements org.bouncycastle.cert.crmf.EncryptedValuePadder.getUnpaddedData.

Return a byte array of with padding removed.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

digback to summary
private Digest dig
lengthback to summary
private int length
randomback to summary
private SecureRandom random

Constructor Detail

BcFixedLengthMGF1Padderback to summary
public BcFixedLengthMGF1Padder(int length)

Create a padder to so that padded output will always be at least length bytes long.

Parameters
length:int

fixed length for padded output.

BcFixedLengthMGF1Padderback to summary
public BcFixedLengthMGF1Padder(int length, SecureRandom random)

Create a padder to so that padded output will always be at least length bytes long, using the passed in source of randomness to provide the random material for the padder.

Parameters
length:int

fixed length for padded output.

random:SecureRandom

a source of randomness.

Method Detail

getPaddedDataback to summary
public byte[] getPaddedData(byte[] data)

Implements org.bouncycastle.cert.crmf.EncryptedValuePadder.getPaddedData.

Doc from org.bouncycastle.cert.crmf.EncryptedValuePadder.getPaddedData.

Return a byte array of padded data.

Parameters
data:byte[]

the data to be padded.

Returns:byte[]

a padded byte array containing data.

getUnpaddedDataback to summary
public byte[] getUnpaddedData(byte[] paddedData)

Implements org.bouncycastle.cert.crmf.EncryptedValuePadder.getUnpaddedData.

Doc from org.bouncycastle.cert.crmf.EncryptedValuePadder.getUnpaddedData.

Return a byte array of with padding removed.

Parameters
paddedData:byte[]

the data to be padded.

Returns:byte[]

an array containing the original unpadded data.