Install & Compatibility
Where this runs
No compatibility data collected yet for this library.
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
jose
✓ gopkg.in/square/go-jose.v2
Encrypt a message using JWE with AES-GCM
package main
import (
"fmt"
"gopkg.in/square/go-jose.v2"
)
func main() {
key := []byte("secret-32-byte-key-1234567890abcdef")
encrypter, err := jose.NewEncrypter(jose.A256GCM, jose.Recipient{Algorithm: jose.A256GCMKW, Key: key}, nil)
if err != nil {
panic(err)
}
object, err := encrypter.Encrypt([]byte("hello, world"))
if err != nil {
panic(err)
}
fmt.Println(object.FullSerialize())
}
Debug
Known issues
No known issues recorded.
Upgrade
Version history
2.6.0latest on pkg.go.dev
Audit
Dependencies
No dependency data recorded yet.