Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
33cd35d
docs: module, client, clientconfig Go documentation
wobondar Mar 13, 2024
44393ef
docs: types documentation
wobondar Mar 14, 2024
797b2c0
docs: format package documentation, minor fixes
wobondar Mar 14, 2024
7e7c73e
docs: SDK model package documentation
wobondar Mar 14, 2024
006146b
refactor(suite): get rid of a global variable
wobondar Mar 14, 2024
3e51706
refactor(suite): move MessageType to format package
wobondar Mar 14, 2024
fd76e8b
refactor(suite): move ContentAADString into bodyaad package
wobondar Mar 14, 2024
de1b7bc
docs: suite package documentation
wobondar Mar 14, 2024
a349dfa
refactor(utils): move rand under internal package
wobondar Mar 15, 2024
c1de113
refactor(providers): move providers common package under internal pac…
wobondar Mar 15, 2024
d86de45
refactor(utils): move itertools package under internal package
wobondar Mar 15, 2024
15d68d4
docs: providers package documentation
wobondar Mar 15, 2024
c019d35
docs: arn package documentation
wobondar Mar 15, 2024
50b6d41
refactor(utils): move arn package
wobondar Mar 15, 2024
ba880e3
fix(utils): lint issues with arn pkg
wobondar Mar 15, 2024
1626bb1
refactor(utils): move structs package, documentation
wobondar Mar 15, 2024
eb7fc1a
docs: materials package documentation
wobondar Mar 15, 2024
ef714bb
refactor(utils): conv package moved under internal packages, document…
wobondar Mar 15, 2024
87c67b2
refactor(utils): keyderivation moved under internal packages, documen…
wobondar Mar 15, 2024
977473a
refactor(utils): move GCM encryption under internal packages, documen…
wobondar Mar 15, 2024
7e53348
docs(model): GCM encryption documentation
wobondar Mar 15, 2024
2f13e36
docs(keys): KMS key documentation
wobondar Mar 15, 2024
7be11ab
docs(keys): Raw Master Key documentation
wobondar Mar 15, 2024
14c34b2
docs(keys): Base key and generic key errors documentation
wobondar Mar 15, 2024
0db7e4b
docs(kmsprovider): KMS Master Key Provider documentation
wobondar Mar 15, 2024
550b27b
chore(model): Custom key provider type
wobondar Mar 21, 2024
b7f04d2
feat(keyprovider): keyprovider alias package
wobondar Mar 21, 2024
e0b2c89
fix(kmsprovider): clean up
wobondar Mar 21, 2024
092d82e
docs(rawprovider): Raw Master Key Provider documentation
wobondar Mar 21, 2024
22d9a34
docs: update README
wobondar Mar 21, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ linters:
- wrapcheck
- gofmt
- zerologlint
# enable these on the next golangci-lint release:
# - copyloopvar
# - intrange

