GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — chore(README): update README.md by imabhichow · Pull Request #1940 · aws/aws-encryption-sdk-java

Conversation

@imabhichow

@imabhichow imabhichow commented Jan 10, 2024

Copy link
Copy Markdown
Contributor

Issue #, if available:

Description of changes:

  • update README.md

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Check any applicable:

  • Were any files moved? Moving files changes their URL, which breaks all hyperlinks to the files.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@imabhichow
imabhichow requested a review from a team as a code owner January 10, 2024 01:05
@imabhichow imabhichow changed the title chore: update README.md chore(README): update README.md Jan 10, 2024
josecorella
josecorella reviewed Jan 22, 2024
View reviewed changes
Comment thread README.md Resolved

Uh oh!

There was an error while loading. Please reload this page.

josecorella
josecorella reviewed Jan 22, 2024
View reviewed changes
Comment thread README.md Resolved

Uh oh!

There was an error while loading. Please reload this page.

josecorella
josecorella reviewed Jan 22, 2024
View reviewed changes
Comment thread README.md
// Encrypt the data
//
final CryptoResult<byte[], KmsMasterKey> encryptResult = crypto.encryptData(prov, plaintext.getBytes(StandardCharsets.UTF_8), context);
final CryptoResult<byte[], ?> encryptResult = crypto.encryptData(kmsKeyring, plaintext.getBytes(StandardCharsets.UTF_8), encryptionContext);

@josecorella josecorella Jan 22, 2024

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why the ? in
CryptoResult<byte[], ?>

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@texastony texastony Jan 26, 2024

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The ? is a wild card to keep encryptData API compatible with previous releases.

ESDK-Java's CryptoResult includes a definition of the actual Cryptographic Material Provider (MasterKey or MasterKeyProvider) as a Generic that can be refined at class initialization.

I am not sure if we ever refactored that CryptoResult class so
IKeyring or ICryptographicMaterialProvider could refine the Generic...

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@texastony texastony Jan 26, 2024

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We clearly did not:
https://github.com/aws/aws-encryption-sdk-java/blob/master/src/main/java/com/amazonaws/encryptionsdk/CryptoResult.java#L31

This means that following APIs are now broken for Keyring users:

  • CryptoResult.getMasterKeys
  • CryptoResult.getMasterKeyIds

Which... is not Great.
@imabhichow we should bring this up at Stand up.

Those APIs are NOT critical; one of them is even marked as deprecated.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@texastony texastony Jan 26, 2024

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Which... is not Great.

Looking into the details here, this is not bad or even an issue.

K is would be an explicit MasterKey.
If no MaterKey or MasterKeyProviders are used,
then no one SHOULD expect a list of MasterKeyIDs to be populated.

We should probably write a test to assert that nothing wild happens,
like an Exception.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

imabhichow reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

@imabhichow imabhichow Feb 1, 2024 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When using keyrings, the CryptoResult.getMasterKeyIds method returns an empty list during encryption.

However, during decryption, CryptoResult.getMasterKeyIds throws a NULL POINTER EXCEPTION. This could be due to returning a DataKey with the master key set to null. I suppose we should expect similar behavior to encryption which is returning an empty llist of masterkeys. I'll try to look more into this.

I also think we should deprecate this method CryptoResult.getMasterKeyIds

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@texastony texastony Feb 1, 2024

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should have, yes.
And we should cut a PR to prevent the NPE.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

imabhichow reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

@imabhichow imabhichow Feb 5, 2024

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With this pull request, CryptoResult.getMasterKeyIds is now deprecated and will return an empty list when we use keyrings.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
imabhichow added 6 commits January 26, 2024 03:32
@imabhichow
chore: update README.md
2a3c3c4
@imabhichow
chore: update README.md
0091cde
@imabhichow
chore: update README.md
04bf2e3
@imabhichow
chore: update README.md
c20682f
@imabhichow
chore: update README.md
5aaee17
@imabhichow
address feedback
b7f40a8
@imabhichow
imabhichow force-pushed the imabhichow/readme branch from d4b44e3 to b7f40a8 Compare January 26, 2024 11:32
@imabhichow
address feedback
a31e015
kessplas
kessplas reviewed Jan 27, 2024
View reviewed changes
Comment thread README.md Resolved

Uh oh!

There was an error while loading. Please reload this page.

imabhichow and others added 2 commits February 5, 2024 10:07
@imabhichow
Merge branch 'master' into imabhichow/readme
3828b65
@imabhichow
address feedback
e09e2ba
texastony
texastony approved these changes Feb 5, 2024
View reviewed changes
@imabhichow
imabhichow merged commit 7a0899e into master Feb 5, 2024
@imabhichow
imabhichow deleted the imabhichow/readme branch February 5, 2024 19:09
josecorella pushed a commit that referenced this pull request Jun 12, 2024
@semantic-release-bot
AWS Encryption SDK 3.0.1 Release -- 2024-06-12
a479aa8
## [3.0.1](v3.0.0...v3.0.1) (2024-06-12)

### Fixes

* Add Locale.ROOT to String uppercase conversions ([#1880](#1880)) ([9a9950e](9a9950e)), closes [#1879](#1879)
* Update DecryptionMaterials code to support legacy custom CMMs ([#2037](#2037)) ([8807d79](8807d79))

### Maintenance

* deprecate getMasterKeyIds() in CryptoResult ([#1976](#1976)) ([1890ebb](1890ebb))
* **deps:** bump bcprov-jdk18on from 1.77 to 1.78.1 ([#2032](#2032)) ([713ca11](713ca11))
* **deps:** udpate org.bouncycastle to bcprov-jdk18on ([#1891](#1891)) ([32a92a9](32a92a9))
* **deps:** update dependencies ([#1973](#1973)) ([800bd01](800bd01))
* **Examples:** Customize KMS Client ([#2001](#2001)) ([e94ee85](e94ee85))
* fix release script ([#1912](#1912)) ([57e8a0b](57e8a0b))
* **README:** update README.md ([#1940](#1940)) ([7a0899e](7a0899e))
* update node version in version step ([#1959](#1959)) ([905385d](905385d))
* Update SUPPORT_POLICY.rst ([#1924](#1924)) ([57e40b5](57e40b5))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@josecorella josecorella josecorella left review comments
@kessplas kessplas kessplas left review comments
+1 more reviewer
@texastony texastony texastony approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@imabhichow @texastony @josecorella @kessplas
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.