diff options
Diffstat (limited to 'pki/base/kra/src/com')
-rw-r--r-- | pki/base/kra/src/com/netscape/kra/KeyRecoveryAuthority.java | 17 | ||||
-rw-r--r-- | pki/base/kra/src/com/netscape/kra/StorageKeyUnit.java | 4 |
2 files changed, 20 insertions, 1 deletions
diff --git a/pki/base/kra/src/com/netscape/kra/KeyRecoveryAuthority.java b/pki/base/kra/src/com/netscape/kra/KeyRecoveryAuthority.java index 857aa414..44fec8f3 100644 --- a/pki/base/kra/src/com/netscape/kra/KeyRecoveryAuthority.java +++ b/pki/base/kra/src/com/netscape/kra/KeyRecoveryAuthority.java @@ -538,7 +538,7 @@ public class KeyRecoveryAuthority implements IAuthority, IKeyService, IKeyRecove * @exception EBaseException failed to retrieve info */ public int getNoOfRequiredAgents() throws EBaseException { - if (mConfig.getBoolean("keySplitting")) { + if (mConfig.getBoolean("keySplitting", false)) { return mStorageKeyUnit.getNoOfRequiredAgents(); } else { int ret = -1; @@ -551,6 +551,21 @@ public class KeyRecoveryAuthority implements IAuthority, IKeyService, IKeyRecove } /** + * Sets number of required agents for + * recovery operation + * + * @return none + * @exception EBaseException invalid setting + */ + public void setNoOfRequiredAgents(int number) throws EBaseException { + if (mConfig.getBoolean("keySplitting")) { + mStorageKeyUnit.setNoOfRequiredAgents(number); + } else { + mConfig.putInteger("noOfRequiredRecoveryAgents", number); + } + } + + /** * Distributed recovery. */ public String getRecoveryID() { diff --git a/pki/base/kra/src/com/netscape/kra/StorageKeyUnit.java b/pki/base/kra/src/com/netscape/kra/StorageKeyUnit.java index c3693823..fff1eea7 100644 --- a/pki/base/kra/src/com/netscape/kra/StorageKeyUnit.java +++ b/pki/base/kra/src/com/netscape/kra/StorageKeyUnit.java @@ -636,6 +636,10 @@ public class StorageKeyUnit extends EncryptionUnit implements return mStorageConfig.getInteger(PROP_M); } + public void setNoOfRequiredAgents(int number) { + mStorageConfig.putInteger(PROP_M, number); + } + public CryptoToken getInternalToken() { try { return CryptoManager.getInstance().getInternalKeyStorageToken(); |