2019-01-24 20:15:10 +00:00
|
|
|
// Copyright (C) 2019 Storj Labs, Inc.
|
2018-10-11 15:35:55 +01:00
|
|
|
// See LICENSE for copying information.
|
|
|
|
|
|
|
|
package auth
|
|
|
|
|
|
|
|
import (
|
2019-01-30 20:47:21 +00:00
|
|
|
"storj.io/storj/pkg/identity"
|
2019-02-07 09:04:29 +00:00
|
|
|
"storj.io/storj/pkg/pkcrypto"
|
2018-10-11 15:35:55 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
// GenerateSignature creates signature from identity id
|
2019-01-30 20:47:21 +00:00
|
|
|
func GenerateSignature(data []byte, identity *identity.FullIdentity) ([]byte, error) {
|
2019-02-07 20:39:20 +00:00
|
|
|
return pkcrypto.HashAndSign(identity.Key, data)
|
2018-10-11 15:35:55 +01:00
|
|
|
}
|