Package com.netscape.cmscore.dbs
Class KeyRecord
java.lang.Object
com.netscape.cmscore.dbs.KeyRecord
- All Implemented Interfaces:
IAttrSet
,IDBObj
,IKeyRecord
,Serializable
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:
-
Field Summary
FieldsFields 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
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Deletes an attribute.Retrieves an attribute.Retrieves algorithm of the key pair.Retrieves the uid of person who archived this record.Retrieves the client ID of this record.Retrieves the creation time of this record.Retrieves the key data type of this record.Date[]
Retrieves the date(s) of revocation.Retrieves an enumeration of attributes.Retrieves the key size.Retrieves the key status of this record.Retrieves the metaInfo.Retrieves the last modification time of this record.Retrieves owner name.byte[]
Retrieves key.byte[]
Retrieves the public key.getRealm()
Retrieves authorization realm.Retrieves serializable attribute names.Retrieves serial number of the key record.getState()
Retrieves the key state.org.mozilla.jss.netscape.security.util.WrappingParams
getWrappingParams
(org.mozilla.jss.netscape.security.util.WrappingParams oldParams) void
Sets an attribute.void
setDateOfRevocation
(Date[] dates) Sets the date of revocation.void
setKeySize
(Integer keySize) Sets key size.void
setOwnerName
(String name) Sets owner name.void
setPrivateKeyData
(byte[] keydata) Sets key data.void
setPublicKeyData
(byte[] key) Sets the public key.void
setSerialNumber
(BigInteger serialno) Sets serial number.void
Sets key state.void
setWrappingParams
(org.mozilla.jss.netscape.security.util.WrappingParams params, boolean doEncrypt)
-
Field Details
-
mNames
-
-
Constructor Details
-
KeyRecord
public KeyRecord()Constructs empty key record. -
KeyRecord
public KeyRecord(BigInteger serialNo, byte[] publicData, byte[] privateData, String owner, String algorithm, String agentId) throws EBaseException - Throws:
EBaseException
-
-
Method Details
-
set
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
Retrieves an attribute.- Specified by:
get
in interfaceIAttrSet
- Parameters:
name
- the name of the attribute to return.- Throws:
EBaseException
- on attribute handling errors.
-
delete
Deletes an attribute.- Specified by:
delete
in interfaceIAttrSet
- Parameters:
name
- the name of the attribute to delete.- Throws:
EBaseException
- on attribute handling errors.
-
getElements
Retrieves an enumeration of attributes.- Specified by:
getElements
in interfaceIAttrSet
- Returns:
- an enumeration of the attribute names.
-
getSerializableAttrNames
Retrieves serializable attribute names.- Specified by:
getSerializableAttrNames
in interfaceIDBObj
- Returns:
- a list of serializable attribute names
-
getSerialNumber
Retrieves serial number of the key record. Each key record is uniquely identified by serial number.- Specified by:
getSerialNumber
in interfaceIKeyRecord
- Returns:
- serial number of this key record
- Throws:
EBaseException
- failed to retrieve key id
-
setSerialNumber
Sets serial number.- Throws:
EBaseException
-
getState
Retrieves the key state. This gives key life cycle information.- Specified by:
getState
in interfaceIKeyRecord
- Returns:
- key state
- Throws:
EBaseException
- failed to retrieve state of the key
-
setState
Sets key state.- Throws:
EBaseException
-
getArchivedBy
Retrieves the uid of person who archived this record.- Specified by:
getArchivedBy
in interfaceIKeyRecord
- Returns:
- archiver uid
-
getPrivateKeyData
Retrieves key.- Returns:
- archived key
- Throws:
EBaseException
-
setPrivateKeyData
Sets key data.- Throws:
EBaseException
-
getKeySize
Retrieves the key size.- Specified by:
getKeySize
in interfaceIKeyRecord
- Returns:
- key size
- Throws:
EBaseException
- failed to retrieve key length
-
getMetaInfo
Retrieves the metaInfo.- Specified by:
getMetaInfo
in interfaceIKeyRecord
- Returns:
- metaInfo
-
setKeySize
Sets key size.- Throws:
EBaseException
-
getOwnerName
Retrieves owner name.- Specified by:
getOwnerName
in interfaceIKeyRecord
- Returns:
- key owner name
- Throws:
EBaseException
- failed to retrieve key owner name
-
setOwnerName
Sets owner name.- Throws:
EBaseException
-
getPublicKeyData
Retrieves the public key.- Specified by:
getPublicKeyData
in interfaceIKeyRecord
- Returns:
- public key data
- Throws:
EBaseException
- failed to retrieve public key data
-
setPublicKeyData
Sets the public key.- Throws:
EBaseException
-
getDateOfRevocation
Retrieves the date(s) of revocation.- Specified by:
getDateOfRevocation
in interfaceIKeyRecord
- Returns:
- recovery history
- Throws:
EBaseException
- failed to retrieve recovery history
-
setDateOfRevocation
Sets the date of revocation.- Throws:
EBaseException
-
getAlgorithm
Retrieves algorithm of the key pair.- Specified by:
getAlgorithm
in interfaceIKeyRecord
- Returns:
- key algorithm
-
getCreateTime
Retrieves the creation time of this record.- Specified by:
getCreateTime
in interfaceIKeyRecord
- Returns:
- creation time
-
getModifyTime
Retrieves the last modification time of this record.- Specified by:
getModifyTime
in interfaceIKeyRecord
- Returns:
- modification time
-
getClientId
Retrieves the client ID of this record.- Specified by:
getClientId
in interfaceIKeyRecord
- Returns:
- client id
- Throws:
EBaseException
- failed to retrieve client id
-
getKeyStatus
Retrieves the key status of this record.- Specified by:
getKeyStatus
in interfaceIKeyRecord
- Returns:
- key status
- Throws:
EBaseException
- failed to retrieve key status
-
getDataType
Retrieves the key data type of this record.- Specified by:
getDataType
in interfaceIKeyRecord
- Returns:
- data type
- Throws:
EBaseException
- failed to retrieve data type
-
getRealm
Description copied from interface:IKeyRecord
Retrieves authorization realm.- Specified by:
getRealm
in 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 Exception - Specified by:
setWrappingParams
in interfaceIKeyRecord
- Throws:
Exception
-
getWrappingParams
public org.mozilla.jss.netscape.security.util.WrappingParams getWrappingParams(org.mozilla.jss.netscape.security.util.WrappingParams oldParams) throws Exception - Specified by:
getWrappingParams
in interfaceIKeyRecord
- Throws:
Exception
-
isEncrypted
- Specified by:
isEncrypted
in interfaceIKeyRecord
- Throws:
EBaseException
-