Skip to content
This repository has been archived by the owner on Feb 21, 2024. It is now read-only.

Commit

Permalink
Merge remote-tracking branch 'mdigger/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
Дмитрий Седых committed Jan 8, 2016
2 parents 9fd8df1 + f664d72 commit 62a8483
Showing 1 changed file with 17 additions and 16 deletions.
33 changes: 17 additions & 16 deletions signer.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"bytes"
"crypto/hmac"
"crypto/sha256"
"crypto/sha512"
"encoding/base64"
"encoding/json"
"errors"
Expand All @@ -26,23 +27,23 @@ func NewSignerHS256(key []byte) *Signer {
}
}

// // NewSignerHS384 возвращает инициализированный подписчик токена.
// func NewSignerHS384(key []byte) *Signer {
// return &Signer{
// hash: hmac.New(sha512.New384, key),
// name: "HS384",
// header: getHeader("HS384"),
// }
// }
// NewSignerHS384 возвращает инициализированный подписчик токена.
func NewSignerHS384(key []byte) *Signer {
return &Signer{
hash: hmac.New(sha512.New384, key),
name: "HS384",
header: getHeader("HS384"),
}
}

// // NewSignerHS512 возвращает инициализированный подписчик токена.
// func NewSignerHS512(key []byte) *Signer {
// return &Signer{
// hash: hmac.New(sha512.New, key),
// name: "HS512",
// header: getHeader("HS512"),
// }
// }
// NewSignerHS512 возвращает инициализированный подписчик токена.
func NewSignerHS512(key []byte) *Signer {
return &Signer{
hash: hmac.New(sha512.New, key),
name: "HS512",
header: getHeader("HS512"),
}
}

// Sign возвращает подписанный токен.
func (s Signer) Sign(token []byte) []byte {
Expand Down

0 comments on commit 62a8483

Please sign in to comment.