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

Function artifactdecMake

artifact_decoding_test.go:23–30  ·  view source on GitHub ↗

artifactdecMake returns a base64 type 0x0004 artifact (saml-bindings-2.0-os §3.6.4.1) with the given EndpointIndex, SourceID and a MessageHandle filled with handle.

(index uint16, sourceID [20]byte, handle byte)

Source from the content-addressed store, hash-verified

21// (saml-bindings-2.0-os §3.6.4.1) with the given EndpointIndex, SourceID and
22// a MessageHandle filled with handle.
23func artifactdecMake(index uint16, sourceID [20]byte, handle byte) string {
24 raw := make([]byte, 4, 44)
25 binary.BigEndian.PutUint16(raw[0:2], 0x0004)
26 binary.BigEndian.PutUint16(raw[2:4], index)
27 raw = append(raw, sourceID[:]...)
28 raw = append(raw, bytes.Repeat([]byte{handle}, 20)...)
29 return base64.StdEncoding.EncodeToString(raw)
30}
31
32func artifactdecIDPSourceID() [20]byte {
33 return sha1.Sum([]byte(spcovIDPEntityID)) //nolint:gosec // G401: SourceID

Calls

no outgoing calls

Tested by

no test coverage detected