forked from Consensys/web3signer
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remote Key signing using Aws KMS (Consensys#837)
signing/secp256k1/aws AwsKmsSigner.java: Implements Signer interface. For each kms configuration metadata file, an instance of this class will be registered. AwsKmsSignerFactory.java: Create an instance of AwsKmsSigner based on AwsKmsMetadata. The instance of this class is initialized in Eth1Runner and FilecoinRunner. This class utilizes CachedAwsKmsClientFactory. AwsKmsClient.java: Wraps Aws Kms Client library. Exposes sign and get ECPublicKey. Used by AwsKmsSigner CachedAwsKmsClientFactory.java: Factory class for providing cached instances of AwsKmsClient. The AwsKmsClientKey.java is used as a key for cache entry. The credentials and region are used for equals and hashcode. It is anticipated that same credentials/region will be specified in AwsKmsMetadata yaml files to perform various operations of multiple keys. signing/secp256k1/util Eth1SignatureUtil.java - Refactored signature calculation for internal usage i.e. R, S and V. Azure return P1363Encoded signature while AWS returns ANS.1/DER encoded signature. common/config AwsAuthenticationMode.java is moved into common as this file is common both for Aws Secrets Manager and Aws Kms Client. In addition, AwsCredentials.java is also created in common. This file is currently used by Aws Kms Client, however, in future, it should also be used by Aws Secrets Manager related classes. signing/config AwsCredentialsProviderFactory.java: Factory class that return AWS library's AwsCredentialsProvider from AwsAuthenticationMode and AwsCredentials (which are derived from metadata deserializer). signing/config/metadata AwsKmsMetadata.java - Represents new configuration type aws-kms. Supports only SECP256K1. AwsKmsMetadataDeserializer.java is responsible to convert yaml -> AwsKmsMetadata during metadata files loading. It performs validation of required fields. Very similar to existingAwsKeySigningMetadataDeserializer.java. core Eth1Runner and FilecoinRunner are modified to construct AwsKmsSignerFactory with awsKmsClientCacheSize and applySha3Hash flag. commandline/subcommands Eth1SubCommand.java and FilecoinSubCommand.java are modified to introduce cli option --aws-kms-client-cache-size which is used to construct AwsKmsSignerFactory in the runner classes mentioned above.
- Loading branch information
1 parent
be7c2c3
commit d280421
Showing
43 changed files
with
1,679 additions
and
55 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
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
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
Oops, something went wrong.