(decryptionKeys map[string]string, encrypt bool, encryptionKeyID string)
| 110 | } |
| 111 | |
| 112 | func (c *Challenge) GetOtpCode(decryptionKeys map[string]string, encrypt bool, encryptionKeyID string) (string, bool, error) { |
| 113 | if es := crypto.ParseEncryptedString(c.OtpCode); es != nil { |
| 114 | bytes, err := es.Decrypt(c.ID.String(), decryptionKeys) |
| 115 | if err != nil { |
| 116 | return "", false, err |
| 117 | } |
| 118 | |
| 119 | return string(bytes), encrypt && es.ShouldReEncrypt(encryptionKeyID), nil |
| 120 | } |
| 121 | |
| 122 | return c.OtpCode, encrypt, nil |
| 123 | |
| 124 | } |
no test coverage detected