File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed
Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -77,6 +77,19 @@ impl SigstoreTrustRoot {
7777 Self :: from_tough ( & repository, cache_dir) . await
7878 }
7979
80+ /// Constructs a new trust root from a JSON object containing a
81+ /// [`TrustedRoot`](https://github.com/sigstore/protobuf-specs).
82+ ///
83+ /// # Warning
84+ ///
85+ /// This constructor does not perform any validation of the provided data.
86+ /// The caller must ensure that the data is trustworthy.
87+ /// Using untrusted data may lead to security vulnerabilities.
88+ pub fn from_trusted_root_json_unchecked ( data : & [ u8 ] ) -> Result < Self > {
89+ let trusted_root: TrustedRoot = serde_json:: from_slice ( data) ?;
90+ Ok ( Self { trusted_root } )
91+ }
92+
8093 async fn fetch_target < N > (
8194 repository : & tough:: Repository ,
8295 checkout_dir : Option < & Path > ,
You can’t perform that action at this time.
0 commit comments