01: package org.bouncycastle.crypto.params;
02:
03: import org.bouncycastle.crypto.CipherParameters;
04:
05: /**
06: * Cipher parameters with a fixed salt value associated with them.
07: */
08: public class ParametersWithSalt implements CipherParameters {
09: private byte[] salt;
10: private CipherParameters parameters;
11:
12: public ParametersWithSalt(CipherParameters parameters, byte[] salt) {
13: this (parameters, salt, 0, salt.length);
14: }
15:
16: public ParametersWithSalt(CipherParameters parameters, byte[] salt,
17: int saltOff, int saltLen) {
18: this .salt = new byte[saltLen];
19: this .parameters = parameters;
20:
21: System.arraycopy(salt, saltOff, this .salt, 0, saltLen);
22: }
23:
24: public byte[] getSalt() {
25: return salt;
26: }
27:
28: public CipherParameters getParameters() {
29: return parameters;
30: }
31: }
|