diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a6a4d4ae2..bd5150da8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -45,6 +45,10 @@ on: schedule: - cron: '0 10 * * FRI' +defaults: + run: + shell: bash + # Jobs # ---------------------------------------------------------------------------- jobs: @@ -296,6 +300,10 @@ jobs: - name: Test run: cargo test --all-targets $DOMAIN_FEATURES + # doc test suite. + - name: Doc Test + run: cargo test doc $DOMAIN_FEATURES + # Build Cache # ----------- # diff --git a/Cargo.toml b/Cargo.toml index 76e39ec2e..089d488fa 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -138,6 +138,10 @@ required-features = ["std", "rand"] name = "client-transports" required-features = ["net", "tokio-rustls", "unstable-client-transport"] +[[example]] +name = "crypto-doc" +required-features = ["std","ring"] + [[example]] name = "client-cache-transport" required-features = ["net", "unstable-client-cache"] diff --git a/examples/crypto-doc.rs b/examples/crypto-doc.rs new file mode 100644 index 000000000..afa3433bc --- /dev/null +++ b/examples/crypto-doc.rs @@ -0,0 +1,14 @@ +use domain::base::iana::SecurityAlgorithm; +use domain::crypto::common::PublicKey; +use domain::rdata::Dnskey; + +fn main() { + let keyraw = [0u8; 16]; + let input = "Hello World!"; + let bad_sig = [0u8; 16]; + let dnskey = + Dnskey::new(256, 3, SecurityAlgorithm::ED25519, keyraw).unwrap(); + let public_key = PublicKey::from_dnskey(&dnskey).unwrap(); + let res = public_key.verify(input.as_bytes(), &bad_sig); + println!("verify result: {res:?}"); +}