|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.rsa.certj.Provider | +--com.rsa.certj.provider.db.FlatFileDB
This class implements a database service provider that stores data in a simple flat file database.
In the database directory are four subdirectories:certs
, crls
,
privs
and pubs
, storing
certificates, CRLs, private keys, and public keys respectively.
The length of file names and the length of
name prefixes can be selected. The following
description assumes that the length of file names is 8 characters,
with the first 2 characters indicating the prefix. Prefixes are
used to distinguish different entities that share the same hash
value.
The FlatFileDB
database provider stores data in the
following manner:
Certificates
abcdef
in
the bottom 3 bytes of the hash
value is stored in certs/02abcdef.cer
.
abcdef
in
the bottom 3 bytes of the hash
value is stored in crls/02abcdef.crl
.
pubs/00abcdef.pub
, the corresponing private
key is stored in privs/00abcdef.prv
. The file
name for a key pair is determined as follows:
pubs
directory
using the file type pub
and private keys are
stored in the privs
directory using the file
type prv
.
FlatFileDB
object,
you supply a password to be used
for private key operations during that session. Each time a
private key is inserted into the database, it is encrypted using
the password. When a private key is retrieved from the database,
the database provider attempts to decrypt the record using the
supplied password; if the decryption succeeds, the private key is
returned.
Copyright © RSA Security Inc., 1999-2001. All rights reserved.
Field Summary |
|
static int |
DEFAULT_BASE_NAME_LEN
An |
static int |
DEFAULT_PREFIX_LEN
An |
Constructor Summary |
|
FlatFileDB(String name,
File path,
char[] passphrase)
Constructs a |
|
FlatFileDB(String name,
File path,
char[] passphrase,
int baseNameLen,
int prefixLen)
Constructs a |
|
FlatFileDB(String name,
String pathString,
char[] passphrase)
Constructs a |
|
FlatFileDB(String name,
String pathString,
char[] passphrase,
int baseNameLen,
int prefixLen)
Constructs a |
Method Summary |
|
static boolean |
create(File path)
Creates |
static boolean |
create(String pathString)
Creates |
static boolean |
delete(File path)
Deletes |
static boolean |
delete(String pathString)
Deletes |
instantiate(CertJ certJ)
Creates a |
Methods inherited from class com.rsa.certj.Provider |
getName, getType |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int DEFAULT_BASE_NAME_LEN
int
indicating the default base name
length for database file names.
This value is used when you construct a FlatFileDB
object by using a constructor that does not take a base name
length as an argument.public static final int DEFAULT_PREFIX_LEN
int
indicating the default prefix
length for database file names.
This value is used when you construct a FlatFileDB
object by using a constructor that does not take a prefix
length as an argument.Constructor Detail |
public FlatFileDB(String name, String pathString, char[] passphrase) throws InvalidParameterException
FlatFileDB
object.
The location of the database is given as a String
.
The default values (DEFAULT_BASE_NAME_LEN
and DEFAULT_PREFIX_LEN
) will be used for
the length of the base name and the length of the prefix
of file names.Parameters
name | A | ||
pathString | A | ||
passphrase | A |
Throws
InvalidParameterException
- If any
argument is invalid.public FlatFileDB(String name, File path, char[] passphrase) throws InvalidParameterException
FlatFileDB
object. The location of
the database is given as a File
. The default
values (DEFAULT_BASE_NAME_LEN
and
DEFAULT_PREFIX_LEN
) will
be used for the length of the base name and the length of the
prefix of file names.Parameters
name | A | ||
path | A | ||
passphrase | A |
Throws
InvalidParameterException
- If any
argument is invalid.public FlatFileDB(String name, String pathString, char[] passphrase, int baseNameLen, int prefixLen) throws InvalidParameterException
FlatFileDB
object.
The location of database
is given as a String
and the length of the base
name and length of the prefix are given by the arguments.Parameters
name | A | ||
pathString | A | ||
passphrase | A | ||
baseNameLen | An | ||
prefixLen | An |
Throws
InvalidParameterException
- If any
argument is invalid.public FlatFileDB(String name, File path, char[] passphrase, int baseNameLen, int prefixLen) throws InvalidParameterException
FlatFileDB
object.
The location of database
is given as a File
and the length of the base name
and length of the prefix are given by the arguments.Parameters
name | A | ||
path | A | ||
passphrase | A | ||
baseNameLen | An | ||
prefixLen | An |
Throws
InvalidParameterException
- If any
argument is invalid.Method Detail |
public static boolean create(String pathString) throws InvalidParameterException
FlatFileDB
database directories, in
a location specified by path when path is a
String
.Parameters
pathString | A |
Returns
boolean
that indicates whether the
database was created successfully.
Throws
InvalidParameterException
- If
pathString is null
.public static boolean create(File path) throws InvalidParameterException
FlatFileDB
database directories, in
a location specified by path when path is a
File
.Parameters
path | A |
Returns
boolean
that indicates whether the
database was created successfully.
Throws
InvalidParameterException
- If
path is null
.public static boolean delete(String pathString) throws InvalidParameterException
FlatFileDB
database
files located at path
given as a String
.Parameters
pathString | A |
Returns
boolean
that indicates whether the
database was deleted successfully.
Throws
InvalidParameterException
- If
pathString is null
.public static boolean delete(File path) throws InvalidParameterException
FlatFileDB
database
files located at path
given as a File
.Parameters
path | A |
Returns
boolean
that indicates whether the
database was deleted successfully.
Throws
InvalidParameterException
- If
path is null
.public ProviderImplementation instantiate(CertJ certJ) throws ProviderManagementException
ProviderImplementation
object that
handles flat-file database SPI methods.
This method is called by CertJ.registerService
when
an object of the FlatFileDB
class is being
registered and applications do not have to call this method.Overrides
instantiate
in class Provider
Parameters
certJ | A |
Returns
ProviderImplementation
object that
handles the flat file database SPI implementation.
Throws
ProviderManagementException
- If
instantiation of the flat file database provider fails.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |