Package com.netscape.cmscore.dbs
Class KeyRecord
java.lang.Object
com.netscape.cmscore.dbs.DBRecord
com.netscape.cmscore.dbs.KeyRecord
- All Implemented Interfaces:
IAttrSet
,IDBObj
,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.
- Author:
- thomask
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
-
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 meta info.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
-
ATTR_ID
- See Also:
-
ATTR_STATE
- See Also:
-
ATTR_ALGORITHM
- See Also:
-
ATTR_KEY_SIZE
- See Also:
-
ATTR_OWNER_NAME
- See Also:
-
ATTR_PRIVATE_KEY_DATA
- See Also:
-
ATTR_PUBLIC_KEY_DATA
- See Also:
-
ATTR_DATE_OF_RECOVERY
- See Also:
-
ATTR_CREATE_TIME
- See Also:
-
ATTR_MODIFY_TIME
- See Also:
-
ATTR_META_INFO
- See Also:
-
ATTR_ARCHIVED_BY
- See Also:
-
ATTR_CLIENT_ID
- See Also:
-
ATTR_DATA_TYPE
- See Also:
-
ATTR_STATUS
- See Also:
-
ATTR_REALM
- See Also:
-
STATUS_ANY
- See Also:
-
STATUS_VALID
- See Also:
-
STATUS_INVALID
- See Also:
-
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
- Overrides:
set
in classDBRecord
- 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
- Overrides:
get
in classDBRecord
- Parameters:
name
- the name of the attribute to return.- Throws:
EBaseException
- on attribute handling errors.
-
delete
Deletes an attribute.- Specified by:
delete
in interfaceIAttrSet
- Overrides:
delete
in classDBRecord
- 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
- Overrides:
getElements
in classDBRecord
- Returns:
- an enumeration of the attribute names.
-
getSerializableAttrNames
Retrieves serializable attribute names.- Specified by:
getSerializableAttrNames
in interfaceIDBObj
- Overrides:
getSerializableAttrNames
in classDBRecord
- Returns:
- a list of serializable attribute names
-
getSerialNumber
Retrieves serial number of the key record. Each key record is uniquely identified by serial number.- Returns:
- serial number of this key record
- Throws:
EBaseException
- failed to retrieve key serial number
-
setSerialNumber
Sets serial number.- Throws:
EBaseException
-
getState
Retrieves the key state. This gives key life cycle information.- 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.- Returns:
- archiver uid
-
getPrivateKeyData
Retrieves key.- Returns:
- archived key
- Throws:
EBaseException
-
setPrivateKeyData
Sets key data.- Throws:
EBaseException
-
getKeySize
Retrieves the key size.- Returns:
- key size
- Throws:
EBaseException
- failed to retrieve key size
-
getMetaInfo
Retrieves the meta info.- Returns:
- meta info
-
setKeySize
Sets key size.- Throws:
EBaseException
-
getOwnerName
Retrieves owner name.- Returns:
- key owner name
- Throws:
EBaseException
- failed to retrieve key owner name
-
setOwnerName
Sets owner name.- Throws:
EBaseException
-
getPublicKeyData
Retrieves the public key.- 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.- Returns:
- revocation history
- Throws:
EBaseException
- failed to retrieve revocation history
-
setDateOfRevocation
Sets the date of revocation.- Throws:
EBaseException
-
getAlgorithm
Retrieves algorithm of the key pair.- Returns:
- key algorithm
-
getCreateTime
Retrieves the creation time of this record.- Returns:
- creation time
-
getModifyTime
Retrieves the last modification time of this record.- Returns:
- modification time
-
getClientId
Retrieves the client ID of this record.- Returns:
- client id
- Throws:
EBaseException
- failed to retrieve client id
-
getKeyStatus
Retrieves the key status of this record.- Returns:
- key status
- Throws:
EBaseException
- failed to retrieve key status
-
getDataType
Retrieves the key data type of this record.- Returns:
- data type
- Throws:
EBaseException
- failed to retrieve data type
-
getRealm
Retrieves authorization realm.- 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 - Throws:
Exception
-
getWrappingParams
public org.mozilla.jss.netscape.security.util.WrappingParams getWrappingParams(org.mozilla.jss.netscape.security.util.WrappingParams oldParams) throws Exception - Throws:
Exception
-
isEncrypted
- Throws:
EBaseException
-