1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.argeo.api.security;
17
18 import javax.crypto.spec.PBEKeySpec;
19 import javax.security.auth.callback.Callback;
20 import javax.security.auth.callback.PasswordCallback;
21
22
23
24
25
26 public class PBEKeySpecCallback implements Callback {
27 private String secretKeyFactory;
28 private byte[] salt;
29 private Integer iterationCount;
30
31 private Integer keyLength;
32
33 private String secretKeyEncryption;
34
35 private String encryptedPasswordHashCipher;
36 private byte[] encryptedPasswordHash;
37
38 public void set(String secretKeyFactory, byte[] salt,
39 Integer iterationCount, Integer keyLength,
40 String secretKeyEncryption) {
41 this.secretKeyFactory = secretKeyFactory;
42 this.salt = salt;
43 this.iterationCount = iterationCount;
44 this.keyLength = keyLength;
45 this.secretKeyEncryption = secretKeyEncryption;
46
47
48 }
49
50 public String getSecretKeyFactory() {
51 return secretKeyFactory;
52 }
53
54 public byte[] getSalt() {
55 return salt;
56 }
57
58 public Integer getIterationCount() {
59 return iterationCount;
60 }
61
62 public Integer getKeyLength() {
63 return keyLength;
64 }
65
66 public String getSecretKeyEncryption() {
67 return secretKeyEncryption;
68 }
69
70 public String getEncryptedPasswordHashCipher() {
71 return encryptedPasswordHashCipher;
72 }
73
74 public byte[] getEncryptedPasswordHash() {
75 return encryptedPasswordHash;
76 }
77
78 }