pub struct DevelopmentChain { /* private fields */ }rustcrypto only.Expand description
A development attestation authority.
Holds a key handle, never a key — the same argument as CertAuthority:
a factory that keeps its PAA in an HSM and a test that keeps it in RAM run the same code.
Implementations§
Source§impl DevelopmentChain
impl DevelopmentChain
Sourcepub const fn new(not_before: u32, years: u32) -> Self
pub const fn new(not_before: u32, years: u32) -> Self
A chain for TEST_VENDOR_ID, valid from not_before for years.
Sourcepub fn for_vendor(self, vendor_id: VendorId) -> Result<Self>
pub fn for_vendor(self, vendor_id: VendorId) -> Result<Self>
The same chain for a different vendor id.
Anything outside 0xFFF1–0xFFF4 is refused: a development chain claiming a real
vendor’s id is a forgery, however well-intentioned, and §6.2.2 gives a commissioner no
way to tell the two apart except the id.
Sourcepub fn paa<'b, K: KeyStore>(
&self,
keys: &K,
buf: &'b mut [u8],
key: KeyHandle,
) -> Result<&'b [u8]>
pub fn paa<'b, K: KeyStore>( &self, keys: &K, buf: &'b mut [u8], key: KeyHandle, ) -> Result<&'b [u8]>
Writes a self-signed Product Attestation Authority certificate into buf.
§6.2.2.4 rule 2: a PAA is a CA. verify_dac_chain additionally requires its path-length
constraint to be absent or exactly 1 — one intermediate between it and a DAC, which is
the shape §6.2.2 defines and no other.
Sourcepub fn pai<'b, K: KeyStore>(
&self,
keys: &K,
buf: &'b mut [u8],
paa_key: KeyHandle,
pai_public: &PublicKey,
) -> Result<&'b [u8]>
pub fn pai<'b, K: KeyStore>( &self, keys: &K, buf: &'b mut [u8], paa_key: KeyHandle, pai_public: &PublicKey, ) -> Result<&'b [u8]>
Writes a Product Attestation Intermediate certificate into buf.
§6.2.2.4 rule 5 puts the vendor id in the subject and rule 3 fixes the path length at 0: a PAI signs DACs and nothing else.
Sourcepub fn dac<'b, K: KeyStore>(
&self,
keys: &K,
buf: &'b mut [u8],
pai_key: KeyHandle,
dac_public: &PublicKey,
product_id: u16,
) -> Result<&'b [u8]>
pub fn dac<'b, K: KeyStore>( &self, keys: &K, buf: &'b mut [u8], pai_key: KeyHandle, dac_public: &PublicKey, product_id: u16, ) -> Result<&'b [u8]>
Writes a Device Attestation Certificate into buf.
§6.2.2.4 rule 8 and 9: the subject carries exactly one vendor id and exactly one product
id, and rule 8a makes the vendor id match the issuer’s — which is why the PAI’s own name
is rebuilt here from the same vendor_id rather than passed in.