Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

StringExt function as_der_bytes referenced in readme but not exposed to users #59

Open
sinking-point opened this issue Nov 24, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@sinking-point
Copy link
Contributor

In the readme, there's an example of SignedDataVerifier usage:

// .unwrap() used for example purposes only
let root_cert = "apple-root-cert-in-base-base64-format"; // https://www.apple.com/certificateauthority/AppleRootCA-G3.cer
let root_cert_der = root_cert.as_der_bytes().unwrap(); // Use `base64` crate to decode base64 string into bytes 

let verifier = SignedDataVerifier::new(
    vec![root_cert_der], // Vector of root certificates
    Environment::Sandbox, // Environment
    "app.superapp.apple".to_string(), // Bundle id
    Some(12345678), // App id
);

let payload = "signed-payload";
let decoded_payload = verifier.verify_and_decode_notification(payload).unwrap();

In this example, as_der_bytes from the StringExt trait (defined in utils.rs) is used. However, in lib.rs:

mod utils;

The utils module isn't made public. As far as I can tell, there's no way for me to import the trait needed for me to use as_der_bytes.

Please could you make the trait possible to import? Or otherwise, remove it from the example.

Thank you for making this crate public, by the way.

@sinking-point sinking-point added the bug Something isn't working label Nov 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant