MCPcopy Create free account
hub / github.com/crewjam/saml / Element

Method Element

schema.go:1463–1481  ·  view source on GitHub ↗

Element returns an etree.Element representing the object in XML form.

()

Source from the content-addressed store, hash-verified

1461
1462// Element returns an etree.Element representing the object in XML form.
1463func (s *SubjectConfirmationData) Element() *etree.Element {
1464 el := etree.NewElement("saml:SubjectConfirmationData")
1465 if !s.NotBefore.IsZero() {
1466 el.CreateAttr("NotBefore", formatTime(s.NotBefore))
1467 }
1468 if !s.NotOnOrAfter.IsZero() {
1469 el.CreateAttr("NotOnOrAfter", formatTime(s.NotOnOrAfter))
1470 }
1471 if s.Recipient != "" {
1472 el.CreateAttr("Recipient", s.Recipient)
1473 }
1474 if s.InResponseTo != "" {
1475 el.CreateAttr("InResponseTo", s.InResponseTo)
1476 }
1477 if s.Address != "" {
1478 el.CreateAttr("Address", s.Address)
1479 }
1480 return el
1481}
1482
1483// MarshalXML implements xml.Marshaler
1484func (s SubjectConfirmationData) MarshalXML(e *xml.Encoder, start xml.StartElement) error {

Callers

nothing calls this directly

Calls 1

formatTimeFunction · 0.85

Tested by

no test coverage detected