| 58 | encoded_wrapped_dek_(encoded_wrapped_dek) {} |
| 59 | |
| 60 | KeyMaterial KeyMaterial::Parse(const std::string& key_material_string) { |
| 61 | ObjectParser json_parser; |
| 62 | ::arrow::Status status = json_parser.Parse(key_material_string); |
| 63 | if (!status.ok()) { |
| 64 | throw ParquetException("Failed to parse key material " + key_material_string); |
| 65 | } |
| 66 | |
| 67 | // External key material - extract "key material type", and make sure it is supported |
| 68 | std::string key_material_type; |
| 69 | PARQUET_ASSIGN_OR_THROW(key_material_type, |
| 70 | json_parser.GetString(kKeyMaterialTypeField)); |
| 71 | if (kKeyMaterialType1 != key_material_type) { |
| 72 | throw ParquetException("Wrong key material type: " + key_material_type + " vs " + |
| 73 | kKeyMaterialType1); |
| 74 | } |
| 75 | // Parse other fields (common to internal and external key material) |
| 76 | return Parse(&json_parser); |
| 77 | } |
| 78 | |
| 79 | KeyMaterial KeyMaterial::Parse(const ObjectParser* key_material_json) { |
| 80 | // 2. Check if "key material" belongs to file footer key |
nothing calls this directly
no test coverage detected