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

Function getCiphertext

xmlenc/decrypt.go:70–80  ·  view source on GitHub ↗
(encryptedKey *etree.Element)

Source from the content-addressed store, hash-verified

68}
69
70func getCiphertext(encryptedKey *etree.Element) ([]byte, error) {
71 ciphertextEl := encryptedKey.FindElement("./CipherData/CipherValue")
72 if ciphertextEl == nil {
73 return nil, fmt.Errorf("cannot find CipherData element containing a CipherValue element")
74 }
75 ciphertext, err := base64.StdEncoding.DecodeString(strings.TrimSpace(ciphertextEl.Text()))
76 if err != nil {
77 return nil, err
78 }
79 return ciphertext, nil
80}
81
82func validateRSAKeyIfPresent(key interface{}, encryptedKey *etree.Element) (*rsa.PrivateKey, error) {
83 rsaKey, ok := key.(*rsa.PrivateKey)

Callers 3

DecryptMethod · 0.85
DecryptMethod · 0.85
DecryptMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected