(otpCode string, encrypt bool, encryptionKeyID, encryptionKey string)
| 96 | } |
| 97 | |
| 98 | func (c *Challenge) SetOtpCode(otpCode string, encrypt bool, encryptionKeyID, encryptionKey string) error { |
| 99 | c.OtpCode = otpCode |
| 100 | if encrypt { |
| 101 | es, err := crypto.NewEncryptedString(c.ID.String(), []byte(otpCode), encryptionKeyID, encryptionKey) |
| 102 | if err != nil { |
| 103 | return err |
| 104 | } |
| 105 | |
| 106 | c.OtpCode = es.String() |
| 107 | } |
| 108 | return nil |
| 109 | |
| 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 { |
no test coverage detected