DerivedKey

public class DerivedKey : KeyMaterial

A key that is derived from a Password.

A derived key contains additional information, i.e., the parameters used to derive the key. In order to derive the same key from the password, the same parameters have to be used.

  • Minimum size of the derived key in bytes.

    Declaration

    Swift

    public static let MinimumSizeInBytes: UInt32
  • Maximum size of the derived key in bytes.

    Declaration

    Swift

    public static let MaximumSizeInBytes: UInt32
  • Size of the public parameters, serialized to a byte array.

    Declaration

    Swift

    public static let SizeOfPublicParametersInBytes: UInt32
  • A byte array containing all the parameters required to derive the same key for the given password.

    Declaration

    Swift

    public var publicParameters: Bytes { get }
  • Extract the public parameters from a byte array. The size of the byte array has to be at least SizeOfPublicParametersInBytes. The public parameters are extracted from the beginning of the byte array.

    Declaration

    Swift

    public static func extractPublicParameters(bytes: Bytes) -> (Salt, ComplexityLimit, MemoryLimit)?

    Parameters

    bytes

    An array containing serialized public parameters at the beginning.

    Return Value

    A tuple consisting of the salt, the complexity limit, and the memory limit used for deriving the key. nil is returned if the byte sequence cannot be deserialized.