-
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.
- Loading branch information
1 parent
7422d17
commit e55e584
Showing
1 changed file
with
32 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# JWICE | ||
|
||
Jwice is a small and incomplete library for creating jws signatures. | ||
The main purpose of this library is to explore the logic behind creating these signatures and use it in | ||
the [Demogog](https://github.com/alxandru-ionut-balan/demogog) application. | ||
|
||
## Usage | ||
|
||
You can either use the default header and change from there or create a new protected header from | ||
scratch. | ||
|
||
To use the default just do: | ||
|
||
```go | ||
protectedHeader := jws.DefaultJwsProtectedHeader() | ||
``` | ||
|
||
The default header has the following properties set: | ||
|
||
```go | ||
JwsProtectedHeader{ | ||
B64: false, | ||
Crit: []string{"sigT", "sigD", "b64"}, | ||
Alg: "RS256", | ||
SigT: time.Now().In(time.UTC).Format(time.RFC3339), | ||
SigD: SignedHeaders{ | ||
Pars: []string{"(request-target)", "digest"}, | ||
MId: "http://uri.etsi.org/19182/HttpHeaders", | ||
}, | ||
} | ||
|
||
``` |