VerifiedSmsHashCode

public class VerifiedSmsHashCode
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'
  }
]

See https://developers.google.com/business-communications/verified-sms/reference/rest/v1/smsOrigins.create#SmsHashCode

Summary

Public Constructors
VerifiedSmsHashCode(byte[] fullMessageHashCode, List<byte[]> segmentsHashCodes, String hashCodeVersion)
Constructs hash code object.
Public Methods
byte[] getFullMessageHashCode()
Returns full message hash code.
String getFullMessageHashCodeBase64Encoded()
Returns full message hash code encoded as base64 string.
String getHashCodeVersion()
Returns version of hash function that generated the code.
List<byte[]> getSegmentsHashCodes()
Returns list of hash codes for segments.
List<String> getSegmentsHashCodesBase64Encoded()
Returns list of hash codes for segments as base64 strings.
Inherited Methods
From class java.lang.Object
boolean equals(Object arg0)
final Class<?> getClass()
int hashCode()
final void notify()
final void notifyAll()
String toString()
final void wait(long arg0, int arg1)
final void wait(long arg0)
final void wait()

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>