init(_:)

Construct a serial number from a fixed width integer.

CertificateSerialNumber.swift:62
iOS
13+
macOS
10.15+
tvOS
13+
watchOS
6+
init<Number>(_ number: Number) where Number : FixedWidthInteger

Parameters

number

The raw big-endian bytes of the serial number.

In general this API should only be used for testing, as fixed width integers are not sufficiently large for use in certificates. Using this API for production use-cases may expose users to hash collision attacks on generated certificates.

Prefer using init(integerLiteral:) with a StaticBigInt which enables arbitrary-precision.