pub(crate) const STORE_KEY: &str = "c2pa.manifest";
pub(crate) const URI_KEY: &str = "c2pa.manifest.uri";
#[derive(Debug, Clone, PartialEq, Eq, Default)]
pub struct ManifestSource {
pub active_manifest_uri: Option<String>,
pub manifest_store: Option<Vec<u8>>,
}
impl ManifestSource {
pub fn embedded(manifest_store: Vec<u8>) -> Self {
Self {
active_manifest_uri: None,
manifest_store: Some(manifest_store),
}
}
pub fn remote(uri: impl Into<String>) -> Self {
Self {
active_manifest_uri: Some(uri.into()),
manifest_store: None,
}
}
pub fn both(uri: impl Into<String>, manifest_store: Vec<u8>) -> Self {
Self {
active_manifest_uri: Some(uri.into()),
manifest_store: Some(manifest_store),
}
}
pub(crate) fn is_empty(&self) -> bool {
self.active_manifest_uri.is_none() && self.manifest_store.is_none()
}
}