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

Function getCiphertext

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

Source from the content-addressed store, hash-verified

94}
95
96func getCiphertext(encryptedKey *etree.Element) ([]byte, error) {
97 ciphertextEl := encryptedKey.FindElement("./CipherData/CipherValue")
98 if ciphertextEl == nil {
99 return nil, fmt.Errorf("cannot find CipherData element containing a CipherValue element")
100 }
101 ciphertext, err := base64.StdEncoding.DecodeString(strings.TrimSpace(ciphertextEl.Text()))
102 if err != nil {
103 return nil, err
104 }
105 return ciphertext, nil
106}
107
108func validateRSAKeyIfPresent(key interface{}, encryptedKey *etree.Element) (*rsa.PrivateKey, error) {
109 rsaKey, ok := key.(*rsa.PrivateKey)

Callers 6

DecryptMethod · 0.85
TestOAEPMGF1PUsesSHA1MGFFunction · 0.85
TestCovGetCiphertextFunction · 0.85
DecryptMethod · 0.85
DecryptMethod · 0.85

Calls

no outgoing calls

Tested by 3

TestOAEPMGF1PUsesSHA1MGFFunction · 0.68
TestCovGetCiphertextFunction · 0.68