Package co.cryptoservice.sdk
Record Class KmsEncryptRequest
java.lang.Object
java.lang.Record
co.cryptoservice.sdk.KmsEncryptRequest
- Record Components:
keyId- the server-held key's identifierplaintext- the plaintext, as UTF-8 textencoding- how plaintext is encoded, or null for UTF-8provider- the KMS provider, or null for the defaultcontext- the encryption context, or null
public record KmsEncryptRequest(String keyId, String plaintext, KmsEncoding encoding, String provider, Map<String,String> context)
extends Record
The body of
POST /v2/kms/encrypt.-
Constructor Summary
ConstructorsConstructorDescriptionKmsEncryptRequest(String keyId, String plaintext, KmsEncoding encoding, String provider, Map<String, String> context) Checks that every required member is present. -
Method Summary
Modifier and TypeMethodDescriptioncontext()Returns the value of thecontextrecord component.encoding()Returns the value of theencodingrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.keyId()Returns the value of thekeyIdrecord component.static KmsEncryptRequestA request with only the required members; the optional ones are null.Returns the value of theplaintextrecord component.provider()Returns the value of theproviderrecord component.toString()Names the members; values that may be secret (keys, plaintexts, passwords, signatures) are redacted.withContext(Map<String, String> context) A copy withcontextreplaced.withEncoding(KmsEncoding encoding) A copy withencodingreplaced.withProvider(String provider) A copy withproviderreplaced.
-
Constructor Details
-
KmsEncryptRequest
public KmsEncryptRequest(String keyId, String plaintext, KmsEncoding encoding, String provider, Map<String, String> context) Checks that every required member is present.- Throws:
NullPointerException- when a required member is null
-
-
Method Details
-
of
A request with only the required members; the optional ones are null.- Parameters:
keyId- the server-held key's identifierplaintext- the plaintext, as UTF-8 text- Returns:
- the request
-
withEncoding
A copy withencodingreplaced.- Parameters:
encoding- how plaintext is encoded, or null for UTF-8- Returns:
- the new request
-
withProvider
A copy withproviderreplaced.- Parameters:
provider- the KMS provider, or null for the default- Returns:
- the new request
-
withContext
A copy withcontextreplaced.- Parameters:
context- the encryption context, or null- Returns:
- the new request
-
toString
Names the members; values that may be secret (keys, plaintexts, passwords, signatures) are redacted. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
keyId
Returns the value of thekeyIdrecord component.- Returns:
- the value of the
keyIdrecord component
-
plaintext
Returns the value of theplaintextrecord component.- Returns:
- the value of the
plaintextrecord component
-
encoding
Returns the value of theencodingrecord component.- Returns:
- the value of the
encodingrecord component
-
provider
Returns the value of theproviderrecord component.- Returns:
- the value of the
providerrecord component
-
context
Returns the value of thecontextrecord component.- Returns:
- the value of the
contextrecord component
-