public class Plaintext extends Object
VaultTransitContext
.
Plaintext is represented binary safe as byte[]
.Modifier and Type | Method and Description |
---|---|
String |
asString() |
String |
asString(Charset charset) |
static Plaintext |
empty()
Factory method to create an empty
Plaintext . |
boolean |
equals(Object o) |
VaultTransitContext |
getContext() |
byte[] |
getPlaintext() |
int |
hashCode() |
static Plaintext |
of(byte[] plaintext)
Factory method to create
Plaintext from a byte sequence. |
static Plaintext |
of(String plaintext)
|
static Plaintext |
of(String plaintext,
Charset charset)
|
Plaintext |
with(VaultTransitContext context)
Create a new
Plaintext object from this plain text associated with the
given VaultTransitContext . |
public static Plaintext empty()
Plaintext
.Plaintext
object.public static Plaintext of(byte[] plaintext)
Plaintext
from a byte sequence.plaintext
- the plaintext to encrypt, must not be null.Plaintext
for plaintext
.public static Plaintext of(String plaintext)
Plaintext
using from a String
.
String
is encoded to byte
using the default
Charset
. Use of(String, java.nio.charset.Charset)
to control the Charset
to use.plaintext
- the plaintext to encrypt, must not be null.Plaintext
for plaintext
.public static Plaintext of(String plaintext, Charset charset)
plaintext
- the plaintext to encrypt, must not be null.Plaintext
for plaintext
.public byte[] getPlaintext()
public VaultTransitContext getContext()
public Plaintext with(VaultTransitContext context)
Plaintext
object from this plain text associated with the
given VaultTransitContext
.context
- transit context.Plaintext
object.public String asString()
Copyright © 2016–2022 Pivotal Software, Inc.. All rights reserved.