Skip to content

Commit 1222932

Browse files
committed
update README.md
1 parent 9eabfd1 commit 1222932

1 file changed

Lines changed: 13 additions & 10 deletions

File tree

README.md

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ go-app-attest is a Go package for implementing Apple App Attestation. This libra
1414
To install go-app-attest, use the following command:
1515

1616
```bash
17-
go get github.com/predicat-inc/go-app-attest
17+
go get github.com/splitsecure/go-app-attest
1818
```
1919

2020
## Usage
@@ -29,16 +29,13 @@ import (
2929
"fmt"
3030
"log"
3131

32-
appattest "github.com/predicat-inc/go-app-attest"
32+
appattest "github.com/splitsecure/go-app-attest"
3333
)
3434

3535
func main() {
3636
// Create an attestor
37-
bundleIDHash := sha256.Sum256([]byte("ABC6DEF.com.example.my.bundleid"))
38-
attestor, err := appattest.New(
39-
appattest.WithBundleIDHash(bundleIDHash[:]),
40-
appattest.WithEnvironment(appattest.EnvironmentProd),
41-
)
37+
bundleDigest := sha256.Sum256([]byte("ABC6DEF.com.example.my.bundleid"))
38+
attestor, err := appattest.New()
4239
if err != nil {
4340
log.Fatalf("creating attestor: %v", err)
4441
}
@@ -56,6 +53,15 @@ func main() {
5653
log.Fatalf("attestation: %v", res.Err)
5754
}
5855

56+
// Verify provenance
57+
if !bytes.Equal(res.EnvironmentGUID, appattest.AAGUIDProd) {
58+
log.Fatalf("attestation: issuer is not App Attest Prod")
59+
}
60+
61+
if !bytes.Equal(res.BundleDigest, bundleDigest) {
62+
log.Fatalf("attestation: attested bundle differs from the expected one")
63+
}
64+
5965
fmt.Printf("Attestation successful. Sign count: %d\n", res.AuthenticatorData.SignCount)
6066
}
6167
```
@@ -64,11 +70,8 @@ func main() {
6470

6571
The `New` function accepts several configuration options:
6672

67-
- `WithBundleIDHash(hash)`: Set the expected bundle ID hash (required)
68-
- `WithEnvironment(env)`: Set the environment (Production or Development) (default: Production)
6973
- `WithAppAttestRoots(pool)`: Provide custom certificate roots (default: Apple AppAttest root certificates)
7074
- `WithNowFn(fn)`: Provide a custom time function (default: time.Now)
71-
- `WithConstructInto(*attestor)`: Construct the attestor into an existing zero struct (default: nil)
7275

7376
## Testing
7477

0 commit comments

Comments
 (0)