Skip to content

struct KeyIdentifier

cangjie
public struct KeyIdentifier <: Equatable<KeyIdentifier> & ToString & Hashable

功能:表示数据保护密钥标识。

父类型:

成员概览

成员功能
init(Array<Byte>)使用指定字节创建密钥标识。
func ==(KeyIdentifier)判断两个密钥标识是否相等。
func toBytes()返回密钥标识的字节副本。
func create()创建新的随机密钥标识。
func toString()返回密钥标识的十六进制字符串表示。
func hashCode()返回密钥标识的哈希码。

init(Array<Byte>)

cangjie
public init(bytes: Array<Byte>)

功能:使用指定字节创建密钥标识。

参数:

  • bytes: Array<Byte> - 密钥标识字节数组。

func ==(KeyIdentifier)

cangjie
public operator func ==(that: KeyIdentifier): Bool

功能:判断两个密钥标识是否相等。

参数:

返回值:

  • Bool - 如果两个密钥标识相等则返回 true

func toBytes()

cangjie
public func toBytes(): Array<Byte>

功能:返回密钥标识的字节副本。

返回值:

  • Array<Byte> - 返回密钥标识字节数组。

func create()

cangjie
public static func create(): KeyIdentifier

功能:创建新的随机密钥标识。

返回值:

func toString()

cangjie
public func toString(): String

功能:返回密钥标识的十六进制字符串表示。

返回值:

  • String - 返回密钥标识字符串。

func hashCode()

cangjie
public func hashCode(): Int64

功能:返回密钥标识的哈希码。

返回值:

  • Int64 - 返回密钥标识哈希值。