|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.security.Identity
java.security.IdentityScope
com.ibm.crypto.provider.IdentityDatabase
public class IdentityDatabase
An implementation of IdentityScope as a persistent identity database.
Identity
,
Key
,
Serialized FormConstructor Summary | |
---|---|
IdentityDatabase(File file)
Construct a new, empty database with a specified source file. |
|
IdentityDatabase(String name)
Construct a new, empty database. |
Method Summary | |
---|---|
void |
addIdentity(Identity identity)
Adds an identity to the database. |
static IdentityDatabase |
fromFile(File f)
Initialize an IdentityDatabase from file. |
static IdentityDatabase |
fromStream(InputStream is)
Initialize an identity database from a stream. |
Identity |
getIdentity(PublicKey key)
Get an identity by key. |
Identity |
getIdentity(String name)
|
Enumeration |
identities()
|
void |
removeIdentity(Identity identity)
Removes an identity to the database. |
void |
save()
Saves the database to the default source file. |
void |
save(OutputStream os)
Save the database in its current state to an output stream. |
int |
size()
|
String |
toString()
|
Methods inherited from class java.security.IdentityScope |
---|
getIdentity, getSystemScope, setSystemScope |
Methods inherited from class java.security.Identity |
---|
addCertificate, certificates, equals, getInfo, getName, getPublicKey, getScope, hashCode, identityEquals, removeCertificate, setInfo, setPublicKey, toString |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public IdentityDatabase(File file) throws InvalidParameterException
file
- the source file.
InvalidParameterException
public IdentityDatabase(String name) throws InvalidParameterException
InvalidParameterException
Method Detail |
---|
public static IdentityDatabase fromStream(InputStream is) throws IOException
is
- the input stream from which to restore the database.
IOException
- if a stream IO exception occurspublic static IdentityDatabase fromFile(File f) throws IOException
f
- the filename where the identity database is stored.
IOException
- a file-related exception occurs (e.g.
the directory of the file passed does not exists, etc.public int size()
size
in class IdentityScope
public Identity getIdentity(String name)
getIdentity
in class IdentityScope
name
- the name of the identity to be retrieved.
public Identity getIdentity(PublicKey key)
getIdentity
in class IdentityScope
name
- the key of the identity to be retrieved.
public void addIdentity(Identity identity) throws KeyManagementException
addIdentity
in class IdentityScope
identity
- the identity to be added.
KeyManagementException
- if a name or key clash
occurs, or if another exception occurs.public void removeIdentity(Identity identity) throws KeyManagementException
removeIdentity
in class IdentityScope
KeyManagementException
public Enumeration identities()
identities
in class IdentityScope
public void save(OutputStream os) throws IOException
os
- the output stream to which the database should be serialized.
IOException
- if an IO exception is raised by stream
operations.public void save() throws IOException
IOException
- when there is no default source
file specified for this database.public String toString()
toString
in interface Principal
toString
in class IdentityScope
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |