Table of Contents

Class CmsAttribute

Namespace
SimpleSign.Core.Crypto
Assembly
SimpleSign.Core.dll

Represents a pre-encoded CMS signed attribute (OID + DER value). Used to inject custom CAdES attributes into the CMS SignedData.

public sealed class CmsAttribute
Inheritance
CmsAttribute
Inherited Members

Properties

DerValue

The DER-encoded value (the content of SET OF { value }).

public byte[] DerValue { get; }

Property Value

byte[]

Oid

The OID of the attribute.

public string Oid { get; }

Property Value

string

Methods

CommitmentTypeIndication(CommitmentType)

Creates a commitment-type-indication attribute (RFC 5126 §5.11.1).

CommitmentTypeIndication ::= SEQUENCE {
  commitmentTypeId  CommitmentTypeIdentifier }
CommitmentTypeIdentifier ::= OID
public static CmsAttribute CommitmentTypeIndication(CommitmentType type)

Parameters

type CommitmentType

Returns

CmsAttribute

Raw(string, byte[])

Creates a CmsAttribute from raw OID and DER-encoded value.

public static CmsAttribute Raw(string oid, byte[] derValue)

Parameters

oid string
derValue byte[]

Returns

CmsAttribute

SignatureManifestAttr(byte[])

Creates a signature manifest attribute containing JSON-encoded evidence. The data is embedded as an OCTET STRING (UTF-8 JSON) under OID 2.16.76.1.12.1.1.

public static CmsAttribute SignatureManifestAttr(byte[] manifestJsonUtf8)

Parameters

manifestJsonUtf8 byte[]

UTF-8 encoded JSON bytes of the manifest.

Returns

CmsAttribute

SignaturePolicyIdentifier(string, string?)

Creates a signature-policy-identifier attribute (RFC 5126 §5.8.1).

SignaturePolicyIdentifier ::= SEQUENCE {
  signaturePolicyId    SignaturePolicyId,
  sigPolicyHash        SigPolicyHash OPTIONAL }
SignaturePolicyId ::= OID
SigPolicyHash ::= OtherHashAlgAndValue (SEQUENCE { algorithm, hash })
public static CmsAttribute SignaturePolicyIdentifier(string policyOid, string? policyUri = null)

Parameters

policyOid string

OID of the signature policy.

policyUri string

Optional URI of the policy document (encoded as SigPolicyQualifier).

Returns

CmsAttribute