pub struct AppKey(/* private fields */);Expand description
The 32-byte secret behind every signature and every ciphertext.
Debug is implemented by hand and prints nothing useful, so a key cannot
leak into a log line or the development error page by accident.
Implementations§
Source§impl AppKey
impl AppKey
Sourcepub fn from_bytes(bytes: [u8; 32]) -> Self
pub fn from_bytes(bytes: [u8; 32]) -> Self
Wrap raw key material.
Sourcepub fn from_base64(value: &str) -> Result<Self>
pub fn from_base64(value: &str) -> Result<Self>
Parse a configured key, with or without Laravel’s base64: prefix.
Sourcepub fn from_config(config: &Config) -> Result<Self>
pub fn from_config(config: &Config) -> Result<Self>
Read app.key out of the configuration tree.
Sourcepub fn generate() -> String
pub fn generate() -> String
A fresh key, formatted the way it belongs in .env.
The base64: prefix is kept so the value is self-describing: an
operator can tell at a glance that the key is encoded, not a passphrase.
pub fn as_bytes(&self) -> &[u8; 32]
Trait Implementations§
Auto Trait Implementations§
impl Freeze for AppKey
impl RefUnwindSafe for AppKey
impl Send for AppKey
impl Sync for AppKey
impl Unpin for AppKey
impl UnsafeUnpin for AppKey
impl UnwindSafe for AppKey
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