Package com.netscape.cmscore.dbs
Class KeyRecord
- java.lang.Object
-
- com.netscape.cmscore.dbs.KeyRecord
-
- All Implemented Interfaces:
IAttrSet,IDBObj,IKeyRecord,java.io.Serializable
public class KeyRecord extends java.lang.Object implements IKeyRecord
A class represents a Key record. It maintains the key life cycle as well as other information about an archived key. Namely, whether a key is inactive because of compromise.- Version:
- $Revision$, $Date$
- Author:
- thomask
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected static java.util.Vector<java.lang.String>mNames-
Fields inherited from interface com.netscape.certsrv.dbs.keydb.IKeyRecord
ATTR_ALGORITHM, ATTR_ARCHIVED_BY, ATTR_CLIENT_ID, ATTR_CREATE_TIME, ATTR_DATA_TYPE, ATTR_DATE_OF_RECOVERY, ATTR_ID, ATTR_KEY_SIZE, ATTR_META_INFO, ATTR_MODIFY_TIME, ATTR_OWNER_NAME, ATTR_PRIVATE_KEY_DATA, ATTR_PUBLIC_KEY_DATA, ATTR_REALM, ATTR_STATE, ATTR_STATUS, STATUS_ANY, STATUS_INVALID, STATUS_VALID
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddelete(java.lang.String name)Deletes an attribute.java.lang.Objectget(java.lang.String name)Retrieves an attribute.java.lang.StringgetAlgorithm()Retrieves algorithm of the key pair.java.lang.StringgetArchivedBy()Retrieves the uid of person who archived this record.java.lang.StringgetClientId()Retrieves the client ID of this record.java.util.DategetCreateTime()Retrieves the creation time of this record.java.lang.StringgetDataType()Retrieves the key data type of this record.java.util.Date[]getDateOfRevocation()Retrieves the date(s) of revocation.java.util.Enumeration<java.lang.String>getElements()Retrieves an enumeration of attributes.java.lang.IntegergetKeySize()Retrieves the key size.java.lang.StringgetKeyStatus()Retrieves the key status of this record.MetaInfogetMetaInfo()Retrieves the metaInfo.java.util.DategetModifyTime()Retrieves the last modification time of this record.java.lang.StringgetOwnerName()Retrieves owner name.byte[]getPrivateKeyData()Retrieves key.byte[]getPublicKeyData()Retrieves the public key.java.lang.StringgetRealm()Retrieves authorization realm.java.util.Enumeration<java.lang.String>getSerializableAttrNames()Retrieves serializable attribute names.java.math.BigIntegergetSerialNumber()Retrieves serial number of the key record.KeyStategetState()Retrieves the key state.org.mozilla.jss.netscape.security.util.WrappingParamsgetWrappingParams(org.mozilla.jss.netscape.security.util.WrappingParams oldParams)java.lang.BooleanisEncrypted()voidset(java.lang.String name, java.lang.Object object)Sets an attribute.voidsetDateOfRevocation(java.util.Date[] dates)Sets the date of revocation.voidsetKeySize(java.lang.Integer keySize)Sets key size.voidsetOwnerName(java.lang.String name)Sets owner name.voidsetPrivateKeyData(byte[] keydata)Sets key data.voidsetPublicKeyData(byte[] key)Sets the public key.voidsetSerialNumber(java.math.BigInteger serialno)Sets serial number.voidsetState(KeyState state)Sets key state.voidsetWrappingParams(org.mozilla.jss.netscape.security.util.WrappingParams params, boolean doEncrypt)
-
-
-
Constructor Detail
-
KeyRecord
public KeyRecord()
Constructs empty key record.
-
KeyRecord
public KeyRecord(java.math.BigInteger serialNo, byte[] publicData, byte[] privateData, java.lang.String owner, java.lang.String algorithm, java.lang.String agentId) throws EBaseException- Throws:
EBaseException
-
-
Method Detail
-
set
public void set(java.lang.String name, java.lang.Object object) throws EBaseExceptionSets an attribute.- Specified by:
setin interfaceIAttrSet- Parameters:
name- the name of the attributeobject- the attribute object.- Throws:
EBaseException- on attribute handling errors.
-
get
public java.lang.Object get(java.lang.String name) throws EBaseExceptionRetrieves an attribute.- Specified by:
getin interfaceIAttrSet- Parameters:
name- the name of the attribute to return.- Throws:
EBaseException- on attribute handling errors.
-
delete
public void delete(java.lang.String name) throws EBaseExceptionDeletes an attribute.- Specified by:
deletein interfaceIAttrSet- Parameters:
name- the name of the attribute to delete.- Throws:
EBaseException- on attribute handling errors.
-
getElements
public java.util.Enumeration<java.lang.String> getElements()
Retrieves an enumeration of attributes.- Specified by:
getElementsin interfaceIAttrSet- Returns:
- an enumeration of the attribute names.
-
getSerializableAttrNames
public java.util.Enumeration<java.lang.String> getSerializableAttrNames()
Retrieves serializable attribute names.- Specified by:
getSerializableAttrNamesin interfaceIDBObj- Returns:
- a list of serializable attribute names
-
getSerialNumber
public java.math.BigInteger getSerialNumber() throws EBaseExceptionRetrieves serial number of the key record. Each key record is uniquely identified by serial number.- Specified by:
getSerialNumberin interfaceIKeyRecord- Returns:
- serial number of this key record
- Throws:
EBaseException- failed to retrieve key id
-
setSerialNumber
public void setSerialNumber(java.math.BigInteger serialno) throws EBaseExceptionSets serial number.- Throws:
EBaseException
-
getState
public KeyState getState() throws EBaseException
Retrieves the key state. This gives key life cycle information.- Specified by:
getStatein interfaceIKeyRecord- Returns:
- key state
- Throws:
EBaseException- failed to retrieve state of the key
-
setState
public void setState(KeyState state) throws EBaseException
Sets key state.- Throws:
EBaseException
-
getArchivedBy
public java.lang.String getArchivedBy()
Retrieves the uid of person who archived this record.- Specified by:
getArchivedByin interfaceIKeyRecord- Returns:
- archiver uid
-
getPrivateKeyData
public byte[] getPrivateKeyData() throws EBaseExceptionRetrieves key.- Returns:
- archived key
- Throws:
EBaseException
-
setPrivateKeyData
public void setPrivateKeyData(byte[] keydata) throws EBaseExceptionSets key data.- Throws:
EBaseException
-
getKeySize
public java.lang.Integer getKeySize() throws EBaseExceptionRetrieves the key size.- Specified by:
getKeySizein interfaceIKeyRecord- Returns:
- key size
- Throws:
EBaseException- failed to retrieve key length
-
getMetaInfo
public MetaInfo getMetaInfo()
Retrieves the metaInfo.- Specified by:
getMetaInfoin interfaceIKeyRecord- Returns:
- metaInfo
-
setKeySize
public void setKeySize(java.lang.Integer keySize) throws EBaseExceptionSets key size.- Throws:
EBaseException
-
getOwnerName
public java.lang.String getOwnerName() throws EBaseExceptionRetrieves owner name.- Specified by:
getOwnerNamein interfaceIKeyRecord- Returns:
- key owner name
- Throws:
EBaseException- failed to retrieve key owner name
-
setOwnerName
public void setOwnerName(java.lang.String name) throws EBaseExceptionSets owner name.- Throws:
EBaseException
-
getPublicKeyData
public byte[] getPublicKeyData() throws EBaseExceptionRetrieves the public key.- Specified by:
getPublicKeyDatain interfaceIKeyRecord- Returns:
- public key data
- Throws:
EBaseException- failed to retrieve public key data
-
setPublicKeyData
public void setPublicKeyData(byte[] key) throws EBaseExceptionSets the public key.- Throws:
EBaseException
-
getDateOfRevocation
public java.util.Date[] getDateOfRevocation() throws EBaseExceptionRetrieves the date(s) of revocation.- Specified by:
getDateOfRevocationin interfaceIKeyRecord- Returns:
- recovery history
- Throws:
EBaseException- failed to retrieve recovery history
-
setDateOfRevocation
public void setDateOfRevocation(java.util.Date[] dates) throws EBaseExceptionSets the date of revocation.- Throws:
EBaseException
-
getAlgorithm
public java.lang.String getAlgorithm()
Retrieves algorithm of the key pair.- Specified by:
getAlgorithmin interfaceIKeyRecord- Returns:
- key algorithm
-
getCreateTime
public java.util.Date getCreateTime()
Retrieves the creation time of this record.- Specified by:
getCreateTimein interfaceIKeyRecord- Returns:
- creation time
-
getModifyTime
public java.util.Date getModifyTime()
Retrieves the last modification time of this record.- Specified by:
getModifyTimein interfaceIKeyRecord- Returns:
- modification time
-
getClientId
public java.lang.String getClientId() throws EBaseExceptionRetrieves the client ID of this record.- Specified by:
getClientIdin interfaceIKeyRecord- Returns:
- client id
- Throws:
EBaseException- failed to retrieve client id
-
getKeyStatus
public java.lang.String getKeyStatus() throws EBaseExceptionRetrieves the key status of this record.- Specified by:
getKeyStatusin interfaceIKeyRecord- Returns:
- key status
- Throws:
EBaseException- failed to retrieve key status
-
getDataType
public java.lang.String getDataType() throws EBaseExceptionRetrieves the key data type of this record.- Specified by:
getDataTypein interfaceIKeyRecord- Returns:
- data type
- Throws:
EBaseException- failed to retrieve data type
-
getRealm
public java.lang.String getRealm() throws EBaseExceptionDescription copied from interface:IKeyRecordRetrieves authorization realm.- Specified by:
getRealmin interfaceIKeyRecord- Returns:
- authorization realm
- Throws:
EBaseException- failed to retrieve authorization realm
-
setWrappingParams
public void setWrappingParams(org.mozilla.jss.netscape.security.util.WrappingParams params, boolean doEncrypt) throws java.lang.Exception- Specified by:
setWrappingParamsin interfaceIKeyRecord- Throws:
java.lang.Exception
-
getWrappingParams
public org.mozilla.jss.netscape.security.util.WrappingParams getWrappingParams(org.mozilla.jss.netscape.security.util.WrappingParams oldParams) throws java.lang.Exception- Specified by:
getWrappingParamsin interfaceIKeyRecord- Throws:
java.lang.Exception
-
isEncrypted
public java.lang.Boolean isEncrypted() throws EBaseException- Specified by:
isEncryptedin interfaceIKeyRecord- Throws:
EBaseException
-
-