pub struct Assertion {Show 13 fields
pub assertion_id: String,
pub issuer: String,
pub signing_algorithm: SigningAlgorithm,
pub digest_algorithm: DigestAlgorithm,
pub issue_instant: DateTime<Utc>,
pub subject_data: SubjectData,
pub conditions_not_before: DateTime<Utc>,
pub conditions_not_after: DateTime<Utc>,
pub audience: String,
pub attributes: Vec<AssertionAttribute>,
pub sign_assertion: bool,
pub signing_key: Option<PKey<Private>>,
pub signing_cert: Option<X509>,
}
Expand description
The content of an assertion
Fields
assertion_id: String
Assertion ID, referred to in the signature as ds:Reference
issuer: String
Issuer of the Assertion
signing_algorithm: SigningAlgorithm
Signing algorithm
digest_algorithm: DigestAlgorithm
Digest algorithm
issue_instant: DateTime<Utc>
Issue/Generatino time of the Assertion
subject_data: SubjectData
TODO: work out what is necessary for SubjectData
conditions_not_before: DateTime<Utc>
Please don’t let the user do this until … now!
conditions_not_after: DateTime<Utc>
Please don’t let the user do whatever we’re saying they can do after this.
audience: String
Who/what should be reading this. Probably a crate::sp::ServiceProvider
attributes: Vec<AssertionAttribute>
Attributes of the assertion, things like groups and email addresses and phone numbers and favourite kind of 🥔🍠
sign_assertion: bool
Should we sign the assertion?
signing_key: Option<PKey<Private>>
an openssl private key for signing
signing_cert: Option<X509>
Certificate for signing/digest
Implementations
sourceimpl Assertion
impl Assertion
sourcepub fn without_signature(self) -> Self
pub fn without_signature(self) -> Self
This exists so we can return a copy of an Assertion without the signature flags so we can trigger [Assertion.Into<Vec
sourcepub fn build_assertion(&self, sign: bool) -> String
pub fn build_assertion(&self, sign: bool) -> String
Build an assertion based on the Assertion, returns a String of XML.
If you set sign, it’ll sign the data.. eventually.
sourcefn add_conditions<W: Write>(&self, writer: &mut EventWriter<W>)
fn add_conditions<W: Write>(&self, writer: &mut EventWriter<W>)
adds a saml:Conditions
statement to the writer
sourcepub fn add_assertion_to_xml<W: Write>(&self, writer: &mut EventWriter<W>)
pub fn add_assertion_to_xml<W: Write>(&self, writer: &mut EventWriter<W>)
This adds the data from an Assertion to a given EventWriter.
If you specify to sign the assertion, it’s going to:
- generate a temporary EventWriter
- generate the unsigned assertion
- add the signature to the assertion
- weep quietly
- return the full pack
That’s the plan, anyway.
- AttributeStatement
- AuthnStatement
- Conditions
- Issuer
- Signature
- Subject