Files
CustomPlugin/Libs/CredibleAuthSDK.framework/Headers/NSString+KYSM4.h
2023-04-13 17:23:15 +08:00

58 lines
1.3 KiB
Objective-C
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

//
// NSString+KYSM4.h
// Hug
//
// Created by WJT on 2018/6/11.
// Copyright © 2018年 WJT. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface NSString (KYSM4)
/**
* 使用密钥和初始化向量生成CBC模式的SM4加解密对象
*
* @param secretKey 密钥
* @param iv 初始化向量
*
* @return SM4加密字符串
*/
- (nullable NSString *)encryptionWithSM4Key:(nonnull NSString *)secretKey iv:(nonnull NSString *)iv;
/**
在CBC模式下利用给定的密钥初始化向量对字符串解密
@param secretKey 密钥
@param iv 初始化向量
@return SM4解密字符串
*/
- (nullable NSString *)decryptionWithSM4Key:(nonnull NSString *)secretKey iv:(nonnull NSString *)iv;
/**
* 使用密钥生成ECB模式的SM4加解密对象
*
* @param secretKey 密钥
*
* @return SM4加解密对象
*/
- (nullable NSString *)encryptionWithSM4Key:(nonnull NSString *)secretKey;
/**
* 在ECB模式下利用给定的密钥对字符串解密
*
* @param secretKey 密钥
*
* @return SM4解密字符串
*/
- (nullable NSString *)decryptionWithSM4Key:(nonnull NSString *)secretKey;
/**
* hmacSM3加密
*
* @param secretKey 密钥
*
* @return hmacSM3加密字符串
*/
- (nullable NSString *)encryptionWithSM3Key:(nonnull NSString *)secretKey;
@end