pub struct EncryptedRefreshToken(/* private fields */);Expand description
A PAS refresh_token that has been encrypted with TokenCipher::encrypt.
This newtype is the only shape in which the middleware hands a refresh
token to consumer code (SessionStore::create). Plaintext refresh tokens
never cross the SDK→consumer boundary, so consumers cannot accidentally
persist them in clear.
Construct via TokenCipher::encrypt_to_token when you need to wrap a
known plaintext yourself (e.g., test fixtures).
Implementations§
Source§impl EncryptedRefreshToken
impl EncryptedRefreshToken
Sourcepub fn as_str(&self) -> &str
pub fn as_str(&self) -> &str
Get the base64 ciphertext as a string slice.
Use this when persisting the value to a database column. Do not log.
Sourcepub fn into_inner(self) -> String
pub fn into_inner(self) -> String
Consume and return the inner ciphertext.
Sourcepub fn from_stored(ciphertext: String) -> Self
pub fn from_stored(ciphertext: String) -> Self
Build from a previously-stored ciphertext (e.g., loaded from the database when running a liveness check).
Trait Implementations§
Source§impl Clone for EncryptedRefreshToken
impl Clone for EncryptedRefreshToken
Source§fn clone(&self) -> EncryptedRefreshToken
fn clone(&self) -> EncryptedRefreshToken
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for EncryptedRefreshToken
impl Debug for EncryptedRefreshToken
Source§impl Display for EncryptedRefreshToken
impl Display for EncryptedRefreshToken
impl Eq for EncryptedRefreshToken
Source§impl PartialEq for EncryptedRefreshToken
impl PartialEq for EncryptedRefreshToken
impl StructuralPartialEq for EncryptedRefreshToken
Auto Trait Implementations§
impl Freeze for EncryptedRefreshToken
impl RefUnwindSafe for EncryptedRefreshToken
impl Send for EncryptedRefreshToken
impl Sync for EncryptedRefreshToken
impl Unpin for EncryptedRefreshToken
impl UnsafeUnpin for EncryptedRefreshToken
impl UnwindSafe for EncryptedRefreshToken
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
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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
Compare self to
key and return true if they are equal.