-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add expected context cmm (#146)
* feat: add expected context cmm * another polymorph run for test vectors --------- Co-authored-by: seebees <[email protected]>
- Loading branch information
1 parent
840f3e7
commit 1ddbb7e
Showing
14 changed files
with
562 additions
and
124 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
112 changes: 112 additions & 0 deletions
112
.../amazon/cryptography/materialProviders/model/CreateExpectedEncryptionContextCMMInput.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,112 @@ | ||
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// Do not modify this file. This file is machine generated, and any changes to it will be overwritten. | ||
package software.amazon.cryptography.materialProviders.model; | ||
|
||
import java.util.List; | ||
import java.util.Objects; | ||
import software.amazon.cryptography.materialProviders.CryptographicMaterialsManager; | ||
import software.amazon.cryptography.materialProviders.ICryptographicMaterialsManager; | ||
import software.amazon.cryptography.materialProviders.IKeyring; | ||
import software.amazon.cryptography.materialProviders.Keyring; | ||
|
||
public class CreateExpectedEncryptionContextCMMInput { | ||
private final CryptographicMaterialsManager underlyingCMM; | ||
|
||
private final Keyring keyring; | ||
|
||
private final List<String> requiredEncryptionContextKeys; | ||
|
||
protected CreateExpectedEncryptionContextCMMInput(BuilderImpl builder) { | ||
this.underlyingCMM = builder.underlyingCMM(); | ||
this.keyring = builder.keyring(); | ||
this.requiredEncryptionContextKeys = builder.requiredEncryptionContextKeys(); | ||
} | ||
|
||
public CryptographicMaterialsManager underlyingCMM() { | ||
return this.underlyingCMM; | ||
} | ||
|
||
public Keyring keyring() { | ||
return this.keyring; | ||
} | ||
|
||
public List<String> requiredEncryptionContextKeys() { | ||
return this.requiredEncryptionContextKeys; | ||
} | ||
|
||
public Builder toBuilder() { | ||
return new BuilderImpl(this); | ||
} | ||
|
||
public static Builder builder() { | ||
return new BuilderImpl(); | ||
} | ||
|
||
public interface Builder { | ||
Builder underlyingCMM(ICryptographicMaterialsManager underlyingCMM); | ||
|
||
CryptographicMaterialsManager underlyingCMM(); | ||
|
||
Builder keyring(IKeyring keyring); | ||
|
||
Keyring keyring(); | ||
|
||
Builder requiredEncryptionContextKeys(List<String> requiredEncryptionContextKeys); | ||
|
||
List<String> requiredEncryptionContextKeys(); | ||
|
||
CreateExpectedEncryptionContextCMMInput build(); | ||
} | ||
|
||
static class BuilderImpl implements Builder { | ||
protected CryptographicMaterialsManager underlyingCMM; | ||
|
||
protected Keyring keyring; | ||
|
||
protected List<String> requiredEncryptionContextKeys; | ||
|
||
protected BuilderImpl() { | ||
} | ||
|
||
protected BuilderImpl(CreateExpectedEncryptionContextCMMInput model) { | ||
this.underlyingCMM = model.underlyingCMM(); | ||
this.keyring = model.keyring(); | ||
this.requiredEncryptionContextKeys = model.requiredEncryptionContextKeys(); | ||
} | ||
|
||
public Builder underlyingCMM(ICryptographicMaterialsManager underlyingCMM) { | ||
this.underlyingCMM = CryptographicMaterialsManager.wrap(underlyingCMM); | ||
return this; | ||
} | ||
|
||
public CryptographicMaterialsManager underlyingCMM() { | ||
return this.underlyingCMM; | ||
} | ||
|
||
public Builder keyring(IKeyring keyring) { | ||
this.keyring = Keyring.wrap(keyring); | ||
return this; | ||
} | ||
|
||
public Keyring keyring() { | ||
return this.keyring; | ||
} | ||
|
||
public Builder requiredEncryptionContextKeys(List<String> requiredEncryptionContextKeys) { | ||
this.requiredEncryptionContextKeys = requiredEncryptionContextKeys; | ||
return this; | ||
} | ||
|
||
public List<String> requiredEncryptionContextKeys() { | ||
return this.requiredEncryptionContextKeys; | ||
} | ||
|
||
public CreateExpectedEncryptionContextCMMInput build() { | ||
if (Objects.isNull(this.requiredEncryptionContextKeys())) { | ||
throw new IllegalArgumentException("Missing value for required field `requiredEncryptionContextKeys`"); | ||
} | ||
return new CreateExpectedEncryptionContextCMMInput(this); | ||
} | ||
} | ||
} |
Oops, something went wrong.