extends Object
java.lang.Object | |
↳ | com.google.communication.businessmessaging.verifiedsms.hashing.VerifiedSmsHashCode |
Class Overview
Verified SMS hash code container that reflects the SmsHashCode part of the Verified SMS API.
A 1-1 mapping exists between VerifiedSmsHashCode
objects
returned by the getDigests(String)
class and the SmsHashCodes included in API calls to
https://verifiedsms.googleapis.com/v1/smsOrigins/+12223334444/create.
For example, in the sample JSON below, each object in the hashCodes array corresponds to a
VerifiedSmsHashCode
object.
Obtain the fullMessageHashCode, segmentsHashCodes and hashCodeVersion values from this class's
public functions getFullMessageHashCodeBase64Encoded()
,
getSegmentsHashCodesBase64Encoded()
,
and getHashCodeVersion()
.
See https://developers.google.com/business-communications/verified-sms/guides/learn/register-messages for full example.
'hashCodes': [ { 'fullMessageHashCode': 'jkfxGF_9AU0jj6vQKhoy3v5pjL84wDepDjwKCjI3D7UsvWQSUFCFAilfyry_Z2wJRwsnRDhoyOX3DibcM3KIrw==', 'segmentsHashCodes': [ 'mvi3PugBjPzXF7BvSqoNul6b8n23SZ7PWLgOv1V9k-wfpbbZRpbCcOt0SyrUFl3d7e48TfcvIcduDX4Q1vZF3g==' ], 'hashCodeVersion': 'v0' } ]
Summary
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Constructs hash code object.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Returns full message hash code.
| |||||||||||
Returns full message hash code encoded as base64 string.
| |||||||||||
Returns version of hash function that generated the code.
| |||||||||||
Returns list of hash codes for segments.
| |||||||||||
Returns list of hash codes for segments as base64 strings.
|
Public Constructors
public VerifiedSmsHashCode (byte[] fullMessageHashCode, List<byte[]> segmentsHashCodes, String hashCodeVersion)
Constructs hash code object.
Parameters | |
---|---|
fullMessageHashCode |
byte : Full message hash code. |
segmentsHashCodes |
List : List of hash codes for segments. |
hashCodeVersion |
String : Version of hash function that generated the code.
|
Public Methods
public byte[] getFullMessageHashCode ()
Returns full message hash code.
Returns | |
---|---|
byte[] |
public String getFullMessageHashCodeBase64Encoded ()
Returns full message hash code encoded as base64 string.
Returns | |
---|---|
String |
public String getHashCodeVersion ()
Returns version of hash function that generated the code.
Returns | |
---|---|
String |
public List<byte[]> getSegmentsHashCodes ()
Returns list of hash codes for segments.
Returns | |
---|---|
List<byte[]> |
public List<String> getSegmentsHashCodesBase64Encoded ()
Returns list of hash codes for segments as base64 strings.
Returns | |
---|---|
List<String> |