Files
Rafael Cepeda c059d9c9d0 Explicit sendable changes (#265)
Performed the necessary changes to enable compiler flag
`-require-explicit-sendable`. Also enabled this flag in macOS CI.
2025-07-31 15:35:39 +01:00

39 lines
1.2 KiB
Swift

//===----------------------------------------------------------------------===//
//
// This source file is part of the SwiftCertificates open source project
//
// Copyright (c) 2025 Apple Inc. and the SwiftCertificates project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of SwiftCertificates project authors
//
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//
import SwiftASN1
/// Set the Domain Component (DC) of a ``DistinguishedName``.
///
/// This type is used in ``DistinguishedNameBuilder`` contexts.
public struct DomainComponent: RelativeDistinguishedNameConvertible, Sendable {
/// The value of the organizational unit name field.
public var name: String
/// Construct a new organizational unit name
///
/// - Parameter name: The value of the organizational unit name
@inlinable
public init(_ name: String) {
self.name = name
}
@inlinable
public func makeRDN() throws -> RelativeDistinguishedName {
return RelativeDistinguishedName(
try .init(type: .RDNAttributeType.domainComponent, ia5String: name)
)
}
}