org.bouncycastle.cert.crmf.bc
Class BcFixedLengthMGF1Padder
java.lang.Object
|
+--org.bouncycastle.cert.crmf.bc.BcFixedLengthMGF1Padder
- All Implemented Interfaces:
- EncryptedValuePadder
- public class BcFixedLengthMGF1Padder
- extends java.lang.Object
- implements EncryptedValuePadder
An encrypted value padder that uses MGF1 as the basis of the padding.
Constructor Summary |
BcFixedLengthMGF1Padder(int length)
Create a padder to so that padded output will always be at least
length bytes long. |
BcFixedLengthMGF1Padder(int length,
java.security.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. |
Method Summary |
byte[] |
getPaddedData(byte[] data)
Return a byte array of padded data. |
byte[] |
getUnpaddedData(byte[] paddedData)
Return a byte array of with padding removed. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
BcFixedLengthMGF1Padder
public BcFixedLengthMGF1Padder(int length)
- Create a padder to so that padded output will always be at least
length bytes long.
- Parameters:
length
- fixed length for padded output.
BcFixedLengthMGF1Padder
public BcFixedLengthMGF1Padder(int length,
java.security.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
- fixed length for padded output.random
- a source of randomness.
getPaddedData
public byte[] getPaddedData(byte[] data)
- Description copied from interface:
EncryptedValuePadder
- Return a byte array of padded data.
- Specified by:
getPaddedData
in interface EncryptedValuePadder
- Following copied from interface:
org.bouncycastle.cert.crmf.EncryptedValuePadder
- Parameters:
data
- the data to be padded.- Returns:
- a padded byte array containing data.
getUnpaddedData
public byte[] getUnpaddedData(byte[] paddedData)
- Description copied from interface:
EncryptedValuePadder
- Return a byte array of with padding removed.
- Specified by:
getUnpaddedData
in interface EncryptedValuePadder
- Following copied from interface:
org.bouncycastle.cert.crmf.EncryptedValuePadder
- Parameters:
paddedData
- the data to be padded.- Returns:
- an array containing the original unpadded data.