1 package org
.argeo
.util
.crypto
;
3 import javax
.crypto
.spec
.PBEKeySpec
;
4 import javax
.security
.auth
.callback
.Callback
;
5 import javax
.security
.auth
.callback
.PasswordCallback
;
8 * All information required to set up a {@link PBEKeySpec} bar the password
9 * itself (use a {@link PasswordCallback})
11 public class PBEKeySpecCallback
implements Callback
{
12 private String secretKeyFactory
;
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
;
20 public void set(String secretKeyFactory
, byte[] salt
,
21 Integer iterationCount
, Integer keyLength
,
22 String secretKeyEncryption
) {
23 this.secretKeyFactory
= secretKeyFactory
;
25 this.iterationCount
= iterationCount
;
26 this.keyLength
= keyLength
;
27 this.secretKeyEncryption
= secretKeyEncryption
;
30 public String
getSecretKeyFactory() {
31 return secretKeyFactory
;
34 public byte[] getSalt() {
38 public Integer
getIterationCount() {
39 return iterationCount
;
42 public Integer
getKeyLength() {
46 public String
getSecretKeyEncryption() {
47 return secretKeyEncryption
;