Files
swift-certificates/Sources/X509/CryptographicMessageSyntax/CMSSignedData.swift
T

49 lines
1.7 KiB
Swift

//===----------------------------------------------------------------------===//
//
// This source file is part of the SwiftCertificates open source project
//
// Copyright (c) 2023 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
/// ``SignedData`` is defined in ASN.1 as:
/// ```
/// SignedData ::= SEQUENCE {
/// version CMSVersion,
/// digestAlgorithms DigestAlgorithmIdentifiers,
/// encapContentInfo EncapsulatedContentInfo,
/// certificates [0] IMPLICIT CertificateSet OPTIONAL,
/// crls [1] IMPLICIT RevocationInfoChoices OPTIONAL,
/// signerInfos SignerInfos }
///
/// DigestAlgorithmIdentifiers ::= SET OF DigestAlgorithmIdentifier
/// DigestAlgorithmIdentifier ::= AlgorithmIdentifier
/// SignerInfos ::= SET OF SignerInfo
///
/// CertificateChoices ::= CHOICE {
/// certificate Certificate,
/// extendedCertificate [0] IMPLICIT ExtendedCertificate, -- Obsolete
/// v1AttrCert [1] IMPLICIT AttributeCertificateV1, -- Obsolete
/// v2AttrCert [2] IMPLICIT AttributeCertificateV2,
/// other [3] IMPLICIT OtherCertificateFormat }
///
/// OtherCertificateFormat ::= SEQUENCE {
/// otherCertFormat OBJECT IDENTIFIER,
/// otherCert ANY DEFINED BY otherCertFormat }
/// ```
struct CMSSignedData {
var version: CMSVersion
var digestAlgorithms: [AlgorithmIdentifier]
var encapContentInfo: CMSEncapsulatedContentInfo
var certificates: [Certificate]?
var signerInfos: [CMSSignerInfo]
}