#[non_exhaustive]pub struct SignOptions {
pub context: Option<Vec<String>>,
pub created: Option<DateTime<Utc>>,
pub cryptosuite: Option<CryptoSuite>,
pub proof_purpose: Option<String>,
}Expand description
Re-export the upstream sign options + cryptosuite enum so callers can
build sign_trust_task options without a direct upstream dep.
Options for signing a Data Integrity proof.
Construct via SignOptions::new (or SignOptions::default) then
chain with_* methods. All fields default to None / empty; the
library fills in spec-compliant defaults (current time for created,
"assertionMethod" for proof_purpose, the signer’s declared
cryptosuite) where they are not overridden here.
SignOptions is #[non_exhaustive] from the outside: construct it
only via the provided methods, not struct-literal syntax.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.context: Option<Vec<String>>JSON-LD @context values to place on the proof. If None, the
document’s own @context is used (for RDFC canonicalization) or no
context is emitted (for JCS).
created: Option<DateTime<Utc>>Proof creation timestamp. If None, Utc::now() is used.
cryptosuite: Option<CryptoSuite>Overrides the signer’s declared cryptosuite. If None, the
library uses signer.cryptosuite().
proof_purpose: Option<String>Value of proofPurpose. Defaults to "assertionMethod".
Implementations§
Source§impl SignOptions
impl SignOptions
Sourcepub fn new() -> SignOptions
pub fn new() -> SignOptions
Constructs an empty SignOptions. Equivalent to
SignOptions::default.
Sourcepub fn with_context(self, context: Vec<String>) -> SignOptions
pub fn with_context(self, context: Vec<String>) -> SignOptions
Sets the @context value placed on the emitted proof.
Sourcepub fn with_created(self, created: DateTime<Utc>) -> SignOptions
pub fn with_created(self, created: DateTime<Utc>) -> SignOptions
Sets the created timestamp. Takes a typed DateTime<Utc>; the
library serialises it to ISO-8601 (seconds precision, Z-suffix)
at the serde boundary.
Sourcepub fn with_cryptosuite(self, suite: CryptoSuite) -> SignOptions
pub fn with_cryptosuite(self, suite: CryptoSuite) -> SignOptions
Overrides the cryptosuite that would otherwise be chosen by the
signer’s default (crate::signer::Signer::cryptosuite).
Sourcepub fn with_proof_purpose(self, purpose: impl Into<String>) -> SignOptions
pub fn with_proof_purpose(self, purpose: impl Into<String>) -> SignOptions
Overrides proofPurpose. The default is "assertionMethod".
Trait Implementations§
Source§impl Clone for SignOptions
impl Clone for SignOptions
Source§fn clone(&self) -> SignOptions
fn clone(&self) -> SignOptions
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SignOptions
impl Debug for SignOptions
Source§impl Default for SignOptions
impl Default for SignOptions
Source§fn default() -> SignOptions
fn default() -> SignOptions
Auto Trait Implementations§
impl Freeze for SignOptions
impl RefUnwindSafe for SignOptions
impl Send for SignOptions
impl Sync for SignOptions
impl Unpin for SignOptions
impl UnsafeUnpin for SignOptions
impl UnwindSafe for SignOptions
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> BorrowUnordered for T
impl<T> BorrowUnordered for T
fn as_unordered(&self) -> &Unordered<T>
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Clear for Twhere
T: InitializableFromZeroed + ?Sized,
impl<T> Clear for Twhere
T: InitializableFromZeroed + ?Sized,
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> InitializableFromZeroed for Twhere
T: Default,
impl<T> InitializableFromZeroed for Twhere
T: Default,
Source§unsafe fn initialize(place: *mut T)
unsafe fn initialize(place: *mut T)
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::RequestSource§impl<T, U, C> IntoWithContext<U, C> for Twhere
U: FromWithContext<T, C>,
impl<T, U, C> IntoWithContext<U, C> for Twhere
U: FromWithContext<T, C>,
Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<T> ResourceProvider<()> for T
impl<T> ResourceProvider<()> for T
Source§fn get_resource(&self) -> &()
fn get_resource(&self) -> &()
T.