[−][src]Trait push::crypto::Cryptography
Required methods
fn generate_key() -> Result<Key>
generate a new local EC p256 key
fn test_key(priv_key: &str, pub_key: &str, auth: &str) -> Key
create a test key for testing
fn decrypt(
key: &Key,
body: &str,
encoding: &str,
salt: Option<&str>,
dh: Option<&str>
) -> Result<Decrypted>
key: &Key,
body: &str,
encoding: &str,
salt: Option<&str>,
dh: Option<&str>
) -> Result<Decrypted>
General decrypt function. Calls to decrypt_aesgcm or decrypt_aes128gcm as needed.
fn decrypt_aesgcm(
key: &Key,
content: &[u8],
salt: Option<Vec<u8>>,
crypto_key: Option<Vec<u8>>
) -> Result<Decrypted>
key: &Key,
content: &[u8],
salt: Option<Vec<u8>>,
crypto_key: Option<Vec<u8>>
) -> Result<Decrypted>
Decrypt the obsolete "aesgcm" format (which is still used by a number of providers)
fn decrypt_aes128gcm(key: &Key, content: &[u8]) -> Result<Decrypted>
Decrypt the RFC 8188 format.
Implementors
impl Cryptography for Crypto
[src]
fn generate_key() -> Result<Key>
[src]
Generate a new cryptographic Key
fn test_key(priv_key: &str, pub_key: &str, auth: &str) -> Key
[src]
fn decrypt(
key: &Key,
body: &str,
encoding: &str,
salt: Option<&str>,
dh: Option<&str>
) -> Result<Decrypted>
[src]
key: &Key,
body: &str,
encoding: &str,
salt: Option<&str>,
dh: Option<&str>
) -> Result<Decrypted>
Decrypt the incoming webpush message based on the content-encoding
fn decrypt_aesgcm(
key: &Key,
content: &[u8],
salt: Option<Vec<u8>>,
crypto_key: Option<Vec<u8>>
) -> Result<Decrypted>
[src]
key: &Key,
content: &[u8],
salt: Option<Vec<u8>>,
crypto_key: Option<Vec<u8>>
) -> Result<Decrypted>