01: package org.bouncycastle.cms;
02:
03: import javax.crypto.interfaces.PBEKey;
04:
05: public abstract class CMSPBEKey implements PBEKey {
06: private char[] password;
07: private byte[] salt;
08: private int iterationCount;
09:
10: public CMSPBEKey(char[] password, byte[] salt, int iterationCount) {
11: this .password = password;
12: this .salt = salt;
13: this .iterationCount = iterationCount;
14: }
15:
16: public char[] getPassword() {
17: return password;
18: }
19:
20: public byte[] getSalt() {
21: return salt;
22: }
23:
24: public int getIterationCount() {
25: return iterationCount;
26: }
27:
28: public String getAlgorithm() {
29: return "PKCS5S2";
30: }
31:
32: public String getFormat() {
33: return "RAW";
34: }
35:
36: public byte[] getEncoded() {
37: return null;
38: }
39:
40: abstract byte[] getEncoded(String algorithmOid);
41: }
|