//
//  AliyunNetworkEncryptor.h
//  AliyunIdentityNetwork
//
//  Copyright © 2024 aliyun.com. All rights reserved.
//

#import <Foundation/Foundation.h>

NS_ASSUME_NONNULL_BEGIN

/**
 * 网络层加密工具
 * 提供 SM4 加解密、数据 HASH 等能力。
 */
@interface AliyunNetworkEncryptor : NSObject

/// 国密 SM4 加密
+ (NSString *)sm4_encrypt_9_helper:(NSString *)plainText withKey:(NSString *)key;

/// 国密 SM4 解密
+ (NSString *)sm4_decrypt_9_helper:(NSString *)plainText withKey:(NSString *)key;

/// 计算 NSData HMAC-SHA256 HASH
+ (NSData *)calc_data_hash:(NSData *)src;

/// bytes 转 hex string
+ (NSString *)dataToHexString:(NSData *)src;

/// base64 解码
+ (NSString *)base64Decode:(NSString *)src;

@end

NS_ASSUME_NONNULL_END
