dcap-qvl 0.1.3__cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of dcap-qvl might be problematic. Click here for more details.
dcap_qvl/__init__.py
ADDED
|
Binary file
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: dcap-qvl
|
|
3
|
+
Version: 0.1.3
|
|
4
|
+
Requires-Dist: maturin>=1.8.2
|
|
5
|
+
Requires-Dist: twine>=6.1.0
|
|
6
|
+
License-File: LICENSE
|
|
7
|
+
Summary: Add your description here
|
|
8
|
+
Author: Kevin Wang <wy721@qq.com>
|
|
9
|
+
Author-email: Kevin Wang <wy721@qq.com>
|
|
10
|
+
License: MIT
|
|
11
|
+
Requires-Python: >=3.10, <=3.14
|
|
12
|
+
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
<!-- cargo-rdme start -->
|
|
16
|
+
|
|
17
|
+
# dcap-qvl
|
|
18
|
+
|
|
19
|
+
This crate implements the quote verification logic for DCAP (Data Center Attestation Primitives) in pure Rust. It supports both SGX (Software Guard Extensions) and TDX (Trust Domain Extensions) quotes.
|
|
20
|
+
|
|
21
|
+
# Features
|
|
22
|
+
- Verify SGX and TDX quotes
|
|
23
|
+
- Get collateral from PCCS
|
|
24
|
+
- Extract information from quotes
|
|
25
|
+
|
|
26
|
+
# Usage
|
|
27
|
+
Add the following dependency to your `Cargo.toml` file to use this crate:
|
|
28
|
+
```toml
|
|
29
|
+
[dependencies]
|
|
30
|
+
dcap-qvl = "0.1.0"
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
# Examples
|
|
34
|
+
|
|
35
|
+
## Get Collateral from PCCS_URL and Verify Quote
|
|
36
|
+
|
|
37
|
+
To get collateral from a PCCS_URL and verify a quote, you can use the following example code:
|
|
38
|
+
```rust
|
|
39
|
+
use dcap_qvl::collateral::get_collateral;
|
|
40
|
+
use dcap_qvl::verify::verify;
|
|
41
|
+
|
|
42
|
+
#[tokio::main]
|
|
43
|
+
async fn main() {
|
|
44
|
+
// Get PCCS_URL from environment variable. The URL is like "https://localhost:8081/sgx/certification/v4/".
|
|
45
|
+
let pccs_url = std::env::var("PCCS_URL").expect("PCCS_URL is not set");
|
|
46
|
+
let quote = std::fs::read("tdx_quote").expect("tdx_quote is not found");
|
|
47
|
+
let collateral = get_collateral(&pccs_url, "e, std::time::Duration::from_secs(10)).await.expect("failed to get collateral");
|
|
48
|
+
let now = std::time::SystemTime::now().duration_since(std::time::UNIX_EPOCH).unwrap().as_secs();
|
|
49
|
+
let tcb = verify("e, &collateral, now).expect("failed to verify quote");
|
|
50
|
+
println!("{:?}", tcb);
|
|
51
|
+
}
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## Get Collateral from Intel PCS and Verify Quote
|
|
55
|
+
|
|
56
|
+
```rust
|
|
57
|
+
use dcap_qvl::collateral::get_collateral_from_pcs;
|
|
58
|
+
use dcap_qvl::verify::verify;
|
|
59
|
+
|
|
60
|
+
#[tokio::main]
|
|
61
|
+
async fn main() {
|
|
62
|
+
let quote = std::fs::read("tdx_quote").expect("tdx_quote is not found");
|
|
63
|
+
let collateral = get_collateral_from_pcs("e, std::time::Duration::from_secs(10)).await.expect("failed to get collateral");
|
|
64
|
+
let now = std::time::SystemTime::now().duration_since(std::time::UNIX_EPOCH).unwrap().as_secs();
|
|
65
|
+
let tcb = verify("e, &collateral, now).expect("failed to verify quote");
|
|
66
|
+
println!("{:?}", tcb);
|
|
67
|
+
}
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
<!-- cargo-rdme end -->
|
|
71
|
+
|
|
72
|
+
# License
|
|
73
|
+
|
|
74
|
+
This crate is licensed under the MIT license. See the LICENSE file for details.
|
|
75
|
+
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
dcap_qvl-0.1.3.dist-info/METADATA,sha256=8W_bjjZabC1Mx7e4UCg5YMPHvBBEMeN72yfeN1IC-Ss,2426
|
|
2
|
+
dcap_qvl-0.1.3.dist-info/WHEEL,sha256=xmgHfrZnekTnNsVAVJOGui7H8HXfLu85y5KBdcfmlL8,127
|
|
3
|
+
dcap_qvl-0.1.3.dist-info/licenses/LICENSE,sha256=070OEM_OefwwbasTPBxtOyVDy8cUurlbqN-rehf9meo,1070
|
|
4
|
+
dcap_qvl/__init__.py,sha256=RMQOVBmpT6U8PaT8rRlDneVa0kLXFJ-nMTVqBaDVatw,115
|
|
5
|
+
dcap_qvl/dcap_qvl.abi3.so,sha256=q3MTl6XQAoq81CGs-9pxXpkX2Ha4U7S_vu4NSXCQWbI,6492032
|
|
6
|
+
dcap_qvl-0.1.3.dist-info/RECORD,,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 Phala Network
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|