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

Function TestSPDecryptsSubjectEncryptedIDWithDecryptionKeys

encrypted_id_test.go:153–164  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

151}
152
153func TestSPDecryptsSubjectEncryptedIDWithDecryptionKeys(t *testing.T) {
154 e := spcovSetup(t)
155 e.sp.Key = testRSAKey(t, "key_2017.pem")
156 e.sp.DecryptionKeys = []*rsa.PrivateKey{testRSAKey(t, "sp_key.pem")}
157
158 r := e.response()
159 r.Assertion = e.eidAssertion(t, eidNameID)
160 got, err := e.sp.ParseXMLResponse(spcovSerialize(t, e.idpSign(t, r.Element())), []string{spcovRequestID}, e.sp.AcsURL)
161 assert.NilError(t, err)
162 assert.Assert(t, got.Subject.NameID != nil)
163 assert.Check(t, is.Equal(got.Subject.NameID.Value, eidNameID.Value))
164}
165
166func TestSPDecryptsSubjectConfirmationEncryptedID(t *testing.T) {
167 e := spcovSetup(t)

Callers

nothing calls this directly

Calls 8

spcovSetupFunction · 0.85
testRSAKeyFunction · 0.85
spcovSerializeFunction · 0.85
responseMethod · 0.80
eidAssertionMethod · 0.80
ParseXMLResponseMethod · 0.80
idpSignMethod · 0.80
ElementMethod · 0.45

Tested by

no test coverage detected