update
This commit is contained in:
parent
ef1da94872
commit
abceac2073
5 changed files with 8 additions and 9 deletions
7
Cargo.lock
generated
7
Cargo.lock
generated
|
@ -653,9 +653,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||
checksum = "6fb8d784f27acf97159b40fc4db5ecd8aa23b9ad5ef69cdd136d3bc80665f0c0"
|
||||
|
||||
[[package]]
|
||||
name = "gnupg"
|
||||
name = "gnupg-rs"
|
||||
version = "0.1.0"
|
||||
source = "git+https://git.hydrar.de/jmarya/gnupg-rs#6848ca44c7cd0e6f4bc7d02cdd270e970a6909a3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d8252a47de27b875c2a1cc765ed161475eeab5a4116fb0b09c3be7129189a38c"
|
||||
|
||||
[[package]]
|
||||
name = "h2"
|
||||
|
@ -941,7 +942,7 @@ dependencies = [
|
|||
"actix-web",
|
||||
"chrono",
|
||||
"env_logger",
|
||||
"gnupg",
|
||||
"gnupg-rs",
|
||||
"log",
|
||||
"maud",
|
||||
"reqwest",
|
||||
|
|
|
@ -11,7 +11,7 @@ actix-web = "4.2.1"
|
|||
chrono = "0.4.22"
|
||||
env_logger = "0.9.3"
|
||||
log = "0.4.17"
|
||||
gnupg = { git = "https://git.hydrar.de/jmarya/gnupg-rs" }
|
||||
gnupg-rs = "0.1.0"
|
||||
web-base = "0.2"
|
||||
serde = {version = "1.0.147", features = ["derive"] }
|
||||
serde_json = "1.0.87"
|
||||
|
|
|
@ -3,9 +3,7 @@ mod msg;
|
|||
mod notification;
|
||||
mod pages;
|
||||
|
||||
use tokio::sync::Mutex;
|
||||
|
||||
use actix_web::{web, App, HttpServer};
|
||||
use actix_web::{web, App};
|
||||
|
||||
#[actix_web::main]
|
||||
async fn main() -> std::io::Result<()> {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
use std::io::Write;
|
||||
|
||||
pub fn encrypt(msg: &str) -> String {
|
||||
let pgp = gnupg::GnuPG::new().expect("no gpg");
|
||||
let pgp = gnupg_rs::GnuPG::new().expect("no gpg");
|
||||
let pub_key = pgp
|
||||
.import_key(&std::fs::read_to_string("./config/pub.key").expect("key could not be read"))
|
||||
.expect("key import error");
|
||||
|
|
|
@ -82,7 +82,7 @@ pub async fn public_key(r: HttpRequest) -> Result<impl Responder, Error> {
|
|||
)
|
||||
.expect("could not read key");
|
||||
|
||||
let pgp = gnupg::GnuPG::new().expect("no gpg");
|
||||
let pgp = gnupg_rs::GnuPG::new().expect("no gpg");
|
||||
let key_name = pgp.import_key(&key).expect("key not valid").name;
|
||||
let key = key.replace('\n', "<br>");
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue