]> git.argeo.org Git - lgpl/argeo-commons.git/blob - org.argeo.api/src/org/argeo/api/security/PBEKeySpecCallback.java
Improve tabbed area and scrolled page.
[lgpl/argeo-commons.git] / org.argeo.api / src / org / argeo / api / security / PBEKeySpecCallback.java
1 package org.argeo.api.security;
2
3 import javax.crypto.spec.PBEKeySpec;
4 import javax.security.auth.callback.Callback;
5 import javax.security.auth.callback.PasswordCallback;
6
7 /**
8 * All information required to set up a {@link PBEKeySpec} bar the password
9 * itself (use a {@link PasswordCallback})
10 */
11 public class PBEKeySpecCallback implements Callback {
12 private String secretKeyFactory;
13 private byte[] salt;
14 private Integer iterationCount;
15 /** Can be null for some algorithms */
16 private Integer keyLength;
17 /** Can be null, will trigger secret key encryption if not */
18 private String secretKeyEncryption;
19
20 private String encryptedPasswordHashCipher;
21 private byte[] encryptedPasswordHash;
22
23 public void set(String secretKeyFactory, byte[] salt,
24 Integer iterationCount, Integer keyLength,
25 String secretKeyEncryption) {
26 this.secretKeyFactory = secretKeyFactory;
27 this.salt = salt;
28 this.iterationCount = iterationCount;
29 this.keyLength = keyLength;
30 this.secretKeyEncryption = secretKeyEncryption;
31 // this.encryptedPasswordHashCipher = encryptedPasswordHashCipher;
32 // this.encryptedPasswordHash = encryptedPasswordHash;
33 }
34
35 public String getSecretKeyFactory() {
36 return secretKeyFactory;
37 }
38
39 public byte[] getSalt() {
40 return salt;
41 }
42
43 public Integer getIterationCount() {
44 return iterationCount;
45 }
46
47 public Integer getKeyLength() {
48 return keyLength;
49 }
50
51 public String getSecretKeyEncryption() {
52 return secretKeyEncryption;
53 }
54
55 public String getEncryptedPasswordHashCipher() {
56 return encryptedPasswordHashCipher;
57 }
58
59 public byte[] getEncryptedPasswordHash() {
60 return encryptedPasswordHash;
61 }
62
63 }