Package com.unboundid.util
Class PassphraseEncryptedOutputStreamProperties
java.lang.Object
com.unboundid.util.PassphraseEncryptedOutputStreamProperties
- All Implemented Interfaces:
Serializable
@Mutable
@ThreadSafety(level=NOT_THREADSAFE)
public final class PassphraseEncryptedOutputStreamProperties
extends Object
implements Serializable
This class provides a set of properties that will be used when creating a
PassphraseEncryptedOutputStream. The default settings that will be
used for properties that are not required in the constructor are:
- The header will be written to the beginning of the output stream.
- The cipher type's key factory iteration count will be used.
- No key identifier will be included in the encryption header.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a newPassphraseEncryptedOutputStreamPropertiesinstance with the provided cipher type value. -
Method Summary
Modifier and TypeMethodDescriptionRetrieves the cipher type value that will be used to obtain settings when encrypting data.intRetrieves the iteration count that will be used when generating the encryption key from the passphrase.Retrieves a key identifier that may be used to associate the encryption details with information in another system.voidsetKeyFactoryIterationCount(Integer keyFactoryIterationCount) Specifies the iteration count that will be used when generating the encryption key from the passphrase.voidsetKeyIdentifier(String keyIdentifier) Specifies a key identifier that may be used to associate the encryption details with information in another system.voidsetWriteHeaderToStream(boolean writeHeaderToStream) Specifies whether thePassphraseEncryptedOutputStreamshould write the generatedPassphraseEncryptedStreamHeaderto the wrapped output stream before starting the encrypted data so that aPassphraseEncryptedInputStreamcan read it to obtain the necessary information for decrypting the data.toString()Retrieves a string representation of these properties.voidtoString(StringBuilder buffer) Appends a string representation of these properties to the provided buffer.booleanIndicates whether thePassphraseEncryptedOutputStreamshould write the generatedPassphraseEncryptedStreamHeaderto the wrapped output stream before starting the encrypted data so that aPassphraseEncryptedInputStreamcan read it to obtain the necessary information for decrypting the data.
-
Constructor Details
-
PassphraseEncryptedOutputStreamProperties
public PassphraseEncryptedOutputStreamProperties(@NotNull PassphraseEncryptionCipherType cipherType) Creates a newPassphraseEncryptedOutputStreamPropertiesinstance with the provided cipher type value.- Parameters:
cipherType- The cipher type value that will be used to obtain settings when encrypting data.
-
-
Method Details
-
getCipherType
Retrieves the cipher type value that will be used to obtain settings when encrypting data.- Returns:
- The cipher type value that will be used to obtain settings when encrypting data.
-
writeHeaderToStream
Indicates whether thePassphraseEncryptedOutputStreamshould write the generatedPassphraseEncryptedStreamHeaderto the wrapped output stream before starting the encrypted data so that aPassphraseEncryptedInputStreamcan read it to obtain the necessary information for decrypting the data.- Returns:
trueif thePassphraseEncryptedOutputStreamshould write aPassphraseEncryptedStreamHeaderto the wrapped output stream before any encrypted data, orfalseif not.
-
setWriteHeaderToStream
Specifies whether thePassphraseEncryptedOutputStreamshould write the generatedPassphraseEncryptedStreamHeaderto the wrapped output stream before starting the encrypted data so that aPassphraseEncryptedInputStreamcan read it to obtain the necessary information for decrypting the data. If this isfalse, then the necessary metadata should be stored elsewhere so that it can be used to decrypt the data.- Parameters:
writeHeaderToStream- Indicates whether thePassphraseEncryptedOutputStreamshould write the generatedPassphraseEncryptedStreamHeaderto the wrapped output stream before starting the encrypted data.
-
getKeyFactoryIterationCount
Retrieves the iteration count that will be used when generating the encryption key from the passphrase.- Returns:
- The iteration count that will be used when generating the encryption key from the passphrase.
-
setKeyFactoryIterationCount
Specifies the iteration count that will be used when generating the encryption key from the passphrase.- Parameters:
keyFactoryIterationCount- The iteration count that will be used when generating the encryption key from the passphrase. If this isnull, then the cipher type's key factory iteration count will be used.
-
getKeyIdentifier
Retrieves a key identifier that may be used to associate the encryption details with information in another system. This is primarily intended for use in conjunction with the UnboundID/Ping Identity server products, but it may be useful in other systems as well.- Returns:
- A key identifier that may be used to associate the encryption
details with information in another system, or
nullif no key identifier should be used.
-
setKeyIdentifier
Specifies a key identifier that may be used to associate the encryption details with information in another system. This is primarily intended for use in conjunction with the UnboundID/Ping Identity server products, but it may be useful in other systems as well.- Parameters:
keyIdentifier- A key identifier that may be used to associate the encryption details with information in another system. It may benullif no key identifier should be used.
-
toString
Retrieves a string representation of these properties. -
toString
Appends a string representation of these properties to the provided buffer.- Parameters:
buffer- The buffer to which the properties should be appended.
-