结构体
struct OperationMode
public struct OperationMode <: ToString & Equatable<OperationMode>
功能: 对称加解密算法的工作模式。
父类型:
static let ECB
public static let ECB
功能:Electronic CodeBook(单子密码本)工作模式。
static let CBC
public static let CBC
功能:Cipher Block Chaining(密码分组链接)工作模式。
static let OFB
public static let OFB
功能:Output FeedBack(输出反馈)工作模式。
static let CFB
public static let CFB
功能:Output FeedBack(密文反馈)工作模式。
static let CTR
public static let CTR
功能:CounTeR(计数器)工作模式。
static let GCM
public static let GCM
功能:Galois Counter(伽罗瓦计数器)工作模式。
let mode
public let mode: String
功能:operation 分组加解密的工作模式,目前支持 ECB、CBC CFB OFB CTR GCM。
类型:String
func toString()
public override func toString(): String
功能:获取工作模式字符串。
返回值:
- String - 工作模式字符串。
func ==(OperationMode)
public operator override func ==(other: OperationMode): Bool
功能:工作模式比较是否相同。
参数:
- other: OperationMode - 工作模式。
返回值:
- Bool - true 相同, false不相同。
func !=(OperationMode)
public operator override func !=(other: OperationMode): Bool
功能:工作模式比较是否不相同。
参数:
- other: OperationMode - 工作模式。
返回值:
- Bool - true 不相同, false相同。
struct PaddingMode
public struct PaddingMode <: Equatable<PaddingMode>
功能: 对称加解密算法的工填充模式。
父类型:
static let NoPadding
public static let NoPadding
功能:不填充。
类型:PaddingMode
static let PKCS7Padding
public static let PKCS7Padding
功能:采用PKCS7协议填充。
类型:PaddingMode
let paddingType
public let paddingType: Int64
功能:分组加解密填充方式,目前支持非填充和 pkcs7 填充。
类型:Int64
func ==(PaddingMode)
public operator override func ==(other: PaddingMode): Bool
功能:填充模式比较是否相同。
参数:
- other: PaddingMode - 填充模式。
返回值:
- Bool - true 相同, false不相同。
func !=(PaddingMode)
public operator override func !=(other: PaddingMode): Bool
功能:工作模式比较是否不相同。
参数:
- other: PaddingMode - 填充模式。
返回值:
- Bool - true 不相同, false相同。