Skip to main content

uselesskey_core_keypair/
lib.rs

1#![forbid(unsafe_code)]
2
3//! Compatibility facade for the historical `uselesskey-core-keypair` crate.
4//!
5//! The actual implementation lives in
6//! [`uselesskey_core_keypair_material`]; this crate keeps the existing public path
7//! stable for downstream users and internal integrations.
8//!
9//! # Examples
10//!
11//! Create key material and access encodings:
12//!
13//! ```
14//! use uselesskey_core_keypair::Pkcs8SpkiKeyMaterial;
15//!
16//! let material = Pkcs8SpkiKeyMaterial::new(
17//!     vec![0x30, 0x82],                        // PKCS#8 DER (placeholder)
18//!     "-----BEGIN PRIVATE KEY-----\nAA==\n-----END PRIVATE KEY-----\n",
19//!     vec![0x30, 0x59],                        // SPKI DER (placeholder)
20//!     "-----BEGIN PUBLIC KEY-----\nAA==\n-----END PUBLIC KEY-----\n",
21//! );
22//!
23//! assert_eq!(material.private_key_pkcs8_der(), &[0x30, 0x82]);
24//! assert!(material.public_key_spki_pem().contains("PUBLIC KEY"));
25//! // kid is deterministic from the SPKI bytes
26//! assert_eq!(material.kid(), material.kid());
27//! ```
28
29pub use uselesskey_core_keypair_material::Pkcs8SpkiKeyMaterial;