use crate::pki::{CounterReceipts, ParticipantRequirements, SignerReceipt};
use crate::source::{Location, Snapshot};
use crate::timestamp::TimestampScope;
mod archive;
mod material;
mod timed;
pub use archive::{
ArchiveCensusError, ArchiveMaterial, ArchiveMaterialResult, Archives, ArchivesResult,
archive_material, archives,
};
pub use material::{LongTerm, MaterialResult, long_term};
pub use timed::{SignatureTimeFact, TimeError, TimeResult, Timed, timestamped};
pub trait BasicStage<'path, 'document> {
type Id: Copy;
type Document: Copy;
type Generation: Copy;
type Signer: SignerReceipt<
'path,
'document,
Id = Self::Id,
Document = Self::Document,
Generation = Self::Generation,
>;
type Counters: CounterReceipts<
'path,
'document,
Id = Self::Id,
Document = Self::Document,
Generation = Self::Generation,
>;
fn signer(&self) -> &Self::Signer;
fn counters(&self) -> &Self::Counters;
fn all_requirements_met(&self) -> bool;
}
pub trait X509Material<'path, 'document> {
type Id: Copy;
type Document: Copy;
type Generation: Copy;
type Issuer;
fn requirements(
&self,
) -> &ParticipantRequirements<
'path,
'document,
Self::Id,
Self::Document,
Self::Generation,
Self::Issuer,
>;
fn all_x509_requirements_met(&self) -> bool;
}
pub trait CredentialMaterial {
type Id: Copy;
type Document: Copy;
type Generation: Copy;
type Credentials;
fn scope(&self) -> TimestampScope<Self::Id, Self::Document, Self::Generation>;
fn snapshot(&self) -> Snapshot<Self::Document, Self::Generation>;
fn credentials(&self) -> &Self::Credentials;
fn all_requirements_met(&self) -> bool;
}
pub trait ArchiveCensus {
type Id: Copy;
type Document: Copy;
type Generation: Copy;
fn signature(&self) -> Location<Self::Id, Self::Document, Self::Generation>;
fn timestamps(&self) -> usize;
fn archive(&self, ordinal: usize) -> Option<Self::Id>;
}