pub struct Swiyu { /* private fields */ }
Expand description
A simple representation of the Swiyu app. It needs to be set up correctly by the user, which of course usually is done automatically. But for our example we want to see how the public key gets transferred from the SecureElement to the Swiyu app. In the same way you’ll have to add the VerifiedCredential manually.
Implementations§
Source§impl Swiyu
impl Swiyu
Sourcepub fn new(setup: PublicSetup) -> Self
pub fn new(setup: PublicSetup) -> Self
Create a new Swiyu app. Of course the real app will do so much more to initialize itself. But here it’s mostly a placeholder to show which actor does which parts.
Sourcepub fn add_vc(&mut self, key_id: usize, credential: VerifiedCredential)
pub fn add_vc(&mut self, key_id: usize, credential: VerifiedCredential)
Add a VerifiedCredential. In this simple implementation, only one VerifiedCredential can exist.
Sourcepub fn bbs_presentation(
&mut self,
message: VerifierMessage,
reveal: Vec<usize>,
) -> BBSPresentation
pub fn bbs_presentation( &mut self, message: VerifierMessage, reveal: Vec<usize>, ) -> BBSPresentation
Returns a BBSPresentation which is a proof that the holder knows the messages signed by the Issuer. In addition to the normal protocol, this adds two PublicCommitments to the proof, which hide the public key of the holder. When creating a BBSPresentation, the PublicCommitments are Open, meaning that their random values are accessible. Before sending a BBSPresentation to an untrusted entity, one must call BBSPresentation::close() to remove the random values.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Swiyu
impl RefUnwindSafe for Swiyu
impl Send for Swiyu
impl Sync for Swiyu
impl Unpin for Swiyu
impl UnwindSafe for Swiyu
Blanket Implementations§
§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
§type ArchivedMetadata = ()
type ArchivedMetadata = ()
§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more