public final class FilenameProfileWriter extends CredentialWriter
The following credential readers can all be used with this credential writer:
CredentialCreatorCredentialRecovererFilenameProfileReaderPKCS12ReaderStreamProfileReaderRoamingCredentialReaderBelow is an example of how a user's Digital Identity can be logged into and then written (all capitalized values must be provided by the user):
User user = new User(); JNDIDirectory directory = new JNDIDirectory(DIRECTORY_IP, DIRECTORY_PORT); ManagerTransport transport = new ManagerTransport(MANAGER_IP, MANAGER_PORT); user.setConnections(directory, transport); SecureStringBuffer securePassword = new SecureStringBuffer(PASSWORD); CredentialReader credentialReader = new FilenameProfileReader(EPF_FILE_NAME); CredentialWriter credentialWriter = new FilenameProfileWriter(EPF_FILE_NAME); user.setCredentialWriter(credentialWriter); user.login(credentialReader, securePassword); user.write();
| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_HASH_COUNT
The default hash count; this is the number of iterations used by default
when deriving the Entrust Digital Identity protection key.
|
static java.lang.String |
DEFAULT_PROTECTION_ALGORITHM
The default EPF protection algorithm.
|
static int |
MINIMUM_HASH_COUNT
The minimum hash count; this is the minimum number of iterations allowed
when deriving the Entrust Digital Identity protection key.
|
| Modifier | Constructor and Description |
|---|---|
|
FilenameProfileWriter(java.lang.String fileName)
Creates a
FilenameProfileWriter object. |
|
FilenameProfileWriter(java.lang.String fileName,
int hashCount)
Creates a
FilenameProfileWriter object. |
protected |
FilenameProfileWriter(java.lang.String fileName,
java.lang.String protectionAlgorithm,
int hashCount)
Deprecated.
use
FilenameProfileWriter(String, int)
Note, the protectionAlgorithm is no longer used by the toolkit. The protection
algorithm is read by using the Client Settings profile protection policy.
The scope is updated to protected and should only be used for internal testing. |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getType()
Returns the type (name) of this specific credential writer, which is
"FilenameProfileWriter".
|
boolean |
setCredentialAccess(FilePermissions.FILE_ACCESS access)
Set the file permissions for new Entrust profile format (EPF) files.
|
boolean |
setCredentialAccess(FilePermissions.FILE_ACCESS access,
boolean writable)
Similar to the
setCredentialAccess(FILE_ACCESS access) method,
this method sets the file permissions on new Entrust EPF files, but also
allows write access to be provided to (operating system) userids other than the owner. |
addConfiguration, writePossiblepublic static final java.lang.String DEFAULT_PROTECTION_ALGORITHM
public static final int DEFAULT_HASH_COUNT
public static final int MINIMUM_HASH_COUNT
public FilenameProfileWriter(java.lang.String fileName)
FilenameProfileWriter object.
When used to create a credential writer that will be used for writing an
existing Entrust Digital Identity store that already contains EPF protection
values (read using a FilenameProfileReader or
StreamProfileReader), the EPF will be protected with the values
read from the EPF.
When used to create a credential writer that will be used for writing a
new Entrust Digital Identity (read using a CredentialCreator or
CredentialRecoverer) or an existing Entrust Digital Identity
store that does not contain EPF protection values (read using a
PKCS12Reader), the EPF is automatically
protected using the protection values specified by the Client Settings
profile protection policy. The has count is not required, and when missing
or zero, DEFAULT_HASH_COUNT) is automatically used.
fileName - the name of the EPF file where the user's Digital Identity will be
written (usually has a .epf filename extension)java.lang.IllegalArgumentException - thrown if any of the required parameters are null, or
fileName does not represent a file or represents a file
that cannot be written toprotected FilenameProfileWriter(java.lang.String fileName,
java.lang.String protectionAlgorithm,
int hashCount)
FilenameProfileWriter(String, int)
Note, the protectionAlgorithm is no longer used by the toolkit. The protection
algorithm is read by using the Client Settings profile protection policy.
The scope is updated to protected and should only be used for internal testing.fileName - the name of the EPF file where the user's Digital Identity will be
written (usually has a .epf filename extension)protectionAlgorithm - the algorithm used to protect the EPF; only the algorithms defined
in EntrustProfileProtectionAlgorithms are supported
(OPTIONAL)hashCount - the number of iterations used by when deriving the EPF protection key;
must be no less than MINIMUM_HASH_COUNT (OPTIONAL)java.lang.IllegalArgumentException - thrown if any of the required parameters are null,
fileName does not represent a file or represents a file
that cannot be written to, or the EPF protection parameters are invalidEntrustProfileProtectionAlgorithmspublic FilenameProfileWriter(java.lang.String fileName,
int hashCount)
FilenameProfileWriter object.
When used to create a credential writer that will be used for writing an
existing Entrust Digital Identity store that already contains EPF protection
values (read using a FilenameProfileReader or
StreamProfileReader), and the EPF protection values
(protectionAlgorithm, hashCount) are not set, the EPF will be protected with
the values read from the EPF.
When used to create a credential writer that will be used for writing a
new Entrust Digital Identity store (read using a
CredentialCreator or CredentialRecoverer) or an
existing Entrust Digital Identity store that does not contain EPF protection
values (read using a PKCS12Reader), the EPF is automatically
protected using the protection values specified by the Client Settings
profile protection policy. The has count is not required, and when missing
or zero, DEFAULT_HASH_COUNT) is automatically used.
fileName - the name of the EPF file where the user's Digital Identity will be
written (usually has a .epf filename extension)hashCount - the number of iterations used by when deriving the EPF protection key;
must be no less than MINIMUM_HASH_COUNT (OPTIONAL)java.lang.IllegalArgumentException - thrown if any of the required parameters are null,
fileName does not represent a file or represents a file
that cannot be written to, or the EPF protection parameters are invalidEntrustProfileProtectionAlgorithmspublic java.lang.String getType()
getType in class CredentialWriterpublic boolean setCredentialAccess(FilePermissions.FILE_ACCESS access) throws UserFatalException
The permissions that can be set on a file are dependent on the capabilities of the underlying operating system. Therefore, an access level (such as OWNER) will have a similar but slightly different implementation depending on the operating system. Two models of file permissions are supported:
The read-write file permissions that are associated with the different access levels, for these two models, are described below.
OWNER level:
GROUP and ALL levels:
SYSTEM_DEFAULT level:
The default is OWNER level. That is, if setCredentialAccess() is not
called, then OWNER level will be used.
The system wide default can be changed to SYSTEM_DEFAULT by setting the following custom JVM boolean property that is supported by the Entrust Java Toolkit: com.entrust.toolkit.security.file.permissions.systemDefault. (For example, by configuring -Dcom.entrust.toolkit.security.file.permissions.systemDefault=true).
access - The level of access that should be set on the new EPF fileUserFatalExceptionpublic boolean setCredentialAccess(FilePermissions.FILE_ACCESS access, boolean writable) throws UserFatalException
setCredentialAccess(FILE_ACCESS access) method,
this method sets the file permissions on new Entrust EPF files, but also
allows write access to be provided to (operating system) userids other than the owner.
This may be required if other userids have been granted access to the credential and
should be allowed to perform an update during a login.access - The level of access that should be set on the new EPF filewritable - Applies only to GROUP and ALL on POSIX systems, otherwise this
setting is ignored.
Indicates if 'group' and 'other' users should have write access
to the EPF file. (The owner always has write access to the file.)
(That is, 'rw-rw----' or 'rw-rw-rw-' would be set.)UserFatalException