pub struct PartnerCredentials {
pub signing_cert_pem: Option<Arc<[u8]>>,
pub signing_key_pem: Option<Vec<u8>>,
pub recipient_cert_pem: Option<Arc<[u8]>>,
}Expand description
Unified partner credential bundle for AS2/AS4 outbound messaging.
This type centralizes signing and encryption PEM material so one caller object can drive either protocol’s send path.
Fields§
§signing_cert_pem: Option<Arc<[u8]>>PEM-encoded signing certificate.
signing_key_pem: Option<Vec<u8>>PEM-encoded signing private key.
recipient_cert_pem: Option<Arc<[u8]>>PEM-encoded recipient certificate used for encryption.
Implementations§
Source§impl PartnerCredentials
impl PartnerCredentials
Sourcepub fn to_as2_send_credentials(&self) -> As2SendCredentials
pub fn to_as2_send_credentials(&self) -> As2SendCredentials
Project unified credentials into AS2 send credentials.
Sourcepub fn to_as4_send_credentials(&self) -> As4SendCredentials
pub fn to_as4_send_credentials(&self) -> As4SendCredentials
Project unified credentials into AS4 send credentials.
Sourcepub fn prepare_as2_for_policy(
&self,
policy: &As2SendPolicy,
stage: &'static str,
error_code: ErrorCode,
) -> Result<As2PreparedSendCredentials>
pub fn prepare_as2_for_policy( &self, policy: &As2SendPolicy, stage: &'static str, error_code: ErrorCode, ) -> Result<As2PreparedSendCredentials>
Prepare AS2 credentials once for repeated send operations.
Sourcepub fn prepare_as4_for_policy(
&self,
policy: &As4SendPolicy,
stage: &'static str,
error_code: ErrorCode,
) -> Result<As4PreparedSendCredentials>
pub fn prepare_as4_for_policy( &self, policy: &As4SendPolicy, stage: &'static str, error_code: ErrorCode, ) -> Result<As4PreparedSendCredentials>
Prepare AS4 credentials once for repeated send operations.
Sourcepub fn from_pkcs12(der: &[u8], passphrase: &str) -> Result<Self>
pub fn from_pkcs12(der: &[u8], passphrase: &str) -> Result<Self>
Import a PartnerCredentials bundle from a PKCS#12 (.p12 / .pfx) file.
Most enterprise PKI systems and many trading-partner onboarding portals distribute key material as PKCS#12 bundles. This constructor parses the DER-encoded bundle, extracts the signing certificate and private key as PEM, and stores them in the returned credential object.
If the bundle contains a safebag of additional certificates they are
silently ignored — only the primary end-entity certificate and its
associated private key are extracted. The recipient_cert_pem field is
left None and can be set by the caller afterwards via direct field
assignment.
§Security
The passphrase is accepted as a &str slice and is not zeroized
after use because OpenSSL copies it internally. If passphrase hygiene
is critical, zero the source buffer after this call returns.
§Errors
Returns ErrorCode::InvalidInput if the DER bytes are not a valid
PKCS#12 bundle, or if the passphrase is incorrect.
Trait Implementations§
Source§impl Clone for PartnerCredentials
impl Clone for PartnerCredentials
Source§fn clone(&self) -> PartnerCredentials
fn clone(&self) -> PartnerCredentials
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for PartnerCredentials
impl Debug for PartnerCredentials
Source§impl Default for PartnerCredentials
impl Default for PartnerCredentials
Source§fn default() -> PartnerCredentials
fn default() -> PartnerCredentials
Source§impl Drop for PartnerCredentials
impl Drop for PartnerCredentials
Source§impl From<As2SendCredentials> for PartnerCredentials
Available on crate feature as2 only.
impl From<As2SendCredentials> for PartnerCredentials
as2 only.Source§fn from(value: As2SendCredentials) -> Self
fn from(value: As2SendCredentials) -> Self
Source§impl From<As4SendCredentials> for PartnerCredentials
Available on crate feature as4 only.
impl From<As4SendCredentials> for PartnerCredentials
as4 only.Source§fn from(value: As4SendCredentials) -> Self
fn from(value: As4SendCredentials) -> Self
Source§impl From<PartnerCredentials> for As2SendCredentials
Available on crate feature as2 only.
impl From<PartnerCredentials> for As2SendCredentials
as2 only.Source§fn from(value: PartnerCredentials) -> Self
fn from(value: PartnerCredentials) -> Self
Source§impl From<PartnerCredentials> for As4SendCredentials
Available on crate feature as4 only.
impl From<PartnerCredentials> for As4SendCredentials
as4 only.Source§fn from(value: PartnerCredentials) -> Self
fn from(value: PartnerCredentials) -> Self
Auto Trait Implementations§
impl Freeze for PartnerCredentials
impl RefUnwindSafe for PartnerCredentials
impl Send for PartnerCredentials
impl Sync for PartnerCredentials
impl Unpin for PartnerCredentials
impl UnsafeUnpin for PartnerCredentials
impl UnwindSafe for PartnerCredentials
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more