@Mutable @ThreadSafety(level=NOT_THREADSAFE) public final class PassphraseEncryptedOutputStreamProperties extends java.lang.Object implements java.io.Serializable
PassphraseEncryptedOutputStream
. The default settings that will be
used for properties that are not required in the constructor are:
Constructor and Description |
---|
PassphraseEncryptedOutputStreamProperties(PassphraseEncryptionCipherType cipherType)
Creates a new
PassphraseEncryptedOutputStreamProperties instance
with the provided cipher type value. |
Modifier and Type | Method and Description |
---|---|
PassphraseEncryptionCipherType |
getCipherType()
Retrieves the cipher type value that will be used to obtain settings when
encrypting data.
|
int |
getKeyFactoryIterationCount()
Retrieves the iteration count that will be used when generating the
encryption key from the passphrase.
|
java.lang.String |
getKeyIdentifier()
Retrieves a key identifier that may be used to associate the encryption
details with information in another system.
|
void |
setKeyFactoryIterationCount(java.lang.Integer keyFactoryIterationCount)
Specifies the iteration count that will be used when generating the
encryption key from the passphrase.
|
void |
setKeyIdentifier(java.lang.String keyIdentifier)
Specifies a key identifier that may be used to associate the encryption
details with information in another system.
|
void |
setWriteHeaderToStream(boolean writeHeaderToStream)
Specifies whether the
PassphraseEncryptedOutputStream should write
the generated PassphraseEncryptedStreamHeader to the wrapped output
stream before starting the encrypted data so that a
PassphraseEncryptedInputStream can read it to obtain the necessary
information for decrypting the data. |
java.lang.String |
toString()
Retrieves a string representation of these properties.
|
void |
toString(java.lang.StringBuilder buffer)
Appends a string representation of these properties to the provided buffer.
|
boolean |
writeHeaderToStream()
Indicates whether the
PassphraseEncryptedOutputStream should write
the generated PassphraseEncryptedStreamHeader to the wrapped output
stream before starting the encrypted data so that a
PassphraseEncryptedInputStream can read it to obtain the necessary
information for decrypting the data. |
public PassphraseEncryptedOutputStreamProperties(@NotNull PassphraseEncryptionCipherType cipherType)
PassphraseEncryptedOutputStreamProperties
instance
with the provided cipher type value.cipherType
- The cipher type value that will be used to obtain
settings when encrypting data.@NotNull public PassphraseEncryptionCipherType getCipherType()
public boolean writeHeaderToStream()
PassphraseEncryptedOutputStream
should write
the generated PassphraseEncryptedStreamHeader
to the wrapped output
stream before starting the encrypted data so that a
PassphraseEncryptedInputStream
can read it to obtain the necessary
information for decrypting the data.true
if the PassphraseEncryptedOutputStream
should
write a PassphraseEncryptedStreamHeader
to the wrapped
output stream before any encrypted data, or false
if not.public void setWriteHeaderToStream(boolean writeHeaderToStream)
PassphraseEncryptedOutputStream
should write
the generated PassphraseEncryptedStreamHeader
to the wrapped output
stream before starting the encrypted data so that a
PassphraseEncryptedInputStream
can read it to obtain the necessary
information for decrypting the data. If this is false
, then the
necessary metadata should be stored elsewhere so that it can be used to
decrypt the data.writeHeaderToStream
- Indicates whether the
PassphraseEncryptedOutputStream
should
write the generated
PassphraseEncryptedStreamHeader
to the
wrapped output stream before starting the
encrypted data.public int getKeyFactoryIterationCount()
public void setKeyFactoryIterationCount(@Nullable java.lang.Integer keyFactoryIterationCount)
keyFactoryIterationCount
- The iteration count that will be used
when generating the encryption key from
the passphrase. If this is null
,
then the cipher type's key factory
iteration count will be used.@Nullable public java.lang.String getKeyIdentifier()
null
if no
key identifier should be used.public void setKeyIdentifier(@Nullable java.lang.String keyIdentifier)
keyIdentifier
- A key identifier that may be used to associate the
encryption details with information in another
system. It may be null
if no key identifier
should be used.@NotNull public java.lang.String toString()
toString
in class java.lang.Object