MCPcopy Create free account
hub / github.com/Dstack-TEE/dstack / test_csr_v2_scale_encoding_stable

Function test_csr_v2_scale_encoding_stable

ra-tls/src/cert.rs:687–718  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

685
686 #[test]
687 fn test_csr_v2_scale_encoding_stable() {
688 let csr = CertSigningRequestV2 {
689 confirm: "please sign cert:".to_string(),
690 pubkey: vec![1, 2, 3],
691 config: CertConfigV2 {
692 org_name: None,
693 subject: "test.example.com".to_string(),
694 subject_alt_names: vec![],
695 usage_server_auth: true,
696 usage_client_auth: false,
697 ext_quote: false,
698 ext_app_info: false,
699 not_before: None,
700 not_after: None,
701 },
702 attestation: Attestation {
703 quote: AttestationQuote::DstackTdx(TdxQuote {
704 quote: vec![],
705 event_log: vec![],
706 }),
707 runtime_events: vec![],
708 report_data: [0u8; 64],
709 config: "".into(),
710 report: (),
711 }
712 .into_versioned(),
713 };
714
715 let actual = hex::encode(csr.encode());
716 let expected = "44706c65617365207369676e20636572743a0c0102030040746573742e6578616d706c652e636f6d0001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000";
717 assert_eq!(actual, expected);
718 }
719
720 #[test]
721 fn test_csr_v2_scale_encoding_stable_with_tdx_quote() {

Callers

nothing calls this directly

Calls 2

encodeFunction · 0.85
into_versionedMethod · 0.80

Tested by

no test coverage detected