共用方式為


PKCS #7 屬性

PKCS #7 是密碼編譯訊息語法標準。 PKCS #7 訊息本身不會構成憑證要求,但它可以使用下列其中一種內容類型,在 ContentInfo ASN.1 結構中封裝 PKCS #10 或 CMC 要求。 封裝可讓您新增額外的功能,例如多個簽章,否則無法使用。

  • 數據
  • SignedData
  • EnvelopedData
  • SignedAndEnvelopedData
  • DigestedData
  • EncryptedData

屬性可以新增至 authenticatedAttributes未驗證的Attributes 字段,SignedData 內容類型。

SignedData ::= SEQUENCE 
{
   version             INTEGER,
   digestAlgorithms    DigestAlgorithmIdentifiers,
   contentInfo         ContentInfo,
   certificates        [0] IMPLICIT Certificates OPTIONAL,
   crls                [1] IMPLICIT CertificateRevocationLists OPTIONAL,
   signerInfos         SignerInfos
}

SignerInfos ::= SET OF SignerInfo

SignerInfo ::= SEQUENCE 
{
    version                     INTEGER,
    sid                         CertIdentifier,
    digestAlgorithm             DigestAlgorithmIdentifier,
    authenticatedAttributes     [0] IMPLICIT Attributes OPTIONAL,
    digestEncryptionAlgorithm   DigestEncryptionAlgId,
    encryptedDigest             EncryptedDigest,
    unauthenticatedAttributes   [1] IMPLICIT Attributes
}

Attributes ::= SET OF Attribute

Attribute ::= SEQUENCE 
{
   type       EncodedObjectID,
   values     AttributeSetValue
}

將用戶端私鑰封存至證書頒發機構單位 (CA) 所需的程式,提供驗證(已簽署)屬性和未驗證屬性的使用方式的完整範例:

  • 用戶端會建立 IX509CertificateRequestPkcs10 物件,併為所要求的憑證類型新增適當的數據。

  • 用戶端會使用 PKCS #10 要求來初始化 IX509CertificateRequestCmc 物件。 PKCS #10 要求會放入 CMC 要求中 TaggedRequest 結構中。 如需詳細資訊,請參閱 CMC 屬性

  • 用戶端會加密私鑰,並使用它初始化 IX509AttributeArchiveKey 物件。 新的 ArchiveKey 屬性會封裝在 envelopedData 結構 中。

    EnvelopedData ::= SEQUENCE 
    {
        version                 INTEGER,
        recipientInfos          RecipientInfos,
        encryptedContentInfo    EncryptedContentInfo
    } 
    
    RecipientInfos ::= SET OF RecipientInfo
    
    EncryptedContentInfo ::= SEQUENCE 
    {
        contentType                 ContentType,
        contentEncryptionAlgorithm  ContentEncryptionAlgId,
        encryptedContent            [0] IMPLICIT EncryptedContent OPTIONAL
    } 
    
    EncryptedContent ::= OCTET STRING
    
    RecipientInfo ::= SEQUENCE 
    {
        version                 INTEGER,
        issuerAndSerialNumber   IssuerAndSerialNumber,
        keyEncryptionAlgorithm  KeyEncryptionAlgId,
        encryptedKey            EncryptedKey
    } 
    
  • 用戶端會建立加密密鑰的 SHA-1 哈希,並用它來初始化 IX509AttributeArchiveKeyHash 物件。

  • 用戶端會從 CMC 要求擷取 CryptAttributes 集合,並將 archiveKey ArchiveKeyHash 属性 加入其中。 屬性會放在 CMC 要求的 TaggedAttributes 結構中。

  • 用戶端會使用 CMC 要求來初始化 IX509CertificateRequestPkcs7 物件。 這會將 CMC 要求放入 PKCS #7 SignedData 結構的 contentInfo 字段。

  • ArchiveKeyHash 屬性會簽署並放置在 SignerInfo 結構的 authenticatedAttributes 序列中。

  • ArchiveKey 屬性會放在與 PKCS #7 訊息主要簽署者相關聯的 SignerInfo 結構 未經驗證的Attributes 序列中。

支援的屬性