OScript API/Built-in Package Index

Class: Cloud

The built-in functions in the Cloud Package allow cloud storage provider authentication operations to be performed for AWS and GCP.

The Cloud Package offers the following functionality:

Class Methods

Sha256Hash( String data, Boolean bHex )

Generate SHA-256 hash string.

SignAWS4Key( String key, String dataTimeStamp, String regionName, String serviceName, String canonicalRequest )

Sign an AWS4 key for Amazon cloud access.

Class Methods

Sha256Hash

String Sha256Hash( String data,
                   Boolean bHex )

Compute the SHA-256 hash of an input string and return the output..

Parameters

data

input string that is to be hashed.

bHex

should the return string to be converted to hex string.

Returns:

SHA-256 hashed string.

SignAWS4Key

KOSValue SignAWS4Key( String key,
                      String dataTimeStamp,
                      String regionName,
                      String serviceName,
                      String canonicalRequest )

Sign a version 4 key for Amazon Web Services, based on a secret key.

Parameters

key

secret key.

dataTimeStamp

dataTimeStamp string.

regionName

region name for the AWS authentication.

serviceName

service name for the AWS authentication.

canonicalRequest

Raw canonicalRequest string for the AWS authentication.

Returns:

A hex string that is the final signature used for AWS authentication.

 Copyright © 2021 OpenText Corporation. All rights reserved.