Package com.netscape.cmscore.dbs
Class KeyRecord
- java.lang.Object
-
- com.netscape.cmscore.dbs.KeyRecord
-
- All Implemented Interfaces:
IAttrSet
,com.netscape.certsrv.dbs.IDBObj
,com.netscape.certsrv.dbs.keydb.IKeyRecord
,java.io.Serializable
public class KeyRecord extends java.lang.Object implements com.netscape.certsrv.dbs.keydb.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 void
delete(java.lang.String name)
Deletes an attribute.java.lang.Object
get(java.lang.String name)
Retrieves an attribute.java.lang.String
getAlgorithm()
Retrieves algorithm of the key pair.java.lang.String
getArchivedBy()
Retrieves the uid of person who archived this record.java.lang.String
getClientId()
Retrieves the client ID of this record.java.util.Date
getCreateTime()
Retrieves the creation time of this record.java.lang.String
getDataType()
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.Integer
getKeySize()
Retrieves the key size.java.lang.String
getKeyStatus()
Retrieves the key status of this record.MetaInfo
getMetaInfo()
Retrieves the metaInfo.java.util.Date
getModifyTime()
Retrieves the last modification time of this record.java.lang.String
getOwnerName()
Retrieves owner name.byte[]
getPrivateKeyData()
Retrieves key.byte[]
getPublicKeyData()
Retrieves the public key.java.lang.String
getRealm()
Retrieves authorization realm.java.util.Enumeration<java.lang.String>
getSerializableAttrNames()
Retrieves serializable attribute names.java.math.BigInteger
getSerialNumber()
Retrieves serial number of the key record.com.netscape.certsrv.dbs.keydb.KeyState
getState()
Retrieves the key state.org.mozilla.jss.netscape.security.util.WrappingParams
getWrappingParams(org.mozilla.jss.netscape.security.util.WrappingParams oldParams)
java.lang.Boolean
isEncrypted()
void
set(java.lang.String name, java.lang.Object object)
Sets an attribute.void
setDateOfRevocation(java.util.Date[] dates)
Sets the date of revocation.void
setKeySize(java.lang.Integer keySize)
Sets key size.void
setOwnerName(java.lang.String name)
Sets owner name.void
setPrivateKeyData(byte[] keydata)
Sets key data.void
setPublicKeyData(byte[] key)
Sets the public key.void
setSerialNumber(java.math.BigInteger serialno)
Sets serial number.void
setState(com.netscape.certsrv.dbs.keydb.KeyState state)
Sets key state.void
setWrappingParams(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 EBaseException
Sets an attribute.- Specified by:
set
in 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 EBaseException
Retrieves an attribute.- Specified by:
get
in 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 EBaseException
Deletes an attribute.- Specified by:
delete
in 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:
getElements
in interfaceIAttrSet
- Returns:
- an enumeration of the attribute names.
-
getSerializableAttrNames
public java.util.Enumeration<java.lang.String> getSerializableAttrNames()
Retrieves serializable attribute names.- Specified by:
getSerializableAttrNames
in interfacecom.netscape.certsrv.dbs.IDBObj
- Returns:
- a list of serializable attribute names
-
getSerialNumber
public java.math.BigInteger getSerialNumber() throws EBaseException
Retrieves serial number of the key record. Each key record is uniquely identified by serial number.- Specified by:
getSerialNumber
in interfacecom.netscape.certsrv.dbs.keydb.IKeyRecord
- Returns:
- serial number of this key record
- Throws:
EBaseException
- failed to retrieve key id
-
setSerialNumber
public void setSerialNumber(java.math.BigInteger serialno) throws EBaseException
Sets serial number.- Throws:
EBaseException
-
getState
public com.netscape.certsrv.dbs.keydb.KeyState getState() throws EBaseException
Retrieves the key state. This gives key life cycle information.- Specified by:
getState
in interfacecom.netscape.certsrv.dbs.keydb.IKeyRecord
- Returns:
- key state
- Throws:
EBaseException
- failed to retrieve state of the key
-
setState
public void setState(com.netscape.certsrv.dbs.keydb.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:
getArchivedBy
in interfacecom.netscape.certsrv.dbs.keydb.IKeyRecord
- Returns:
- archiver uid
-
getPrivateKeyData
public byte[] getPrivateKeyData() throws EBaseException
Retrieves key.- Returns:
- archived key
- Throws:
EBaseException
-
setPrivateKeyData
public void setPrivateKeyData(byte[] keydata) throws EBaseException
Sets key data.- Throws:
EBaseException
-
getKeySize
public java.lang.Integer getKeySize() throws EBaseException
Retrieves the key size.- Specified by:
getKeySize
in interfacecom.netscape.certsrv.dbs.keydb.IKeyRecord
- Returns:
- key size
- Throws:
EBaseException
- failed to retrieve key length
-
getMetaInfo
public MetaInfo getMetaInfo()
Retrieves the metaInfo.- Specified by:
getMetaInfo
in interfacecom.netscape.certsrv.dbs.keydb.IKeyRecord
- Returns:
- metaInfo
-
setKeySize
public void setKeySize(java.lang.Integer keySize) throws EBaseException
Sets key size.- Throws:
EBaseException
-
getOwnerName
public java.lang.String getOwnerName() throws EBaseException
Retrieves owner name.- Specified by:
getOwnerName
in interfacecom.netscape.certsrv.dbs.keydb.IKeyRecord
- Returns:
- key owner name
- Throws:
EBaseException
- failed to retrieve key owner name
-
setOwnerName
public void setOwnerName(java.lang.String name) throws EBaseException
Sets owner name.- Throws:
EBaseException
-
getPublicKeyData
public byte[] getPublicKeyData() throws EBaseException
Retrieves the public key.- Specified by:
getPublicKeyData
in interfacecom.netscape.certsrv.dbs.keydb.IKeyRecord
- Returns:
- public key data
- Throws:
EBaseException
- failed to retrieve public key data
-
setPublicKeyData
public void setPublicKeyData(byte[] key) throws EBaseException
Sets the public key.- Throws:
EBaseException
-
getDateOfRevocation
public java.util.Date[] getDateOfRevocation() throws EBaseException
Retrieves the date(s) of revocation.- Specified by:
getDateOfRevocation
in interfacecom.netscape.certsrv.dbs.keydb.IKeyRecord
- Returns:
- recovery history
- Throws:
EBaseException
- failed to retrieve recovery history
-
setDateOfRevocation
public void setDateOfRevocation(java.util.Date[] dates) throws EBaseException
Sets the date of revocation.- Throws:
EBaseException
-
getAlgorithm
public java.lang.String getAlgorithm()
Retrieves algorithm of the key pair.- Specified by:
getAlgorithm
in interfacecom.netscape.certsrv.dbs.keydb.IKeyRecord
- Returns:
- key algorithm
-
getCreateTime
public java.util.Date getCreateTime()
Retrieves the creation time of this record.- Specified by:
getCreateTime
in interfacecom.netscape.certsrv.dbs.keydb.IKeyRecord
- Returns:
- creation time
-
getModifyTime
public java.util.Date getModifyTime()
Retrieves the last modification time of this record.- Specified by:
getModifyTime
in interfacecom.netscape.certsrv.dbs.keydb.IKeyRecord
- Returns:
- modification time
-
getClientId
public java.lang.String getClientId() throws EBaseException
Retrieves the client ID of this record.- Specified by:
getClientId
in interfacecom.netscape.certsrv.dbs.keydb.IKeyRecord
- Returns:
- client id
- Throws:
EBaseException
- failed to retrieve client id
-
getKeyStatus
public java.lang.String getKeyStatus() throws EBaseException
Retrieves the key status of this record.- Specified by:
getKeyStatus
in interfacecom.netscape.certsrv.dbs.keydb.IKeyRecord
- Returns:
- key status
- Throws:
EBaseException
- failed to retrieve key status
-
getDataType
public java.lang.String getDataType() throws EBaseException
Retrieves the key data type of this record.- Specified by:
getDataType
in interfacecom.netscape.certsrv.dbs.keydb.IKeyRecord
- Returns:
- data type
- Throws:
EBaseException
- failed to retrieve data type
-
getRealm
public java.lang.String getRealm() throws EBaseException
Description copied from interface:com.netscape.certsrv.dbs.keydb.IKeyRecord
Retrieves authorization realm.- Specified by:
getRealm
in interfacecom.netscape.certsrv.dbs.keydb.IKeyRecord
- 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:
setWrappingParams
in interfacecom.netscape.certsrv.dbs.keydb.IKeyRecord
- 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:
getWrappingParams
in interfacecom.netscape.certsrv.dbs.keydb.IKeyRecord
- Throws:
java.lang.Exception
-
isEncrypted
public java.lang.Boolean isEncrypted() throws EBaseException
- Specified by:
isEncrypted
in interfacecom.netscape.certsrv.dbs.keydb.IKeyRecord
- Throws:
EBaseException
-
-