PKCS #7 属性

PKCS #7 は、暗号化メッセージ構文の標準です。 PKCS #7 メッセージは、単独では証明書要求を構成しませんが、次のいずれかのコンテンツ タイプを使用して 、ContentInfo ASN.1 構造体に PKCS #10 または CMC 要求をカプセル化できます。 カプセル化を使用すると、それ以外の場合は使用できない追加の機能 (複数の署名など) を追加できます。

  • データ
  • SignedData
  • EnvelopedData
  • SignedAndEnvelopedData
  • DigestedData
  • EncryptedData

SignedData コンテンツ タイプの authenticatedAttributes フィールドと unauthenticatedAttributes フィールドに属性を追加できます。

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 構造体の unauthenticatedAttributes シーケンスに配置されます。

サポート対象属性