java.lang.Object
org.bouncycastle.crypto.params.ParametersWithRandom
- All Implemented Interfaces:
CipherParameters
Cipher parameters with associated random number generator. Wraps cipher parameters with a secure random source for cryptographic operations.
Field Summary
FieldsModifier and TypeFieldDescriptionprivate CipherParametersThe parameters being wrapped.private SecureRandomThe random the operation should use.Constructor Summary
ConstructorsConstructorDescriptionParametersWithRandom(CipherParameters parameters) Wrap parameters with default random.ParametersWithRandom(CipherParameters parameters, SecureRandom random) Wrap parameters with random.Method Summary
All MethodsModifier and TypeMethodDescriptionUnwraps the cipher parameters passed to the constructor.Supplies the secure random source for operations needing one.
Field Details
random
The random the operation should use.parameters
The parameters being wrapped.
Constructor Details
ParametersWithRandom
Wrap parameters with random.- Parameters:
parameters- the cipher parameters to wrap; they are returned unchanged bygetParameters()random- the secure random source for operations needing one, resolved through the CryptoServicesRegistrar; null selects the registrar's default instance
ParametersWithRandom
Wrap parameters with default random.- Parameters:
parameters- the cipher parameters to wrap; they are returned unchanged by getParameters()
Method Details
getRandom
Supplies the secure random source for operations needing one.- Returns:
- the secure random source carried by these parameters, never null
getParameters
Unwraps the cipher parameters passed to the constructor.- Returns:
- the wrapped cipher parameters, exactly the instance supplied to the constructor