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

Function loadTestKeyPair

xmlenc/encrypted_key_algorithm_test.go:16–25  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

14)
15
16func loadTestKeyPair(t *testing.T) (*x509.Certificate, interface{}) {
17 t.Helper()
18 b, _ := pem.Decode(golden.Get(t, "cert.cert"))
19 cert, err := x509.ParseCertificate(b.Bytes)
20 assert.NilError(t, err)
21 kb, _ := pem.Decode(golden.Get(t, "cert.key"))
22 key, err := x509.ParsePKCS8PrivateKey(kb.Bytes)
23 assert.NilError(t, err)
24 return cert, key
25}
26
27// TestEncryptedKeyRefusesBlockCipher checks that an EncryptedKey naming a
28// block cipher is refused, so that a captured content key cannot be nested

Calls 2

DecodeMethod · 0.65
GetMethod · 0.65

Tested by

no test coverage detected