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 Plaintextempty()Factory method to create an emptyPlaintext.booleanbyte[]inthashCode()static Plaintextof(byte[] plaintext) Factory method to createPlaintextfrom a byte sequence.static Plaintextstatic Plaintextwith(VaultTransitContext context) Create a newPlaintextobject from this plain text associated with the givenVaultTransitContext.
-
Method Details
-
empty
Factory method to create an emptyPlaintext.- Returns:
- the empty
Plaintextobject. - Since:
- 1.1.2
-
of
Factory method to createPlaintextfrom a byte sequence.- Parameters:
plaintext- the plaintext to encrypt, must not be null.- Returns:
- the
Plaintextforplaintext.
-
of
Factory method to createPlaintextusing from aString.Stringis encoded tobyteusing the defaultCharset. Useof(String, java.nio.charset.Charset)to control theCharsetto use.- Parameters:
plaintext- the plaintext to encrypt, must not be null.- Returns:
- the
Plaintextforplaintext.
-
of
- Parameters:
plaintext- the plaintext to encrypt, must not be null.- Returns:
- the
Plaintextforplaintext. - Since:
- 2.3
-
getPlaintext
public byte[] getPlaintext() -
getContext
-
with
Create a newPlaintextobject from this plain text associated with the givenVaultTransitContext.- Parameters:
context- transit context.- Returns:
- the new
Plaintextobject.
-
asString
-
asString
-
equals
-
hashCode
public int hashCode()
-