Class Plaintext
java.lang.Object
org.springframework.vault.support.Plaintext
Value object representing plain text with an optional
VaultTransitContext
.
Plaintext is represented binary safe as byte[]
.- Since:
- 1.1
- Author:
- Praveendra Singh, Mark Paluch
-
Method Summary
Modifier and TypeMethodDescriptionasString()
static Plaintext
empty()
Factory method to create an emptyPlaintext
.boolean
byte[]
int
hashCode()
static Plaintext
of
(byte[] plaintext) Factory method to createPlaintext
from a byte sequence.static Plaintext
static Plaintext
with
(VaultTransitContext context) Create a newPlaintext
object from this plain text associated with the givenVaultTransitContext
.
-
Method Details
-
empty
Factory method to create an emptyPlaintext
.- Returns:
- the empty
Plaintext
object. - Since:
- 1.1.2
-
of
Factory method to createPlaintext
from a byte sequence.- Parameters:
plaintext
- the plaintext to encrypt, must not be null.- Returns:
- the
Plaintext
forplaintext
.
-
of
Factory method to createPlaintext
using from aString
.String
is encoded tobyte
using the defaultCharset
. Useof(String, java.nio.charset.Charset)
to control theCharset
to use.- Parameters:
plaintext
- the plaintext to encrypt, must not be null.- Returns:
- the
Plaintext
forplaintext
.
-
of
- Parameters:
plaintext
- the plaintext to encrypt, must not be null.- Returns:
- the
Plaintext
forplaintext
. - Since:
- 2.3
-
getPlaintext
public byte[] getPlaintext() -
getContext
-
with
Create a newPlaintext
object from this plain text associated with the givenVaultTransitContext
.- Parameters:
context
- transit context.- Returns:
- the new
Plaintext
object.
-
asString
-
asString
-
equals
-
hashCode
public int hashCode()
-