Beispielkonfigurationen - AWS Datenbankverschlüsselung SDK

Die vorliegende Übersetzung wurde maschinell erstellt. Im Falle eines Konflikts oder eines Widerspruchs zwischen dieser übersetzten Fassung und der englischen Fassung (einschließlich infolge von Verzögerungen bei der Übersetzung) ist die englische Fassung maßgeblich.

Beispielkonfigurationen

Unsere clientseitige Verschlüsselungsbibliothek wurde in AWS Database Encryption SDK umbenannt. Dieses Entwicklerhandbuch enthält weiterhin Informationen zum DynamoDB Encryption Client.

Die folgenden Beispiele zeigen, wie Standard- und Compound-Beacons konfiguriert werden. Die folgenden Konfigurationen bieten keine Beacon-Längen. Hilfe bei der Bestimmung der geeigneten Beacon-Länge für Ihre Konfiguration finden Sie unter Wählen Sie eine Beacon-Länge.

Vollständige Codebeispiele, die die Konfiguration und Verwendung von Beacons demonstrieren, finden Sie in den Beispielen für durchsuchbare Java - und .NET-Verschlüsselung im -dynamodb-Repository unter. aws-database-encryption-sdk GitHub

Standard-Beacons

Wenn Sie das inspector_id_last4 Feld nach exakten Übereinstimmungen abfragen möchten, erstellen Sie ein Standard-Beacon mit der folgenden Konfiguration.

Java
List<StandardBeacon> standardBeaconList = new ArrayList<>(); StandardBeacon exampleStandardBeacon = StandardBeacon.builder() .name("inspector_id_last4") .length(beaconLengthInBits) .build(); standardBeaconList.add(exampleStandardBeacon);
C# / .NET
var standardBeaconList = new List<StandardBeacon>>); StandardBeacon exampleStandardBeacon = new StandardBeacon { Name = "inspector_id_last4", Length = 10 }; standardBeaconList.Add(exampleStandardBeacon);

Zusammengesetzte Beacons

Wenn Sie die UnitInspection Datenbank auf inspector_id_last4 und abfragen möchteninspector_id_last4.unit, erstellen Sie ein zusammengesetztes Beacon mit der folgenden Konfiguration. Für diesen Compound Beacon sind nur verschlüsselte Teile erforderlich.

Java
// 1. Create standard beacons for the inspector_id_last4 and unit fields. List<StandardBeacon> standardBeaconList = new ArrayList<>); StandardBeacon inspectorBeacon = StandardBeacon.builder() .name("inspector_id_last4") .length(beaconLengthInBits) .build(); standardBeaconList.add(inspectorBeacon); StandardBeacon unitBeacon = StandardBeacon.builder() .name("unit") .length(beaconLengthInBits) .build(); standardBeaconList.add(unitBeacon); // 2. Define the encrypted parts. List<EncryptedPart> encryptedPartList = new ArrayList<>); // Each encrypted part needs a name and prefix // The name must be the name of the standard beacon // The prefix must be unique // For this example we use the prefix "I-" for "inspector_id_last4" // and "U-" for "unit" EncryptedPart encryptedPartInspector = EncryptedPart.builder() .name("inspector_id_last4") .prefix("I-") .build(); encryptedPartList.add(encryptedPartInspector); EncryptedPart encryptedPartUnit = EncryptedPart.builder() .name("unit") .prefix("U-") .build(); encryptedPartList.add(encryptedPartUnit); // 3. Create the compound beacon. // This compound beacon only requires a name, split character, // and list of encrypted parts CompoundBeacon inspectorUnitBeacon = CompoundBeacon.builder() .name("inspectorUnitBeacon") .split(".") .sensitive(encryptedPartList) .build();
C# / .NET
// 1. Create standard beacons for the inspector_id_last4 and unit fields. StandardBeacon inspectorBeacon = new StandardBeacon { Name = "inspector_id_last4", Length = 10 }; standardBeaconList.Add(inspectorBeacon); StandardBeacon unitBeacon = new StandardBeacon { Name = "unit", Length = 30 }; standardBeaconList.Add(unitBeacon); // 2. Define the encrypted parts. var last4EncryptedPart = new EncryptedPart // Each encrypted part needs a name and prefix // The name must be the name of the standard beacon // The prefix must be unique // For this example we use the prefix "I-" for "inspector_id_last4" // and "U-" for "unit" var last4EncryptedPart = new EncryptedPart { Name = "inspector_id_last4", Prefix = "I-" }; encryptedPartList.Add(last4EncryptedPart); var unitEncryptedPart = new EncryptedPart { Name = "unit", Prefix = "U-" }; encryptedPartList.Add(unitEncryptedPart); // 3. Create the compound beacon. // This compound beacon only requires a name, split character, // and list of encrypted parts var compoundBeaconList = new List<CompoundBeacon>>); var inspectorCompoundBeacon = new CompoundBeacon { Name = "inspector_id_last4", Split = ".", Encrypted = encryptedPartList }; compoundBeaconList.Add(inspectorCompoundBeacon);