java.lang.Object
org.bouncycastle.crypto.params.ParametersWithContext
- All Implemented Interfaces:
CipherParameters
Cipher parameters with associated context data. Wraps cipher parameters with additional context information for cryptographic operations.
Field Summary
FieldsModifier and TypeFieldDescriptionprivate byte[]The context bytes mixed into the operation.private CipherParametersThe parameters being wrapped.Constructor Summary
ConstructorsConstructorDescriptionParametersWithContext(CipherParameters parameters, byte[] context) Wrap cipher parameters together with the context bytes they apply to.Method Summary
All MethodsModifier and TypeMethodDescriptionvoidcopyContextTo(byte[] buf, int off, int len) Copy the context bytes into another buffer.byte[]Read the context bytes back.intReport how many context bytes are held.Read back the wrapped cipher parameters.
Field Details
parameters
The parameters being wrapped.context
private byte[] contextThe context bytes mixed into the operation.
Constructor Details
ParametersWithContext
Wrap cipher parameters together with the context bytes they apply to.- Parameters:
parameters- the cipher parameterscontext- the context data, which must not be null and is cloned
Method Details
copyContextTo
public void copyContextTo(byte[] buf, int off, int len) Copy the context bytes into another buffer.- Parameters:
buf- the array receiving the copied context bytesoff- index in buf at which the copy startslen- number of context bytes to copy, which must equal the context length
getContext
public byte[] getContext()Read the context bytes back.- Returns:
- a clone of the context bytes the wrapped parameters apply to
getContextLength
public int getContextLength()Report how many context bytes are held.- Returns:
- the number of context bytes held by this object
getParameters
Read back the wrapped cipher parameters.- Returns:
- the cipher parameters this object wraps, as supplied at construction