use bip39::Language;
use slugencode::errors::SlugEncodingError;
use crate::slugcrypt::internals::signature::esphand_signature::EsphandKeypair;
use crate::errors::SlugErrors;
use std::string::String;
pub trait IntoEncoding {
fn into_hex(&self) -> Result<String,SlugErrors>;
fn into_base32(&self) -> Result<String,SlugErrors>;
fn into_base32_unpadded(&self) -> Result<String,SlugErrors>;
fn into_base58(&self) -> Result<String,SlugErrors>;
fn into_base64(&self) -> Result<String,SlugErrors>;
fn into_base64_url_safe(&self) -> Result<String,SlugErrors>;
}
pub trait FromEncoding: Sized {
fn from_hex<T: AsRef<str>>(s: T) -> Result<Self,SlugErrors>;
fn from_base32<T: AsRef<str>>(s: T) -> Result<Self,SlugErrors>;
fn from_base32_unpadded<T: AsRef<str>>(s: T) -> Result<Self,SlugErrors>;
fn from_base58<T: AsRef<str>>(s: T) -> Result<Self,SlugErrors>;
fn from_base64<T: AsRef<str>>(s: T) -> Result<Self,SlugErrors>;
fn from_base64_url_safe<T: AsRef<str>>(s: T) -> Result<Self,SlugErrors>;
}
pub trait IntoBincode {
fn into_bincode(&self) -> Result<Vec<u8>,SlugErrors>;
}
pub trait FromBincode: Sized {
fn from_bincode<T: AsRef<[u8]>>(bincode: T) -> Result<Self,SlugErrors>;
}
pub trait IntoStandardEncoding {
fn into_standard_encoding(&self) -> Result<String,SlugErrors>;
}
pub trait FromStandardEncoding: Sized {
fn from_standard_encoding<T: AsRef<str>>(s: T) -> Result<Self,SlugErrors>;
}
pub trait IntoStandardPem {
fn into_standard_pem(&self) -> Result<String,SlugErrors>;
fn label_for_standard_pem() -> String;
fn label_for_standard_pem_secret() -> String;
}
pub trait FromStandardPem: Sized {
fn from_standard_pem<T: AsRef<str>>(s: T) -> Result<Self,SlugErrors>;
}
pub trait IntoSlugFormat {
fn into_slug_format() -> Result<String,SlugErrors>;
}
pub trait IntoCipherSuite {
fn cipher_suite() -> String;
}
pub trait StandardExport {
fn export(&self) -> Result<String,SlugErrors>;
}
pub trait RecoverablePublicKey {
}
pub trait HybridCryptographyRevert: Sized {
fn verify_classical(&self) -> bool;
fn verify_pq(&self) -> bool;
}
pub trait IntoPemX59: Sized {
fn into_pem_x59_standard(&self) -> Result<String,SlugErrors>;
fn from_pem_x59_standard<T: AsRef<str>>(s: T) -> Result<Self,SlugErrors>;
fn info_pem_x59_standard_label() -> String;
}
pub trait IntoPemX59PublicKey: Sized {
fn into_pem_x59_standard_pk(&self) -> Result<String,SlugErrors>;
fn from_pem_x59_standard_pk<T: AsRef<str>>(s: T) -> Result<Self,SlugErrors>;
fn info_pem_x59_standard_label() -> String;
}
pub trait IntoPem: Sized {
fn into_pem_public(&self) -> String;
fn into_pem_private(&self) -> String;
fn from_pem_public<T: AsRef<str>>(s: T) -> Result<Self,SlugErrors>;
fn from_pem_private<T: AsRef<str>>(s: T) -> Result<Self,SlugErrors>;
fn get_pem_label_for_public() -> String;
fn get_pem_label_for_secret() -> String;
}
pub trait IntoPemPublic: Sized {
fn into_pem(&self) -> Result<String,SlugErrors>;
fn from_pem<T: AsRef<str>>(public_key_in_pem: T) -> Result<Self,SlugErrors>;
fn get_pem_label() -> String;
}
pub trait IntoPemSecret: Sized {
fn into_pem_secret(&self) -> Result<String,SlugErrors>;
fn from_pem_secret<T: AsRef<str>>(secret_key_in_pem: T) -> Result<Self,SlugErrors>;
fn get_pem_label_secret() -> String;
}
pub trait IntoPemSignature: Sized {
fn into_pem(&self) -> Result<String,SlugErrors>;
fn from_pem<T: AsRef<str>>(signature_in_pem: T) -> Result<Self,SlugErrors>;
fn get_pem_label_signature() -> String;
}
pub trait GenerateWithBIP39: Sized {
fn generate_bip39<T: AsRef<str>>(num_of_words: usize, language: Language, password: T) -> Result<Self,SlugErrors>;
}
pub trait IntoX59PublicKey: Sized {
fn into_x59_pk(&self) -> Result<String,SlugErrors>;
fn from_x59_pk<T: AsRef<str>>(x59_encoded: T) -> Result<Self,SlugErrors>;
fn x59_metadata_pk() -> String;
}
pub trait IntoX59SecretKey: Sized {
fn into_x59(&self) -> Result<String,SlugErrors>;
fn from_x59<T: AsRef<str>>(x59_encoded_secret_key: T) -> Result<Self,SlugErrors>;
fn x59_metadata() -> String;
}
pub trait IntoX59Signature: Sized {
fn into_x59(&self) -> Result<String,SlugErrors>;
fn from_x59<T: AsRef<str>>(x59_encoded_signature: T) -> Result<Self,SlugErrors>;
fn x59_metadata() -> String;
}
pub trait IsMessage {
fn as_str(&self) -> &str;
fn to_str(&self) -> String;
fn as_bytes(&self) -> &[u8];
}
pub trait SignatureDigest {
fn as_digest(&self) -> String;
}