Skip to content

interface IDataProtector

cangjie
public interface IDataProtector <: IDataProtectionProvider

功能:定义数据加密与解密能力的保护器接口。

父类型:

成员概览

成员功能
func protect(Array<Byte>)保护明文字节数组。
func unprotect(Array<Byte>)还原受保护的字节数组。

func protect(Array<Byte>)

cangjie
func protect(plaintext: Array<Byte>): Array<Byte>

功能:保护明文字节数组。

参数:

  • plaintext: Array<Byte> - 需要保护的明文字节数组。

返回值:

  • Array<Byte> - 返回加密后的字节数组。

func unprotect(Array<Byte>)

cangjie
func unprotect(ciphertext: Array<Byte>): Array<Byte>

功能:还原受保护的字节数组。

参数:

  • ciphertext: Array<Byte> - 受保护的字节数组。

返回值:

  • Array<Byte> - 返回解密后的明文字节数组。