Documentation ¶
Index ¶
- Constants
- Variables
- func CreateJwk(keytype string) (*jose.JSONWebKey, error)
- func ReadKeyFromFile(filename string) (*jose.JSONWebKey, error)
- func ReadKeyFromJson(jsonbytes []byte) (*jose.JSONWebKey, error)
- func WriteKeyToFile(key *jose.JSONWebKey, filename string) error
- type Signer
- func (s *Signer) DetachPayload(jws *jose.JSONWebSignature) (string, string, error)
- func (s *Signer) EmbedKey(mode bool)
- func (s *Signer) SetOption(key jose.HeaderKey, data interface{})
- func (s *Signer) SetOptions(options *jose.SignerOptions)
- func (s *Signer) SignPayload(payload string) (*jose.JSONWebSignature, error)
Constants ¶
View Source
const ( TYPE_RSA = "rsa" TYPE_ECDSA = "ecdsa" )
Variables ¶
View Source
var ( UnkownKeyTypeError = errors.New("UnkownKeyType").Msg("cannot create key of type %s") GenerateKeyError = errors.New("GenerateKeyError").Msg("failed to generate %s key: %s") WriteKeyError = errors.New("WriteKeyError").Msg("failed to write key to file: %s") MarshallKeyError = errors.New("MarshallKeyError").Msg("failed to marshall key to json").Make() )
Functions ¶
func CreateJwk ¶
func CreateJwk(keytype string) (*jose.JSONWebKey, error)
CreateJwk creates a new JWK of type keytype and stores it to filename keytype can be "rsa" or "ecdsa"
func ReadKeyFromFile ¶
func ReadKeyFromFile(filename string) (*jose.JSONWebKey, error)
func ReadKeyFromJson ¶
func ReadKeyFromJson(jsonbytes []byte) (*jose.JSONWebKey, error)
func WriteKeyToFile ¶
func WriteKeyToFile(key *jose.JSONWebKey, filename string) error
Types ¶
type Signer ¶
type Signer struct {
// contains filtered or unexported fields
}
func (*Signer) DetachPayload ¶
func (*Signer) SetOptions ¶
func (s *Signer) SetOptions(options *jose.SignerOptions)
func (*Signer) SignPayload ¶
func (s *Signer) SignPayload(payload string) (*jose.JSONWebSignature, error)
Click to show internal directories.
Click to hide internal directories.