impl SSK.convert()

This commit is contained in:
Horhik 2021-01-28 19:29:15 +02:00
parent 0c64a3a41e
commit f1c2107b18

View file

@ -229,7 +229,12 @@ fn is_ssk_parsing() {
impl FcpRequest for SSK { impl FcpRequest for SSK {
fn convert(&self) -> String { fn convert(&self) -> String {
unimplemented!(); let mut settings: String = "".to_string();
match &self.settings {
Some(res) => settings = format!(",{}", res),
_ => {}
}
format!("SSK@{},{}{}", self.sign_key, self.decrypt_key, settings)
} }
} }
@ -239,7 +244,7 @@ fn is_ssk_converting() {
sign_key: "AKTTKG6YwjrHzWo67laRcoPqibyiTdyYufjVg54fBlWr".to_string(), sign_key: "AKTTKG6YwjrHzWo67laRcoPqibyiTdyYufjVg54fBlWr".to_string(),
decrypt_key: "AwUSJG5ZS-FDZTqnt6skTzhxQe08T-fbKXj8aEHZsXM".to_string(), decrypt_key: "AwUSJG5ZS-FDZTqnt6skTzhxQe08T-fbKXj8aEHZsXM".to_string(),
settings: None settings: None
}.convert(), "SSK@BnHXXv3Fa43w~~iz1tNUd~cj4OpUuDjVouOWZ5XlpX0,AwUSJG5ZS-FDZTqnt6skTzhxQe08T-fbKXj8aEHZsXM,AQABAAE"); }.convert(), "SSK@AKTTKG6YwjrHzWo67laRcoPqibyiTdyYufjVg54fBlWr,AwUSJG5ZS-FDZTqnt6skTzhxQe08T-fbKXj8aEHZsXM");
assert_eq!(SSK { assert_eq!(SSK {
sign_key: "BnHXXv3Fa43w~~iz1tNUd~cj4OpUuDjVouOWZ5XlpX0".to_string(), sign_key: "BnHXXv3Fa43w~~iz1tNUd~cj4OpUuDjVouOWZ5XlpX0".to_string(),
decrypt_key: "AwUSJG5ZS-FDZTqnt6skTzhxQe08T-fbKXj8aEHZsXM".to_string(), decrypt_key: "AwUSJG5ZS-FDZTqnt6skTzhxQe08T-fbKXj8aEHZsXM".to_string(),