mozilla-services/go-cose

Name: go-cose

Owner: Mozilla Services

Description: go library for CBOR Object Signing and Encryption (COSE)

Created: 2018-02-13 22:57:31.0

Updated: 2018-05-18 14:27:57.0

Pushed: 2018-05-18 14:27:58.0

Homepage:

Size: 303

Language: Go

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

go-cose

Build Status Coverage Status

A COSE library for go.

It currently supports signing and verifying the SignMessage type with the ES{256,384,512} and PS256 algorithms.

API docs

Usage
Install
et -u go.mozilla.org/cose
Signing a message

See example/sign.go and run it with:

 run example/sign.go
lengths of integers r and s (256 and 256) do not match the key length 255
age signature (ES256): 043685f99421f9e80c7c3c50d0fc8266161d3d614aaa3b63d2cdf581713fca62bb5d2e34d2352dbe41424b31d0b4a11d6b2d4764c18e2af04f4520fbe494d51c
Verifying a message

See example/verify.go and run it with:

 run example/verify.go
lengths of integers r and s (256 and 254) do not match the key length 254
age signature (ES256): 9411dc5200c1cb67ccd76424ade09ce89c4a8d8d2b66f2bbf70edf63beb2dc3cbde83250773e659b635d3715442a1efaa6b0c030ee8a2523c3e37a22ddb055fa
age signature verified
Development

Running tests:

  1. Install rust and cargo

  2. On OSX: brew install nss nss then in sign_verify_cose_rust_cli_test.go add NSS_LIB_DIR to cmd or -L /usr/local/opt/nss/lib to RUSTFLAGS e.g. cmd.Env = append(os.Environ(), "NSS_LIB_DIR=/usr/local/opt/nss/lib", "RUSTFLAGS=-A dead_code -A unused_imports")

  3. If you already have dep and golint commands installed, run make install-godep install-golint

  4. Run go test


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.