Skip to main content

SpMetadata

Struct SpMetadata 

Source
pub struct SpMetadata { /* private fields */ }
Expand description

Parsed SP metadata. Derefs to Metadata for the shared accessors.

Implementations§

Source§

impl SpMetadata

Source

pub fn from_xml(xml: &str) -> Result<Self, SamlError>

Parse SP metadata XML.

§Errors

Returns SamlError when XML parsing, parser resource limits, or SP-specific metadata extraction fails.

Source

pub fn from_xml_with_limits( xml: &str, limits: XmlLimits, ) -> Result<Self, SamlError>

Parse SP metadata XML with explicit XML parser resource limits.

§Errors

Returns SamlError when XML parsing, parser resource limits, or SP-specific metadata extraction fails.

Source

pub fn is_want_assertions_signed(&self) -> bool

WantAssertionsSigned flag.

Source

pub fn is_authn_request_signed(&self) -> bool

AuthnRequestsSigned flag.

Source

pub fn get_assertion_consumer_service(&self, binding: Binding) -> Option<String>

AssertionConsumerService location for binding.

Methods from Deref<Target = Metadata>§

Source

pub fn get_metadata(&self) -> &str

The original metadata XML.

Source

pub fn get_entity_id(&self) -> Option<&str>

entityID.

Source

pub fn get_name_id_format(&self) -> Vec<String>

Declared <NameIDFormat> values.

Source

pub fn x509_certificates(&self, use_: CertUse) -> Vec<String>

All X.509 certificates declared for use (raw, as written in metadata).

Source

pub fn get_x509_certificate(&self, use_: CertUse) -> Option<String>

First X.509 certificate declared for use.

Source

pub fn get_single_logout_service(&self, binding: Binding) -> Option<String>

SingleLogoutService location for binding.

Source

pub fn export_metadata(&self, path: impl AsRef<Path>) -> Result<()>

Write the metadata XML to path.

§Errors

Returns std::io::Error if the filesystem write fails.

Source

pub fn get_support_bindings(&self) -> Vec<Binding>

Bindings for which a SingleLogoutService endpoint is declared.

Source

pub fn verify_signature( &self, trusted_certificates: &[String], ) -> Result<bool, SamlError>

Verify this metadata document’s enveloped signature against trusted certificate(s) (federation trust anchor). Requires crypto-bergshamra.

§Errors

Returns SamlError when XML parsing, certificate loading, cryptographic verification, or signed <EntityDescriptor> coverage checks fail.

Source

pub fn verify_signature_with_limits( &self, trusted_certificates: &[String], limits: XmlLimits, ) -> Result<bool, SamlError>

Verify this metadata document’s signature with explicit XML parser limits.

§Errors

Returns SamlError when XML parsing, certificate loading, cryptographic verification, or signed <EntityDescriptor> coverage checks fail.

Source

pub fn verify_signature_detailed( &self, trusted_certificates: &[String], ) -> Result<MetadataSignatureVerification, SamlError>

Verify this metadata document’s signature and preserve signed <EntityDescriptor> coverage evidence using default XML parser limits.

§Errors

Returns SamlError when XML parsing, certificate loading, cryptographic verification, transform policy, or signed <EntityDescriptor> coverage checks fail.

Source

pub fn verify_signature_detailed_with_limits( &self, trusted_certificates: &[String], limits: XmlLimits, ) -> Result<MetadataSignatureVerification, SamlError>

Verify this metadata document’s signature and preserve signed <EntityDescriptor> coverage evidence.

§Errors

Returns SamlError when XML parsing, certificate loading, cryptographic verification, transform policy, or signed <EntityDescriptor> coverage checks fail.

Trait Implementations§

Source§

impl Clone for SpMetadata

Source§

fn clone(&self) -> SpMetadata

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for SpMetadata

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Deref for SpMetadata

Source§

type Target = Metadata

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Metadata

Dereferences the value.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V