rfc-5958

Asymmetric Key Packages

S. Turner
date2010-08 streamIETF wgnon working group statusPROPOSED STANDARD pages14 canonicalhttps://www.rfc-editor.org/rfc/rfc5958 doi10.17487/RFC5958 errataview
This document defines the syntax for private-key information and a content type for it. Private-key information includes a private key for a specified public-key algorithm and a set of attributes. The Cryptographic Message Syntax (CMS), as defined in RFC 5652, can be used to digitally sign, digest, authenticate, or encrypt the asymmetric key format content type. This document obsoletes RFC 5208. [STANDARDS-TRACK]

obsoletes

Extracted elements (20)

design-rationale §2

In general, either the public key or a certificate will be present in OneAsymmetricKey, but rarely both simultaneously, since including both results in two copies of the public key material.

crypto, pkix

design-rationale §1.3

The ALGORITHM-IDENTIFIER type from the original RFC 5208 was replaced with ALGORITHM from the new PKIX ASN.1 modules in RFC 5912, and imports were changed from PKCS #5 to RFC 5911 and RFC 5912, to align with updated ASN.1 module conventions.

crypto, pkix

design-rationale §1.3

The name 'PrivateKeyInfo' was changed to 'OneAsymmetricKey' to reflect the addition of the optional publicKey field, allowing both parts of an asymmetric key pair to be conveyed together. Not all algorithms will use both fields, but the publicKey field was added for completeness.

crypto, pkix

interoperability-note §5

OneAsymmetricKey and PrivateKeyInfo can be carried in PKCS #12 (P12) messages: private-key information in the keyBag BAG-TYPE and EncryptedPrivateKeyInfo in the pkcs8ShroudedKeyBag BAG-TYPE. File extensions .pfx and .p12 are used interchangeably in current implementations.

crypto, pkix

interoperability-note §5

PEM-encoded .p8 files use the .pem extension. Encrypted keys are bracketed by '-----BEGIN ENCRYPTED PRIVATE KEY-----' / '-----END ENCRYPTED PRIVATE KEY-----'; unencrypted keys use '-----BEGIN PRIVATE KEY-----' / '-----END PRIVATE KEY-----'. The content is Base64-encoded DER.

crypto, pkix

interoperability-note §5

The .pvk (Microsoft proprietary) and .p12/.pfx formats are not interchangeable with the OneAsymmetricKey format defined here, though conversion tools exist. The .pvk extension is used for local storage of Microsoft's private-key proprietary transfer syntax.

crypto, pkix

normative-requirement §2 MAY

Attributes from PKCS #9 [RFC2985] MAY be supported in the OneAsymmetricKey attributes field.

crypto, pkix

normative-requirement §3 MUST

For the EncryptedPrivateKeyInfo encoding process, generators SHOULD use DER and receivers MUST support BER (which also includes DER).

crypto, pkix

normative-requirement §2 MUST

Generators SHOULD use DER encoding and receivers MUST support BER encoding (which also includes DER) for the asymmetric key package content type.

crypto, pkix

normative-requirement §2 MUST

If the publicKey field is present in OneAsymmetricKey, then the version field MUST be set to v2; otherwise the version SHOULD be set to v1.

crypto, pkix

normative-requirement §7.1 MUST

The PKCS #8 object inside the application/pkcs8 media type MUST be DER-encoded PrivateKeyInfo.

crypto, pkix, registry

protocol-element §4

CMS protecting content types that MAY encapsulate the AsymmetricKeyPackage include: SignedData (digital signature), EncryptedData (symmetric encryption with pre-shared key), EnvelopedData (symmetric encryption with key transport), AuthenticatedData (MAC with key management), and AuthEnvelopedData (authenticated encryption).

crypto, pkix, security

protocol-element §2

PrivateKeyInfo is defined as an alias for OneAsymmetricKey to maintain backwards compatibility with RFC 5208 and PKCS #12. When version is v1 and no v2 fields are used, the structure is identical to the original RFC 5208 PrivateKeyInfo.

crypto, pkix

protocol-element §2

The AsymmetricKeyPackage CMS content type is a SEQUENCE of one or more OneAsymmetricKey elements, identified by OID id-ct-KP-aKeyPackage (joint-iso-itu-t(2) country(16) us(840) organization(1) gov(101) dod(2) infosec(1) formats(2) key-package-content-types(78) 5). It is used to transfer one or more plaintext asymmetric keys from one party to another.

crypto, pkix, security

protocol-element §2

The privateKey field in OneAsymmetricKey is an OCTET STRING whose content is algorithm-specific: DSA keys are INTEGER, RSA keys use RSAPrivateKey as defined in RFC 3447 (including n and e), and ECC keys use ECPrivateKey as defined in RFC 5915 (including the optional publicKey field).

crypto, pkix

registry §7.1

This document registers the application/pkcs8 media type with IANA. The subtype carries a DER-encoded PrivateKeyInfo (OneAsymmetricKey), has no required or optional parameters, uses binary encoding, and is associated with the .p8 file extension.

registry, crypto, pkix

security-consideration §6

Protection of private-key information is vital to public-key cryptography; disclosure to another entity can lead to masquerades. The encryption algorithm used to protect the key must be at least as strong as the key it is protecting.

crypto, security, pkix

security-consideration §6

The asymmetric key package contents are not inherently protected by this content type; it must be combined with a CMS security protocol (SignedData, EncryptedData, EnvelopedData, etc.) to protect the package contents. Removing encapsulating security layers will invalidate any signature and may expose the key to unauthorized disclosure.

crypto, security, pkix

wire-format §3

EncryptedPrivateKeyInfo is an ASN.1 SEQUENCE containing encryptionAlgorithm (AlgorithmIdentifier for CONTENT-ENCRYPTION) and encryptedData (OCTET STRING holding the encrypted PrivateKeyInfo). Used by PKCS #12.

crypto, pkix, security

wire-format §2

OneAsymmetricKey is an ASN.1 SEQUENCE containing: version (Version INTEGER v1/v2), privateKeyAlgorithm (AlgorithmIdentifier), privateKey (OCTET STRING), attributes ([0] OPTIONAL SET), and publicKey ([1] BIT STRING OPTIONAL, version 2 extension). The privateKey field's content is algorithm-specific.

crypto, pkix, security