Comments (2)
Hello,
I'm also having the same issue. The script that I have works with AWS but fails with localstack. Here's the script that I use:
awslocal kms create-key --origin EXTERNAL --description "MyImportedKey6" --key-usage SIGN_VERIFY --key-spec RSA_4096 --output json > kms.json
awslocal kms get-parameters-for-import --key-id $(cat kms.json | jq -r '.KeyMetadata.KeyId') --wrapping-algorithm RSA_AES_KEY_WRAP_SHA_256 --wrapping-key-spec RSA_4096 > import.txt
openssl genpkey -algorithm rsa -pkeyopt rsa_keygen_bits:4096 | openssl pkcs8 -topk8 -outform der -nocrypt > RSA_4096_PrivateKey.der
openssl rand -out aes-key.bin 32
openssl enc -id-aes256-wrap-pad -K "$(xxd -p < aes-key.bin | tr -d '\n')" -iv A65959A6 -in RSA_4096_PrivateKey.der -out key-material-wrapped.bin
openssl pkeyutl -encrypt -in aes-key.bin -out aes-key-wrapped.bin -inkey <(jq -r '.PublicKey' import.txt | base64 -d) -keyform DER -pubin -pkeyopt rsa_padding_mode:oaep -pkeyopt rsa_oaep_md:sha256 -pkeyopt rsa_mgf1_md:sha256
cat aes-key-wrapped.bin key-material-wrapped.bin > EncryptedKeyMaterial.bin
awslocal kms import-key-material --key-id $(cat kms.json | jq -r '.KeyMetadata.KeyId') --encrypted-key-material fileb://EncryptedKeyMaterial.bin --import-token fileb://<(jq -r '.ImportToken' import.txt | base64 -d) --expiration-model KEY_MATERIAL_DOES_NOT_EXPIRE
An error occurred (KMSInvalidStateException) when calling the ImportKeyMaterial operation: Unsupported padding, requested wrapping algorithm:'RSA_AES_KEY_WRAP_SHA_256'
make: *** [Makefile:45: import-key] Error 255
This same script works with AWS.
Thank you!
from localstack.
Welcome to LocalStack! Thanks for reporting your first issue and our team will be working towards fixing the issue for you or reach out for more background information. We recommend joining our Slack Community for real-time help and drop a message to LocalStack Pro Support if you are a Pro user! If you are willing to contribute towards fixing this issue, please have a look at our contributing guidelines and our contributing guide.
from localstack.
Related Issues (20)
- bug: AWS::ResourceGroups::Group parameter validation fails with valid configuration HOT 2
- bug: Docker image runs as root user HOT 1
- bug: Different behaviour from AWS for getObjectTagging on a delete marker HOT 1
- bug: "org.apache.hadoop.fs.s3a.S3AFileSystem not found" on Athena table creation HOT 1
- bug: DynamoDB delete_expired_items not working properly "Attribute name is a reserved keyword" HOT 1
- bug: Deploy .NET Lambda with CloudFormation template
- bug: Kinesis shard iterator ShardIteratorType.AFTER_SEQUENCE_NUMBER not always honoring startingSequenceNumber
- bug: Cloudfront multiple cache behavior with PathPattern is not working as expected HOT 1
- bug: HOT 9
- bug: aws client region ignored using credentialsprovider + latest localstack docker image HOT 4
- bug: kinesis cannot parse date in latest version HOT 2
- Extensions: Fixing "ModuleNotFoundError: No module named 'flask'"
- bug: AttributeError: 'NoneType' object has no attribute 'listeners' HOT 1
- bug: AttributeError: 'NoneType' object has no attribute 'to_bytes' HOT 7
- bug: Cannot connect to localstack container in jenkins at http://localhost:4566
- bug: [dynamodb] ExecuteStatementCommandOutput.ConsumedCapacity response format not faithful to AWS HOT 1
- bug: [dynamodb] NOT begins_with does not work with PartiQL
- bug: AWS SES message tags with colon are not allowed (ses:feedback-id-a/b) HOT 1
- bug: AWS Batch Job Unable to Connect to RDS Instance in LocalStack Environment HOT 1
- bug: Wrong DNS resolution when using podman HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from localstack.