(ctx context.Context, keyID string, data []byte)
| 76 | } |
| 77 | |
| 78 | func (kt *userKeyTool) GetEncrypted(ctx context.Context, keyID string, data []byte) ([]byte, error) { |
| 79 | kt.Lock() |
| 80 | defer kt.Unlock() |
| 81 | |
| 82 | keyBytes, err := kt.keyByID(ctx, keyID) |
| 83 | |
| 84 | if err != nil { |
| 85 | return nil, err |
| 86 | } |
| 87 | |
| 88 | return crypto.Seal(keyBytes, data) |
| 89 | } |
| 90 | |
| 91 | func (kt *userKeyTool) GetDecrypted(ctx context.Context, keyID string, encrypted []byte) ([]byte, error) { |
| 92 | kt.Lock() |