Skip to content

Commit 4be534b

Browse files
committed
fixup! Expose the QR code parsing structs used by the QR login mechanism
1 parent e922f08 commit 4be534b

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

src/qr_login.rs

+10-7
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ pub struct QrCodeData {
4444
#[wasm_bindgen]
4545
impl QrCodeData {
4646
/// Create new [`QrCodeData`] from a given public key, a rendezvous URL and,
47-
/// optionally, a homeserver ULR.
47+
/// optionally, a homeserver URL.
4848
///
4949
/// If a homeserver URL is given, then the [`QrCodeData`] mode will be
5050
/// [`QrCodeMode::Reciprocate`], i.e. the QR code will contain data for the
@@ -93,25 +93,28 @@ impl QrCodeData {
9393
Ok(Self { inner: qr_login::QrCodeData::from_base64(data)? })
9494
}
9595

96-
/// Encode the [`QrCodeData`] into a list of bytes.
96+
/// Encode the [`QrCodeData`] into a string using base64.
9797
///
98-
/// The list of bytes can be used by a QR code generator to create an image
99-
/// containing a QR code.
98+
/// This format can be used for debugging purposes and the
99+
/// [`QrcodeData::from_base64()`] method can be used to parse the string
100+
/// again.
100101
pub fn to_base64(&self) -> String {
101102
self.inner.to_base64()
102103
}
103104

104105
/// Get the Curve25519 public key embedded in the [`QrCodeData`].
105106
///
106-
/// This Curve25519 public key should be used to establish an ECIES channel
107-
/// with the other device.
107+
/// This Curve25519 public key should be used to establish an
108+
/// [ECIES](https://en.wikipedia.org/wiki/Integrated_Encryption_Scheme)
109+
/// (Elliptic Curve Integrated Encryption Scheme) channel with the other
110+
/// device.
108111
#[wasm_bindgen(getter)]
109112
pub fn public_key(&self) -> Curve25519PublicKey {
110113
self.inner.public_key.into()
111114
}
112115

113116
/// Get the URL of the rendezvous server which will be used to exchange
114-
/// devices between the two devices.
117+
/// messages between the two devices.
115118
#[wasm_bindgen(getter)]
116119
pub fn rendezvous_url(&self) -> String {
117120
self.inner.rendezvous_url.as_str().to_owned()

0 commit comments

Comments
 (0)