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
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
typeCommitmentType
Returns
Raw(string, byte[])
Creates a CmsAttribute from raw OID and DER-encoded value.
public static CmsAttribute Raw(string oid, byte[] derValue)
Parameters
Returns
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
manifestJsonUtf8byte[]UTF-8 encoded JSON bytes of the manifest.
Returns
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
policyOidstringOID of the signature policy.
policyUristringOptional URI of the policy document (encoded as SigPolicyQualifier).