Breaking changes
-
The API used to create/issue key pairs, certificates, certificate signing requests (CSRs), and certificate revocation lists (CRLs) has been restructured to emphasize consistency and avoid common errors with serialization.
For each concrete type (cert, CSR, CRL) the process is now the same:
- generate or load a key pair and any information about issuers required.
- create parameters, customizing as appropriate.
- call a generation
fnon the parameters, providing subject key pair and issuer information and as appropriate. - call serialization
fns on the finalized type, obtaining DER or PEM.
For more information, see [rcgen/docs/0.12-to-0.13.md].
-
Throughout the API DER inputs are now represented using types from the Rustls
rustls-pki-typescrate, e.g.PrivateKeyDer,CertificateDer,CertificateSigningRequestDer. Contributed by Tudyx. -
String types used in
SanTypeandDnValueenums for non-UTF8 string types have been replaced with more specific types that prevent representation of illegal values. E.g.Ia5String,BmpString,PrintableString,TeletexString, andUniversalString. Contributed by Tudyx. -
Method names starting with
get_have been renamed to match Rust convention:CertificateRevocationList::get_params()->params()Certificate::get_params()->params()Certificate::get_key_identifier()->Certificate::key_identifier()Certificate::get_times()->Certificate::times()
Added
-
RSA key generation support has been added. This support requires using the
aws-lc-rsfeature. By default usingKeyPair::generate_for()with an RSASignatureAlgorithmwill generate an RSA 2048 keypair. SeeKeyPair::generate_rsa_for()for support for RSA 2048, 3072 and 4096 key sizes. -
Support for ECDSA P521 signatures and key generation has been added when using the
aws-lc-rsfeature. Contributed by Alvenix. -
Support for loading private keys that may be PKCS8, PKCS1, or SEC1 has been added when using the
aws-lc-rsfeature. Without this feature private keys must be PKCS8. SeeKeyPair::from_pem_and_sign_algo()andKeyPair::from_der_and_sign_algo()for more information. Contributed by Alvenix. -
Support has been added for Subject Alternative Name (SAN) names of type
OtherName. Contributed by Tudyx. -
Support has been added for specifying custom "other" OIDs in extended key usage. Contributed by Tudyx.
-
Support has been added for building rcgen without cryptography by omitting the new (default-enabled)
cryptofeature flag. Contributed by corrideat. -
Support for using
aws-lc-rsinfipsmode can now be activated by using thefipsfeature in combination with theaws-lc-rsfeature. Contributed by BiagioFesta. -
A small command-line tool for certificate generation (
rustls-cert-gen) was added. Contributed by tbro.
What's Changed
- Allow building without the
pemcrate feature by @daxpedda in https://github.com/rustls/rcgen/pull/204 - ensure default serial generation fits 20 bytes by @BiagioFesta in https://github.com/rustls/rcgen/pull/203
- A functional
rustls-cert-genwith basic parameters. by @tbro in https://github.com/rustls/rcgen/pull/190 - choose a crypto_provider for rustls_cert_gen by @stormshield-gt in https://github.com/rustls/rcgen/pull/206
- Rework Certificate issuance API, make DER/PEM serialization stable by @cpu in https://github.com/rustls/rcgen/pull/205
- add support for other oid in the extended key usage by @Tudyx in https://github.com/rustls/rcgen/pull/210
- Upgrade webpki dev-dependency to 0.102 by @djc in https://github.com/rustls/rcgen/pull/215
- build(deps): bump actions/cache from 3 to 4 by @dependabot in https://github.com/rustls/rcgen/pull/216
- External keys by @djc in https://github.com/rustls/rcgen/pull/213
- build(deps): bump shlex from 1.2.0 to 1.3.0 by @dependabot in https://github.com/rustls/rcgen/pull/217
- Tighten up string type representations to prevent illegal values by @Tudyx in https://github.com/rustls/rcgen/pull/214
- docs: update CHANGELOG for 0.12.1 by @cpu in https://github.com/rustls/rcgen/pull/220
- Support compiling without cryptography primitives by @corrideat in https://github.com/rustls/rcgen/pull/208
- Add basic support for Subject Alternative Name OtherName by @Tudyx in https://github.com/rustls/rcgen/pull/209
- build(deps): bump codecov/codecov-action from 3 to 4 by @dependabot in https://github.com/rustls/rcgen/pull/221
- codecov: disable pull-request annotations by @cpu in https://github.com/rustls/rcgen/pull/225
- ci: sync nightly for check-external-types by @cpu in https://github.com/rustls/rcgen/pull/226
- proj: fix new clippy unused imports finding by @cpu in https://github.com/rustls/rcgen/pull/227
- Upgrade x509-parser to 0.16 by @djc in https://github.com/rustls/rcgen/pull/231
- Remove get_() prefixes from method names by @djc in https://github.com/rustls/rcgen/pull/232
- Add RSA key generation by @est31 in https://github.com/rustls/rcgen/pull/230
- Update semver-compatible dependencies by @djc in https://github.com/rustls/rcgen/pull/235
- FIPS support by @BiagioFesta in https://github.com/rustls/rcgen/pull/234
- Split certificate module out of crate root by @djc in https://github.com/rustls/rcgen/pull/237
- Apply most Clippy suggestions by @djc in https://github.com/rustls/rcgen/pull/239
- Inline oid module by @djc in https://github.com/rustls/rcgen/pull/238
- Streamline signing API by @djc in https://github.com/rustls/rcgen/pull/233
- Use pki_types to improve the interoperability with the rustls ecosystem by @Tudyx in https://github.com/rustls/rcgen/pull/223
- lib: export key_pair::RsaKeySize by @cpu in https://github.com/rustls/rcgen/pull/245
- Unbreak doctests by @djc in https://github.com/rustls/rcgen/pull/244
- Serialize CRL parameters into CertificateRevocationList by @djc in https://github.com/rustls/rcgen/pull/240
- Follow-up from pki-types conversion by @djc in https://github.com/rustls/rcgen/pull/246
- Fix unused import warning by @Alvenix in https://github.com/rustls/rcgen/pull/248
- key_pair: emphasize PKCS8 input requirement in constructor fn names by @cpu in https://github.com/rustls/rcgen/pull/249
- Support ECDSA_P521_SHA512 when using aws_lc_rs feature by @Alvenix in https://github.com/rustls/rcgen/pull/241
- Minor API tweaks by @djc in https://github.com/rustls/rcgen/pull/253
- Streamline CI jobs by @djc in https://github.com/rustls/rcgen/pull/251
- Prefer aws-lc-rs over ring if both are enabled by @djc in https://github.com/rustls/rcgen/pull/252
- lib: export csr::CertificateSigningRequest by @cpu in https://github.com/rustls/rcgen/pull/255
- Support more private key formats when using aws_lc_rs feature by @Alvenix in https://github.com/rustls/rcgen/pull/242
- docs: update CHANGELOG for 0.13.0 by @cpu in https://github.com/rustls/rcgen/pull/254