pub trait FromBase64UrlStr {
// Required method
fn try_from_base64url(&self) -> Result<Vec<u8>, Base64Error>;
}Expand description
Extension trait for decoding URL-safe base64 strings to byte data.
Input should be treated as untrusted; use fallible methods.
§Security Warning
Decoding input from untrusted sources should use fallible try_ methods.
Invalid input may indicate tampering or errors.
§Example
use secure_gate::FromBase64UrlStr;
let base64_string = "QkJC";
let bytes = base64_string.try_from_base64url().unwrap();
// bytes is now Vec<u8>: [66, 66, 66]Required Methods§
Sourcefn try_from_base64url(&self) -> Result<Vec<u8>, Base64Error>
fn try_from_base64url(&self) -> Result<Vec<u8>, Base64Error>
Fallibly decode a URL-safe base64 string to bytes.