use core::fmt;
#[derive(Clone, PartialEq, Eq)]
pub struct PrivateKeyPem(String);
impl PrivateKeyPem {
pub fn new(value: impl Into<String>) -> Self {
Self(value.into())
}
pub fn as_str(&self) -> &str {
&self.0
}
}
impl fmt::Debug for PrivateKeyPem {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str("PrivateKeyPem(<redacted>)")
}
}
#[derive(Clone, PartialEq, Eq)]
pub struct CertificatePem(String);
impl CertificatePem {
pub fn new(value: impl Into<String>) -> Self {
Self(value.into())
}
pub fn as_str(&self) -> &str {
&self.0
}
}
impl fmt::Debug for CertificatePem {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str("CertificatePem(<redacted>)")
}
}
#[derive(Clone, PartialEq, Eq)]
pub struct Passphrase(String);
impl Passphrase {
pub fn new(value: impl Into<String>) -> Self {
Self(value.into())
}
pub fn as_str(&self) -> &str {
&self.0
}
}
impl fmt::Debug for Passphrase {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str("Passphrase(<redacted>)")
}
}
#[derive(Debug, Clone, Default, PartialEq, Eq)]
pub struct Credentials {
pub signing_key: Option<PrivateKeyPem>,
pub signing_key_passphrase: Option<Passphrase>,
pub signing_certificate: Option<CertificatePem>,
pub encryption_certificate: Option<CertificatePem>,
pub decryption_key: Option<PrivateKeyPem>,
pub decryption_key_passphrase: Option<Passphrase>,
}