pub struct Signature {
pub id: String,
pub algorithm: SignatureAlgorithm,
pub signed_at: DateTime<Utc>,
pub signer: SignerInfo,
pub value: String,
pub certificate_chain: Option<Vec<String>>,
pub scope: Option<SignatureScope>,
pub timestamp: Option<TrustedTimestamp>,
pub webauthn: Option<WebAuthnSignature>,
}signatures only.Expand description
A digital signature.
Fields§
§id: StringUnique signature identifier.
algorithm: SignatureAlgorithmSignature algorithm.
signed_at: DateTime<Utc>Signing timestamp.
signer: SignerInfoSigner information.
value: StringBase64-encoded signature value.
For standard signatures, this contains the signature bytes.
For WebAuthn signatures, this may be empty if webauthn is present.
certificate_chain: Option<Vec<String>>Optional certificate chain.
scope: Option<SignatureScope>Optional signature scope for layout attestation.
When present, the signature covers the scope object (serialized with JCS) instead of just the document ID. This allows signatures to attest to specific layout renditions in addition to the semantic content.
timestamp: Option<TrustedTimestamp>Optional RFC 3161 trusted timestamp token.
webauthn: Option<WebAuthnSignature>Optional WebAuthn/FIDO2 signature data.
When present, this contains the full WebAuthn assertion data
instead of using the value field. The document ID is used
as the challenge for WebAuthn verification.
Implementations§
Source§impl Signature
impl Signature
Sourcepub fn new(
id: impl Into<String>,
algorithm: SignatureAlgorithm,
signer: SignerInfo,
value: impl Into<String>,
) -> Self
pub fn new( id: impl Into<String>, algorithm: SignatureAlgorithm, signer: SignerInfo, value: impl Into<String>, ) -> Self
Create a new signature.
Sourcepub fn new_webauthn(
id: impl Into<String>,
signer: SignerInfo,
webauthn: WebAuthnSignature,
) -> Self
pub fn new_webauthn( id: impl Into<String>, signer: SignerInfo, webauthn: WebAuthnSignature, ) -> Self
Create a new WebAuthn signature.
WebAuthn signatures use ES256 algorithm and store the full assertion data rather than a simple signature value.
Sourcepub fn with_scope(self, scope: SignatureScope) -> Self
pub fn with_scope(self, scope: SignatureScope) -> Self
Set the signature scope for layout attestation.
Sourcepub fn with_timestamp(self, timestamp: TrustedTimestamp) -> Self
pub fn with_timestamp(self, timestamp: TrustedTimestamp) -> Self
Set the trusted timestamp for this signature.
Sourcepub fn is_webauthn(&self) -> bool
pub fn is_webauthn(&self) -> bool
Check if this is a WebAuthn signature.
Sourcepub fn webauthn_data(&self) -> Option<&WebAuthnSignature>
pub fn webauthn_data(&self) -> Option<&WebAuthnSignature>
Get the WebAuthn signature data, if present.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Signature
impl<'de> Deserialize<'de> for Signature
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for Signature
impl StructuralPartialEq for Signature
Auto Trait Implementations§
impl Freeze for Signature
impl RefUnwindSafe for Signature
impl Send for Signature
impl Sync for Signature
impl Unpin for Signature
impl UnsafeUnpin for Signature
impl UnwindSafe for Signature
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.