mirror of
https://github.com/apple/swift-certificates
synced 2026-11-26 04:47:48 +00:00
Performed the necessary changes to enable compiler flag `-require-explicit-sendable`. Also enabled this flag in macOS CI.
39 lines
1.2 KiB
Swift
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)
|
|
)
|
|
}
|
|
}
|