Class TransformPlaintext
java.lang.Object
org.springframework.vault.support.TransformPlaintext
Value object representing plain text with an optional
VaultTransformContext.
Plaintext is represented binary safe as byte[].- Since:
- 2.3
- Author:
- Lauren Voswinkel
-
Method Summary
Modifier and TypeMethodDescriptionasString()static TransformPlaintextempty()Factory method to create an emptyTransformPlaintext.booleanbyte[]inthashCode()static TransformPlaintextof(byte[] plaintext) Factory method to createTransformPlaintextfrom a byte sequence.static TransformPlaintextFactory method to createTransformPlaintextusing fromString.static TransformPlaintextwith(VaultTransformContext context) Create a newTransformPlaintextobject from this plaintext associated with the givenVaultTransformContext.
-
Method Details
-
empty
Factory method to create an emptyTransformPlaintext.- Returns:
- the empty
TransformPlaintextobject.
-
of
Factory method to createTransformPlaintextfrom a byte sequence.- Parameters:
plaintext- the plain text to encrypt, must not be null.- Returns:
- the
TransformPlaintextforplaintext.
-
of
Factory method to createTransformPlaintextusing fromString.Stringis encoded tobyteusing the defaultCharset.- Parameters:
plaintext- the plain text to encrypt, must not be null.- Returns:
- the
TransformPlaintextforplaintext.
-
of
- Parameters:
plaintext- the plaintext to encrypt, must not be null.- Returns:
- the
Plaintextforplaintext.
-
getPlaintext
public byte[] getPlaintext() -
getContext
-
with
Create a newTransformPlaintextobject from this plaintext associated with the givenVaultTransformContext.- Parameters:
context- transform context.- Returns:
- the new
TransformPlaintextobject.
-
asString
-
asString
-
equals
-
hashCode
public int hashCode()
-