Attributi PKCS #7
PKCS #7 è uno standard di sintassi dei messaggi crittografici. Un messaggio PKCS #7 non costituisce, per sé, una richiesta di certificato, ma può incapsulare una richiesta PKCS #10 o CMC in una ContentInfo struttura ASN.1 usando uno dei tipi di contenuto seguenti. L'incapsulamento consente di aggiungere funzionalità aggiuntive, ad esempio più firme, che non sono altrimenti disponibili.
- Data
- signedData
- EnvelopedData
- SignedAndEnvelopedData
- DigestedData
- EncryptedData
Gli attributi possono essere aggiunti ai authenticatedAttributes e campi unauthenticatedAttributes del tipo di contenuto 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
}
Il processo necessario per archiviare la chiave privata di un client in un'autorità di certificazione (CA) fornisce un esempio completo del modo in cui è possibile usare gli attributi autenticati (firmati) e gli attributi non autenticati:
Il client crea un oggetto IX509CertificateRequestPkcs10 e aggiunge i dati appropriati per il tipo di certificato richiesto.
Il client usa la richiesta PKCS #10 per inizializzare un oggetto IX509CertificateRequestCmc. La richiesta PKCS #10 viene inserita nella struttura TaggedRequest nella richiesta CMC. Per altre informazioni, vedere attributi CMC.
Il client crittografa una chiave privata e la usa per inizializzare un oggetto IX509AttributeArchiveKey. Il nuovo attributo ArchiveKey viene incapsulato in una struttura 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 }
Il client crea un hash SHA-1 della chiave crittografata e lo usa per inizializzare un oggetto IX509AttributeArchiveKeyHash.
Il client recupera la raccoltaCryptAttributes dalla richiesta CMC e aggiunge gli attributi ArchiveKey e gli attributi ArchiveKeyHash. Gli attributi vengono inseriti nella struttura TaggedAttributes della richiesta CMC.
Il client usa la richiesta CMC per inizializzare un oggetto IX509CertificateRequestPkcs7. In questo modo la richiesta CMC viene inserita nel campo contentInfo della struttura pkCS #7 SignedData.
L'attributo ArchiveKeyHash viene firmato e inserito nella sequenza authenticatedAttributes della struttura SignerInfo.
L'attributo ArchiveKey viene inserito nella sequenza unauthenticatedAttributes della struttura SignerInfo associata al firmatario primario del messaggio PKCS #7.
Argomenti correlati