Here you can find the source of encodeSignatureUtf8(byte[] sig)
Parameter | Description |
---|---|
sig | the HMAC-SHA256 encrypted, Base64-encoded signature. |
public static String encodeSignatureUtf8(byte[] sig)
//package com.java2s; // Licensed under the MIT license. See LICENSE file in the project root for full license information. import java.nio.charset.Charset; import java.nio.charset.StandardCharsets; public class Main { /** The charset used for the raw and hashed signature. */ public static final Charset SIGNATURE_CHARSET = StandardCharsets.UTF_8; /**//from w ww . j a v a 2 s . co m * Encodes the signature using charset UTF-8. * * @param sig the HMAC-SHA256 encrypted, Base64-encoded signature. * * @return the signature encoded using charset UTF-8. */ public static String encodeSignatureUtf8(byte[] sig) { // Codes_SRS_SIGNATUREHELPER_11_010: [The function shall encode the signature using charset UTF-8.] return new String(sig, SIGNATURE_CHARSET); } }