diff options
author | Ade Lee <alee@redhat.com> | 2012-01-11 12:57:53 -0500 |
---|---|---|
committer | Ade Lee <alee@redhat.com> | 2012-01-11 13:49:04 -0500 |
commit | 10cfe7756e967ac91c66d33b392aeab9cf3780fb (patch) | |
tree | d5ac9b58442265d2ce5ef60e31f041ddacba1b4f /pki/base/common/src/com/netscape/certsrv/dbs/keydb | |
parent | edcb24f65cc3700e75d0a1d14dc2483f210b0ee4 (diff) | |
download | pki-10cfe7756e967ac91c66d33b392aeab9cf3780fb.tar.gz pki-10cfe7756e967ac91c66d33b392aeab9cf3780fb.tar.xz pki-10cfe7756e967ac91c66d33b392aeab9cf3780fb.zip |
Formatting (no line wrap in comments or code)
Diffstat (limited to 'pki/base/common/src/com/netscape/certsrv/dbs/keydb')
4 files changed, 77 insertions, 79 deletions
diff --git a/pki/base/common/src/com/netscape/certsrv/dbs/keydb/IKeyRecord.java b/pki/base/common/src/com/netscape/certsrv/dbs/keydb/IKeyRecord.java index 0edcc1877..010661d8b 100644 --- a/pki/base/common/src/com/netscape/certsrv/dbs/keydb/IKeyRecord.java +++ b/pki/base/common/src/com/netscape/certsrv/dbs/keydb/IKeyRecord.java @@ -17,16 +17,14 @@ // --- END COPYRIGHT BLOCK --- package com.netscape.certsrv.dbs.keydb; - import java.math.BigInteger; import java.util.Date; import com.netscape.certsrv.base.EBaseException; - /** * An interface contains constants for key record. - * + * * @version $Revision$, $Date$ */ public interface IKeyRecord { @@ -42,15 +40,15 @@ public interface IKeyRecord { public static final String ATTR_MODIFY_TIME = "keyModifyTime"; public static final String ATTR_META_INFO = "keyMetaInfo"; public static final String ATTR_ARCHIVED_BY = "keyArchivedBy"; - + // key state public static final String STATUS_ANY = "ANY"; public static final String STATUS_VALID = "VALID"; public static final String STATUS_INVALID = "INVALID"; - + /** * Retrieves the state of the key. - * + * * @return key state * @exception EBaseException failed to retrieve state of the key */ @@ -58,15 +56,15 @@ public interface IKeyRecord { /** * Retrieves key identifier. - * + * * @return key id * @exception EBaseException failed to retrieve key id */ - public BigInteger getSerialNumber() throws EBaseException; + public BigInteger getSerialNumber() throws EBaseException; /** * Retrieves key owner name. - * + * * @return key owner name * @exception EBaseException failed to retrieve key owner name */ @@ -74,53 +72,53 @@ public interface IKeyRecord { /** * Retrieves key algorithm. - * + * * @return key algorithm */ - public String getAlgorithm(); + public String getAlgorithm(); /** * Retrieves key length. - * + * * @return key length * @exception EBaseException failed to retrieve key length */ - public Integer getKeySize() throws EBaseException; + public Integer getKeySize() throws EBaseException; /** * Retrieves archiver identifier. - * + * * @return archiver uid */ - public String getArchivedBy(); + public String getArchivedBy(); /** * Retrieves creation time. - * + * * @return creation time */ - public Date getCreateTime(); + public Date getCreateTime(); /** * Retrieves last modification time. - * + * * @return modification time */ - public Date getModifyTime(); + public Date getModifyTime(); /** * Retrieves dates of recovery. - * + * * @return recovery history * @exception EBaseException failed to retrieve recovery history */ - public Date[] getDateOfRevocation() throws EBaseException; + public Date[] getDateOfRevocation() throws EBaseException; /** * Retrieves public key data. - * + * * @return public key data * @exception EBaseException failed to retrieve public key data */ public byte[] getPublicKeyData() throws EBaseException; -} +} diff --git a/pki/base/common/src/com/netscape/certsrv/dbs/keydb/IKeyRecordList.java b/pki/base/common/src/com/netscape/certsrv/dbs/keydb/IKeyRecordList.java index 5da239452..75f833892 100644 --- a/pki/base/common/src/com/netscape/certsrv/dbs/keydb/IKeyRecordList.java +++ b/pki/base/common/src/com/netscape/certsrv/dbs/keydb/IKeyRecordList.java @@ -17,35 +17,33 @@ // --- END COPYRIGHT BLOCK --- package com.netscape.certsrv.dbs.keydb; - import java.util.Enumeration; import com.netscape.certsrv.base.EBaseException; - /** * A class represents a list of key records. * <P> - * + * * @version $Revision$, $Date$ */ public interface IKeyRecordList { /** - * Retrieves the size of key list. - * + * Retrieves the size of key list. + * * @return size of key list */ public int getSize(); /** * Retrieves key records. - * + * * @param startidx start index * @param endidx end index * @return key records * @exception EBaseException failed to retrieve key records */ public Enumeration<IKeyRecord> getKeyRecords(int startidx, int endidx) - throws EBaseException; + throws EBaseException; } diff --git a/pki/base/common/src/com/netscape/certsrv/dbs/keydb/IKeyRepository.java b/pki/base/common/src/com/netscape/certsrv/dbs/keydb/IKeyRepository.java index 093bea255..ca1e2c8aa 100644 --- a/pki/base/common/src/com/netscape/certsrv/dbs/keydb/IKeyRepository.java +++ b/pki/base/common/src/com/netscape/certsrv/dbs/keydb/IKeyRepository.java @@ -17,7 +17,6 @@ // --- END COPYRIGHT BLOCK --- package com.netscape.certsrv.dbs.keydb; - import java.math.BigInteger; import java.security.PublicKey; import java.util.Enumeration; @@ -28,12 +27,11 @@ import com.netscape.certsrv.base.EBaseException; import com.netscape.certsrv.dbs.ModificationSet; import com.netscape.certsrv.dbs.repository.IRepository; - /** - * An interface represents a Key repository. This is the + * An interface represents a Key repository. This is the * container of archived keys. * <P> - * + * * @version $Revision$, $Date$ */ public interface IKeyRepository extends IRepository { @@ -41,7 +39,7 @@ public interface IKeyRepository extends IRepository { /** * Archives a key to the repository. * <P> - * + * * @param record key record * @exception EBaseException failed to archive key */ @@ -50,61 +48,61 @@ public interface IKeyRepository extends IRepository { /** * Reads an archived key by serial number. * <P> - * + * * @param serialNo serial number * @return key record * @exception EBaseException failed to recover key */ public IKeyRecord readKeyRecord(BigInteger serialNo) - throws EBaseException; + throws EBaseException; /** * Reads an archived key by b64 encoded cert. * <P> - * + * * @param cert b64 encoded cert * @return key record * @exception EBaseException failed to recover key */ public IKeyRecord readKeyRecord(String cert) - throws EBaseException; + throws EBaseException; /** * Reads an archived key by owner name. * <P> - * + * * @param ownerName owner name * @return key record * @exception EBaseException failed to recover key */ public IKeyRecord readKeyRecord(X500Name ownerName) - throws EBaseException; + throws EBaseException; /** * Reads archived key using public key. - * - * @param publicKey public key that is corresponding - * to the private key + * + * @param publicKey public key that is corresponding + * to the private key * @return key record * @exception EBaseException failed to read key */ public IKeyRecord readKeyRecord(PublicKey publicKey) - throws EBaseException; + throws EBaseException; /** * Searches for private keys. - * + * * @param filter LDAP filter for the search * @param maxSize maximium number of entries to be returned * @return a list of private key records * @exception EBaseException failed to search keys */ public Enumeration searchKeys(String filter, int maxSize) - throws EBaseException; + throws EBaseException; /** * Searches for private keys. - * + * * @param filter LDAP filter for the search * @param maxSize maximium number of entries to be returned * @param timeLimt timeout value @@ -112,30 +110,31 @@ public interface IKeyRepository extends IRepository { * @exception EBaseException failed to search keys */ public Enumeration searchKeys(String filter, int maxSize, int timeLimt) - throws EBaseException; + throws EBaseException; /** * Deletes a key record. - * + * * @param serialno key identifier * @exception EBaseException failed to delete key record */ public void deleteKeyRecord(BigInteger serialno) - throws EBaseException; + throws EBaseException; /** * Modifies key record in this repository. - * + * * @param serialNo key identifier * @param mods modification of key records * @exception EBaseException failed to modify key record */ public void modifyKeyRecord(BigInteger serialNo, - ModificationSet mods) throws EBaseException; + ModificationSet mods) throws EBaseException; /** * Searchs for a list of key records. * Here is a list of supported filter attributes: + * * <pre> * keySerialNumber * keyState @@ -149,7 +148,7 @@ public interface IKeyRepository extends IRepository { * keyModifyTime * keyMetaInfo * </pre> - * + * * @param filter search filter * @param attrs list of attributes to be returned * @param pageSize virtual list page size @@ -157,11 +156,11 @@ public interface IKeyRepository extends IRepository { * @exception EBaseException failed to search key records */ public IKeyRecordList findKeyRecordsInList(String filter, - String attrs[], int pageSize) throws EBaseException; + String attrs[], int pageSize) throws EBaseException; /** * Searchs for a list of key records. - * + * * @param filter search filter * @param attrs list of attributes to be returned * @param sortKey name of attribute that the list should be sorted by @@ -170,6 +169,6 @@ public interface IKeyRepository extends IRepository { * @exception EBaseException failed to search key records */ public IKeyRecordList findKeyRecordsInList(String filter, - String attrs[], String sortKey, int pageSize) - throws EBaseException; + String attrs[], String sortKey, int pageSize) + throws EBaseException; } diff --git a/pki/base/common/src/com/netscape/certsrv/dbs/keydb/KeyState.java b/pki/base/common/src/com/netscape/certsrv/dbs/keydb/KeyState.java index e4baf91eb..fa8a0d768 100644 --- a/pki/base/common/src/com/netscape/certsrv/dbs/keydb/KeyState.java +++ b/pki/base/common/src/com/netscape/certsrv/dbs/keydb/KeyState.java @@ -17,15 +17,13 @@ // --- END COPYRIGHT BLOCK --- package com.netscape.certsrv.dbs.keydb; - import java.io.Serializable; - /** * A class represents key state. This object is to * encapsulate the life cycle of a key. * <P> - * + * * @version $Revision$, $Date$ */ public final class KeyState implements Serializable { @@ -42,62 +40,67 @@ public final class KeyState implements Serializable { private KeyState(int code) { mStateCode = code; } - + /** * Request state. */ - public final static KeyState ANY = new KeyState(-1); + public final static KeyState ANY = new KeyState(-1); public final static KeyState VALID = new KeyState(0); public final static KeyState INVALID = new KeyState(1); - + /** * Checks if the given object equals to this object. - * + * * @param other object to be compared * @return true if both objects are the same */ public boolean equals(Object other) { - if (this == other) + if (this == other) return true; else if (other instanceof KeyState) return ((KeyState) other).mStateCode == mStateCode; - else + else return false; } /** * Returns the hash code. - * + * * @return hash code */ public int hashCode() { return mStateCode; } - + /** * Return the string-representation of this object. - * + * * @return string value */ public String toString() { - if (mStateCode == -1) return "ANY"; - if (mStateCode == 0) return "VALID"; - if (mStateCode == 1) return "INVAILD"; + if (mStateCode == -1) + return "ANY"; + if (mStateCode == 0) + return "VALID"; + if (mStateCode == 1) + return "INVAILD"; return "[UNDEFINED]"; - + } /** * Converts a string into a key state object. - * + * * @param state state in string-representation * @return key state object */ public static KeyState toKeyState(String state) { - if (state.equalsIgnoreCase("ANY")) return ANY; - if (state.equalsIgnoreCase("VALID")) return VALID; - if (state.equalsIgnoreCase("INVALID")) return INVALID; + if (state.equalsIgnoreCase("ANY")) + return ANY; + if (state.equalsIgnoreCase("VALID")) + return VALID; + if (state.equalsIgnoreCase("INVALID")) + return INVALID; return null; } } - |