OpenPGP extension to PKCS #11This is a technical proposal for an extension of the Cryptoki or PKCS #11 specification with OpenPGP support. Although anticipating inclusion in the real specification, it is described below as a bottom-up movement, that any HSM vendor can easily implement today. Might it end up in the formal standard, then the transition will be very easy to make. why compatibility modifications specification Why support OpenPGP in Cryptoki?Specifications exist to unleash OpenPGP-based TLS and thus to secure Internet connections in another way than throught the PKIX. It could be said that we have X.509 PKIs and that these suffice to secure the Internet. In practice, this is not the case. A large part of that is the complexity of a full-blown PKIX:
OpenPGP is complex to get into when the Web Of Trust is used. For people understanding these principles, the OpenPGP system has always been preferred on account of its direct, personal approach to security. However, perfectly viable approaches to validate OpenPGP keys are possible now that we can assume that everything that requires transport security is connected to the Internet. The new system envisioned here is about checking identity at the time a secure connection is required, so in realtime rather than use the "batch processing" one-time checks that are performed with a PKIX. Such a system requires good security support, and can do with hardware acceleration. These are two reasons to improve OpenPGP support in HSMs and, therefore, in the PKCS #11 API that defines them. The work is not even so difficult — there merely is a need for an extra certificate type that can be stored together with the private keys; existing private key facilities suffice. Given that, and the ability to validate OpenPGP certificates in realtime, there are no more disadvantages:
The code implementing Cryptoki support for OpenPGP Public Key Objects overlaps can be completely the same as the code for X.509 Certificate Objects; we do suggest a few optional changes that might be enforced in a formal extension to the Cryptoki specification. This specification exists to permit HSM vendors to jump on board. The changes are extremely straightforward – and the potential benefits are enormous. Compatibility GuaranteedThe proposal made here uses vendor extensions, so it will never conflict with the Cryptoki specification. In addition, it chooses a value that is highly unlikely to already occur in any current numbering or naming plan of cryptographic token vendors, so it would be possible for each of them to adopt this specification without modification. #define CKC_OPENPGP (CKC_VENDOR_DEFINED|0x00504750) The last 3 bytes spell out "PGP" in ASCII characters, and are not likely to be in use anywhere. The inclusion of the Vendor Defined mask is the formally permitted way to extend the formal Cryptoki definitions. Using the same value across HSM implementations makes it possible for implementations to start using HSMs for OpenPGP. It is quite possible that servicing this profile would be considered quality mark or even a selection criterium for your HSM when this situation arises. In short, this specification is kind to HSM vendors, as well to application programmers. Minimal changes to existing Cryptoki implementationsThere hardly is a thing to change for cryptographic token vendors who wish to embrace this specification.
Might this specification end up in Cryptoki specification, then treating it would merely be a matter of accepting two identifiers for the OpenPGP certificate type. Being fully in charge of the internals of the HSM, it would be possible to keep the internal state in some form, while accepting two identifiers for certificate searches. Supporting Implementations
The intention here is, in true PGP style, to work bottom-up in a co-operative manner, gearing towards a specification that is widely implemented in HSMs and then incorporated into the Cryptoki standard with a new tag. Extensions to the Cryptoki specificationBelow are the changes to the sections and appendices of Cryptoki. We use section names instead of numbering to be less dependent on versions of the specification. Editorial comments are printed in italics. Certificate Objects / Definitions / OverviewOne kind of certificate should be mentioned in the overview.
The
Certificate Objects / Definitions / OpenPGP public key objectsThis is a completely new section, heavily inspired by the "X.509 public key certificate objects" section and on the to date most recent OpenPGP specification, RFC 4880. OpenPGP certificate objects (with certificate type CKC_OPENPGP) hold an OpenPGP public key, defined as a Transferrable Public Key in section 11.1 of RFC 4880. Future specifications may expand on the permitted structures, which must than be incorporated into a future version of this specification. The OpenPGP standard packets that are concatenated to form a Transferrable Public Key are, in terms of RFC 4880:
The byte-level formatting is defined in RFC 4880. Note however, that this specification advises to use modern versions of the byte format for new keys, and that the prominent advantage of PKCS #11 is private key shielding, which is only possible for newly generated keys; for that reason, applications of this profile may limit themselves to just these new binary representations:
Finally, the transport of OpenPGP Public Key material between an application and an implementation of this Cryptoki extension is in binary format; the Conversion to radix-64 speficied in section 2.4 of RFC 4880 is not applied. The following table defines the OpenPGP certificate object attributes, in addition to the common attributes defined for this object class: Table: OpenPGP Certificate Object Attributes
[1] Must be specified when the object is created.
[2] Can only be empty if
[3] Must be non-empty if The following specifications for X.509 Certificate Objects are not needed for OpenPGP Certificates, and may not occur in them:
Only the
The
The
When multiple Public Key Objects representations are created to distinguish User ID values, then the subject names of those representations are going to differ between the Private Key Object and (some of) the Public Key Objects. Cryptoki does not enforce these to be the same, and it is possible that the Private Key Object leaves the
The
The Appendix. Manifest ConstantsOne new definition is added, for now as a vendor-defined constant with high probability of being globally unique across implementations. The following definitions can be found in the appropriate header file. #define CKC_X_509 0x00000000 #define CKC_X_509_ATTR_CERT 0x00000001 #define CKC_WTLS 0x00000002 #define CKC_VENDOR_DEFINED 0x80000000 #define CKC_OPENPGP (CKC_VENDOR_DEFINED|0x00504750) Author, copyrightThis specification was created by Dr.ir. Rick van Rein, senior cryptographer and CTO at OpenFortress Digital signatures. Various useful suggestions to early versions of this specification were made by Rickard Bellkrim, who originally developed SoftHSM for the OpenDNSSEC project. Work at OpenFortress centers around the introduction of cryptography in mainstream usage patterns of the Internet, and the approach is to exploit cryptographically strong primitives in ways that are intuitive to end-users. Technologies serving such needs include OpenPGP, PKIX, OpenSSH, Kerberos. Samples of past work are the development of PKCS #11 based tooling and services, for instance our work with SURFnet on their DNSSEC infrastructure and the OpenDNSSEC project. Permission is hereby granted to use this text under a Creative Commons License, however your are kindly requested to not modify the part "Certificate Profile". Parts of this specification were based on the public versions of the standards PKCS #11 and RFC 4880. They were made in the spirit of these standards, and are therefore assumed to be within the intentions of these publications. |