linters-settings:
errorlint:
Expand Down Expand Up @@ -126,8 +129,8 @@ linters-settings:
- assign
ignored-files:
- 'algorithm\.go'
- 'pkg/utils/conv/conv\.go'
- 'pkg/helpers/arn/arn\.go'
- 'pkg/internal/utils/conv/conv\.go'
- 'pkg/utils/arn/arn\.go'
ignored-functions:
- '^math\.'
- '^http\.StatusText$'
Expand Down Expand Up @@ -180,7 +183,7 @@ issues:
- path: 'pkg/suite/algorithm.go'
linters:
- gochecknoglobals
- path: 'pkg/utils/conv/conv.go'
- path: 'pkg/internal/utils/conv/conv.go'
linters:
- gochecknoglobals
- linters:
Expand Down
15 changes: 6 additions & 9 deletions .mockery.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ packages:
config:
mockname: "MockEncrypter"
filename: "Encrypter_mock.go"
GcmCrypter:
AEADEncrypter:
AEADDecrypter:
github.com/chainifynet/aws-encryption-sdk-go/pkg/model/format:
interfaces:
MessageAAD:
Expand All @@ -50,15 +53,9 @@ packages:
MessageFooter:
Deserializer:
Serializer:
github.com/chainifynet/aws-encryption-sdk-go/pkg/utils/encryption:
interfaces:
GcmBase:
config:
mockname: "MockEncrypter"
filename: "Encrypter_mock.go"
AEADDecrypter:
AEADEncrypter:
github.com/chainifynet/aws-encryption-sdk-go/pkg/utils/rand:
github.com/chainifynet/aws-encryption-sdk-go/pkg/internal/utils/rand:
config:
dir: mocks/{{ replaceAll .PackagePath "internal" "internal_" }}
interfaces:
RandomGenerator:
github.com/chainifynet/aws-encryption-sdk-go/pkg/internal/crypto/signature:
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -188,13 +188,13 @@ if err != nil {
## TODO

- [ ] Add support for Caching Materials Manager.
- [x] Add support for Message Format Version 1 [#170](https://github.com/chainifynet/aws-encryption-sdk-go/pull/46).
- [x] Add support for Message Format Version 1 [#170](https://github.com/chainifynet/aws-encryption-sdk-go/pull/170).
- [x] Add support for AWS KMS Multi-Region Keys [#46](https://github.com/chainifynet/aws-encryption-sdk-go/pull/46).
- [ ] Add support for KMS aliases.
- [x] Cover `providers` package with tests.
- [x] Cover `keys` package with tests.
- [x] Cover `materials` package with tests.
- [ ] GoDoc documentation.
- [x] GoDoc documentation [#294](https://github.com/chainifynet/aws-encryption-sdk-go/pull/294).
- [ ] Streamlined encryption and decryption.

## Support and Contributions
Expand Down
69 changes: 69 additions & 0 deletions doc.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,73 @@
// Copyright Chainify Group LTD. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0

// Package sdk is the Unofficial Go SDK implementation of the AWS Encryption SDK.
//
// # Getting started
//
// To install the AWS Encryption SDK for Go, use the following command:
//
// go get github.com/chainifynet/aws-encryption-sdk-go@latest
//
// # Usage
//
// The following example demonstrates how to use SDK to encrypt and decrypt data using a static key.
//
// package main
//
// import (
// "context"
// "fmt"
//
// "github.com/chainifynet/aws-encryption-sdk-go/pkg/client"
// "github.com/chainifynet/aws-encryption-sdk-go/pkg/materials"
// "github.com/chainifynet/aws-encryption-sdk-go/pkg/providers/rawprovider"
// )
//
// func main() {
// // static key to use for encryption and decryption
// staticKey1 := []byte("superSecureKeySecureKey32bytes32")
//
// // data to encrypt
// secretData := []byte("secret data to encrypt")
//
// // setup Encryption SDK client with default configuration
// sdkClient := client.NewClient()
//
// // setup Raw Key provider
// rawKeyProvider, err := rawprovider.NewWithOpts(
// "raw",
// rawprovider.WithStaticKey("static1", staticKey1),
// )
// if err != nil {
// panic(err) // handle error
// }
//
// // setup crypto materials manager
// cmm, err := materials.NewDefault(rawKeyProvider)
// if err != nil {
// panic(err) // handle error
// }
//
// // encrypt data without encryption context passing nil as the third argument
// encrypted, header, err := sdkClient.Encrypt(context.TODO(), secretData, nil, cmm)
// if err != nil {
// panic(err) // handle error
// }
//
// fmt.Printf("encrypted encryption context: %v\n", header.AADData().EncryptionContext())
//
// // decrypt "encrypted" data
// decrypted, _, err := sdkClient.Decrypt(context.TODO(), encrypted, cmm)
// if err != nil {
// panic(err) // handle error
// }
//
// fmt.Printf("decrypted data: %s\n", decrypted)
//
// // verify that "decrypted" plaintext is identical to the original secret data
// if string(decrypted) != string(secretData) {
// panic("decrypted data does not match with the original data")
// }
// }
package sdk
2 changes: 1 addition & 1 deletion example/discoveryFilterKmsProvider/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ import (

"github.com/chainifynet/aws-encryption-sdk-go/pkg/client"
"github.com/chainifynet/aws-encryption-sdk-go/pkg/clientconfig"
"github.com/chainifynet/aws-encryption-sdk-go/pkg/helpers/arn"
"github.com/chainifynet/aws-encryption-sdk-go/pkg/materials"
"github.com/chainifynet/aws-encryption-sdk-go/pkg/providers/kmsprovider"
"github.com/chainifynet/aws-encryption-sdk-go/pkg/suite"
"github.com/chainifynet/aws-encryption-sdk-go/pkg/utils/arn"
)

// encrypts and then decrypts a string using KMS key provider with discovery filter
Expand Down
2 changes: 1 addition & 1 deletion example/mrkAwareKmsProvider/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ import (

"github.com/chainifynet/aws-encryption-sdk-go/pkg/client"
"github.com/chainifynet/aws-encryption-sdk-go/pkg/clientconfig"
"github.com/chainifynet/aws-encryption-sdk-go/pkg/helpers/arn"
"github.com/chainifynet/aws-encryption-sdk-go/pkg/materials"
"github.com/chainifynet/aws-encryption-sdk-go/pkg/providers/kmsprovider"
"github.com/chainifynet/aws-encryption-sdk-go/pkg/suite"
"github.com/chainifynet/aws-encryption-sdk-go/pkg/utils/arn"
)

// encrypts and then decrypts a string using MRK-aware KMS key provider
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading