pub struct Artifact {
pub version: ArtifactVersion,
pub artifact_id: ArtifactId,
pub timestamp: DateTime<Utc>,
pub intent: Intent,
pub author_pubkey: [u8; 32],
pub author_signature: [u8; 64],
pub flags: u8,
pub reserved_a: u8,
pub note_hash: [u8; 32],
pub seal_pubkey: [u8; 32],
pub seal_signature: [u8; 64],
}Expand description
Complete artifact structure (supports both v1 and v2)
Fields§
§version: ArtifactVersion§artifact_id: ArtifactId§timestamp: DateTime<Utc>§intent: Intent§flags: u8§reserved_a: u8§note_hash: [u8; 32]§seal_pubkey: [u8; 32]§seal_signature: [u8; 64]Implementations§
Source§impl Artifact
impl Artifact
Sourcepub fn from_bytes(bytes: &[u8]) -> Result<Self>
pub fn from_bytes(bytes: &[u8]) -> Result<Self>
Parse artifact from bytes (auto-detects v1 vs v2)
Get bytes that were signed by author
Sourcepub fn seal_signing_bytes(&self) -> Result<Vec<u8>>
pub fn seal_signing_bytes(&self) -> Result<Vec<u8>>
Get bytes that were signed by seal (V2 only). Returns Err if the artifact has no seal (seal_pubkey is all zeros).
Get author key fingerprint
Sourcepub fn seal_fingerprint(&self) -> Option<KeyFingerprint>
pub fn seal_fingerprint(&self) -> Option<KeyFingerprint>
Get seal key fingerprint (V2 only)
Check if artifact has author signature
Sourcepub fn has_signature(&self) -> bool
pub fn has_signature(&self) -> bool
Check if artifact has a signature (legacy compatibility)
Check if artifact has an author public key (keyless draft = all zeros)
Sourcepub fn has_note_hash(&self) -> bool
pub fn has_note_hash(&self) -> bool
Check if note hash is present (V2 only)
Sourcepub fn state(&self) -> ArtifactState
pub fn state(&self) -> ArtifactState
Determine artifact state
Sourcepub fn with_seal_flag(self) -> Self
pub fn with_seal_flag(self) -> Self
Set seal flag (V1 only - returns new artifact with flag set)
Sourcepub fn without_seal_flag(self) -> Self
pub fn without_seal_flag(self) -> Self
Clear seal flag (V1 only - returns new artifact with flag cleared)
Remove author signature
Sourcepub fn without_signature(self) -> Self
pub fn without_signature(self) -> Self
Remove signature (legacy compatibility)
Sourcepub fn without_seal_signature(self) -> Self
pub fn without_seal_signature(self) -> Self
Remove seal signature (V2 only)